Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add regression test for #69654 #71286

Merged
merged 1 commit into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/test/ui/const-generics/issues/issue-69654.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#![feature(const_generics)]
#![allow(incomplete_features)]

trait Bar<O> {}
impl<O> Bar<O> for [u8; O] {}
//~^ ERROR expected value, found type parameter `O`

struct Foo<const O: usize> {}
impl<const O: usize> Foo<O>
where
[u8; O]: Bar<[(); O]>,
{
fn foo() {}
}

fn main() {
Foo::foo();
}
14 changes: 14 additions & 0 deletions src/test/ui/const-generics/issues/issue-69654.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error[E0423]: expected value, found type parameter `O`
--> $DIR/issue-69654.rs:5:25
|
LL | impl<O> Bar<O> 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`.