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.
Rollup merge of rust-lang#124427 - gurry:122191-unhandled-type, r=matthiaskrgr Add missing tests for an ICE Fixes rust-lang#122191
- Loading branch information
Showing
2 changed files
with
76 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 @@ | ||
type Foo = impl Send; | ||
//~^ ERROR `impl Trait` in type aliases is unstable | ||
|
||
struct A; | ||
|
||
const VALUE: Foo = value(); | ||
//~^ ERROR cannot find function `value` in this scope | ||
|
||
fn test() { | ||
match VALUE { | ||
0 | 0 => {} | ||
//~^ ERROR mismatched types | ||
//~| ERROR mismatched types | ||
_ => (), | ||
} | ||
} | ||
|
||
fn main() {} |
58 changes: 58 additions & 0 deletions
58
tests/ui/consts/const-eval/ice-unhandled-type-122191.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,58 @@ | ||
error[E0658]: `impl Trait` in type aliases is unstable | ||
--> $DIR/ice-unhandled-type-122191.rs:1:12 | ||
| | ||
LL | type Foo = impl Send; | ||
| ^^^^^^^^^ | ||
| | ||
= 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 | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error[E0425]: cannot find function `value` in this scope | ||
--> $DIR/ice-unhandled-type-122191.rs:6:20 | ||
| | ||
LL | const VALUE: Foo = value(); | ||
| ^^^^^ not found in this scope | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/ice-unhandled-type-122191.rs:11:9 | ||
| | ||
LL | type Foo = impl Send; | ||
| --------- the expected opaque type | ||
... | ||
LL | match VALUE { | ||
| ----- this expression has type `Foo` | ||
LL | 0 | 0 => {} | ||
| ^ expected opaque type, found integer | ||
| | ||
= note: expected opaque type `Foo` | ||
found type `{integer}` | ||
note: this item must have the opaque type in its signature in order to be able to register hidden types | ||
--> $DIR/ice-unhandled-type-122191.rs:9:4 | ||
| | ||
LL | fn test() { | ||
| ^^^^ | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/ice-unhandled-type-122191.rs:11:13 | ||
| | ||
LL | type Foo = impl Send; | ||
| --------- the expected opaque type | ||
... | ||
LL | match VALUE { | ||
| ----- this expression has type `Foo` | ||
LL | 0 | 0 => {} | ||
| ^ expected opaque type, found integer | ||
| | ||
= note: expected opaque type `Foo` | ||
found type `{integer}` | ||
note: this item must have the opaque type in its signature in order to be able to register hidden types | ||
--> $DIR/ice-unhandled-type-122191.rs:9:4 | ||
| | ||
LL | fn test() { | ||
| ^^^^ | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
Some errors have detailed explanations: E0308, E0425, E0658. | ||
For more information about an error, try `rustc --explain E0308`. |