From 5d855c455111049bc335e7c57618e4e57fe86548 Mon Sep 17 00:00:00 2001 From: Alex Macleod Date: Sat, 18 Apr 2020 17:01:44 +0100 Subject: [PATCH] Add regression test for #69654 --- .../ui/const-generics/issues/issue-69654.rs | 18 ++++++++++++++++++ .../const-generics/issues/issue-69654.stderr | 14 ++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/test/ui/const-generics/issues/issue-69654.rs create mode 100644 src/test/ui/const-generics/issues/issue-69654.stderr 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 00000000000..2befbe56d85 --- /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 00000000000..9d52603f462 --- /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`.