Skip to content

Commit 2664ea5

Browse files
authored
Rollup merge of rust-lang#71286 - Alexendoo:test-issue-69654, r=Dylan-DPC
Add regression test for rust-lang#69654 closes rust-lang#69654 r? @eddyb
2 parents 19ee378 + 5d855c4 commit 2664ea5

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#![feature(const_generics)]
2+
#![allow(incomplete_features)]
3+
4+
trait Bar<O> {}
5+
impl<O> Bar<O> for [u8; O] {}
6+
//~^ ERROR expected value, found type parameter `O`
7+
8+
struct Foo<const O: usize> {}
9+
impl<const O: usize> Foo<O>
10+
where
11+
[u8; O]: Bar<[(); O]>,
12+
{
13+
fn foo() {}
14+
}
15+
16+
fn main() {
17+
Foo::foo();
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0423]: expected value, found type parameter `O`
2+
--> $DIR/issue-69654.rs:5:25
3+
|
4+
LL | impl<O> Bar<O> for [u8; O] {}
5+
| ^ help: a tuple variant with a similar name exists: `Ok`
6+
|
7+
::: $SRC_DIR/libcore/result.rs:LL:COL
8+
|
9+
LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
10+
| --------------------------------------------------- similarly named tuple variant `Ok` defined here
11+
12+
error: aborting due to previous error
13+
14+
For more information about this error, try `rustc --explain E0423`.

0 commit comments

Comments
 (0)