diff --git a/src/test/ui/const-generics/issues/issue-69654.rs b/src/test/ui/const-generics/issues/issue-69654.rs new file mode 100644 index 0000000000000..2befbe56d85c7 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-69654.rs @@ -0,0 +1,18 @@ +#![feature(const_generics)] +#![allow(incomplete_features)] + +trait Bar {} +impl Bar for [u8; O] {} +//~^ ERROR expected value, found type parameter `O` + +struct Foo {} +impl Foo +where + [u8; O]: Bar<[(); O]>, +{ + fn foo() {} +} + +fn main() { + Foo::foo(); +} diff --git a/src/test/ui/const-generics/issues/issue-69654.stderr b/src/test/ui/const-generics/issues/issue-69654.stderr new file mode 100644 index 0000000000000..9d52603f462be --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-69654.stderr @@ -0,0 +1,14 @@ +error[E0423]: expected value, found type parameter `O` + --> $DIR/issue-69654.rs:5:25 + | +LL | impl Bar for [u8; O] {} + | ^ help: a tuple variant with a similar name exists: `Ok` + | + ::: $SRC_DIR/libcore/result.rs:LL:COL + | +LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), + | --------------------------------------------------- similarly named tuple variant `Ok` defined here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0423`.