forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
tests/ui/pattern/usefulness/issue-119778-type-error-ice.rs
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,13 @@ | ||
fn main() {} | ||
|
||
fn foo() { | ||
#[derive(Copy, Clone)] | ||
struct Foo([u8; S]); | ||
//~^ ERROR cannot find value `S` | ||
//~| ERROR cannot find value `S` | ||
|
||
type U = impl Copy; | ||
//~^ ERROR `impl Trait` in type aliases is unstable | ||
let foo: U = Foo(()); | ||
let Foo(()) = foo; | ||
} |
35 changes: 35 additions & 0 deletions
35
tests/ui/pattern/usefulness/issue-119778-type-error-ice.stderr
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,35 @@ | ||
error[E0425]: cannot find value `S` in this scope | ||
--> $DIR/issue-119778-type-error-ice.rs:5:21 | ||
| | ||
LL | struct Foo([u8; S]); | ||
| ^ not found in this scope | ||
| | ||
help: you might be missing a const parameter | ||
| | ||
LL | struct Foo<const S: /* Type */>([u8; S]); | ||
| +++++++++++++++++++++ | ||
|
||
error[E0425]: cannot find value `S` in this scope | ||
--> $DIR/issue-119778-type-error-ice.rs:5:21 | ||
| | ||
LL | struct Foo([u8; S]); | ||
| ^ not found in this scope | ||
| | ||
help: you might be missing a const parameter | ||
| | ||
LL | struct Foo<const S: /* Type */>([u8; S]); | ||
| +++++++++++++++++++++ | ||
|
||
error[E0658]: `impl Trait` in type aliases is unstable | ||
--> $DIR/issue-119778-type-error-ice.rs:9:14 | ||
| | ||
LL | type U = impl Copy; | ||
| ^^^^^^^^^ | ||
| | ||
= note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information | ||
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
Some errors have detailed explanations: E0425, E0658. | ||
For more information about an error, try `rustc --explain E0425`. |