Add regression tests
This commit is contained in:
parent
39d2f2affd
commit
301c8decce
14
tests/ui/consts/erroneous_type_in_promoted.rs
Normal file
14
tests/ui/consts/erroneous_type_in_promoted.rs
Normal file
@ -0,0 +1,14 @@
|
||||
//! ICE test #124348
|
||||
//! We should not be running const eval if the layout has errors.
|
||||
|
||||
enum Eek {
|
||||
TheConst,
|
||||
UnusedByTheConst(Sum),
|
||||
//~^ ERROR cannot find type `Sum` in this scope
|
||||
}
|
||||
|
||||
const fn foo() {
|
||||
let x: &'static [Eek] = &[];
|
||||
}
|
||||
|
||||
fn main() {}
|
28
tests/ui/consts/erroneous_type_in_promoted.stderr
Normal file
28
tests/ui/consts/erroneous_type_in_promoted.stderr
Normal file
@ -0,0 +1,28 @@
|
||||
error[E0412]: cannot find type `Sum` in this scope
|
||||
--> $DIR/erroneous_type_in_promoted.rs:6:22
|
||||
|
|
||||
LL | UnusedByTheConst(Sum),
|
||||
| ^^^ not found in this scope
|
||||
|
|
||||
help: consider importing this trait
|
||||
|
|
||||
LL + use std::iter::Sum;
|
||||
|
|
||||
|
||||
note: erroneous constant encountered
|
||||
--> $DIR/erroneous_type_in_promoted.rs:11:29
|
||||
|
|
||||
LL | let x: &'static [Eek] = &[];
|
||||
| ^^^
|
||||
|
||||
note: erroneous constant encountered
|
||||
--> $DIR/erroneous_type_in_promoted.rs:11:29
|
||||
|
|
||||
LL | let x: &'static [Eek] = &[];
|
||||
| ^^^
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0412`.
|
Loading…
Reference in New Issue
Block a user