forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`. |