Add regression test for #69654
This commit is contained in:
parent
339a938fa6
commit
5d855c4551
18
src/test/ui/const-generics/issues/issue-69654.rs
Normal file
18
src/test/ui/const-generics/issues/issue-69654.rs
Normal file
@ -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
src/test/ui/const-generics/issues/issue-69654.stderr
Normal file
14
src/test/ui/const-generics/issues/issue-69654.stderr
Normal file
@ -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`.
|
Loading…
x
Reference in New Issue
Block a user