Fix tests that fail with --emit metadata

This commit is contained in:
Jonas Schievink 2020-01-05 02:12:16 +01:00
parent 232c1f331c
commit 9930e1ff0a
3 changed files with 15 additions and 5 deletions

View File

@ -1,9 +1,9 @@
// compile-fail
// build-fail
// Cyclic assoc. const defaults don't error unless *used*
trait Tr {
const A: u8 = Self::B;
//~^ ERROR cycle detected when const-evaluating `Tr::A`
//~^ ERROR cycle detected when const-evaluating + checking `Tr::A`
const B: u8 = Self::A;
}

View File

@ -1,15 +1,25 @@
error[E0391]: cycle detected when const-evaluating `Tr::A`
error[E0391]: cycle detected when const-evaluating + checking `Tr::A`
--> $DIR/defaults-cyclic-fail.rs:5:5
|
LL | const A: u8 = Self::B;
| ^^^^^^^^^^^^^^^^^^^^^^
|
note: ...which requires const-evaluating `Tr::A`...
--> $DIR/defaults-cyclic-fail.rs:5:19
|
LL | const A: u8 = Self::B;
| ^^^^^^^
note: ...which requires const-evaluating + checking `Tr::B`...
--> $DIR/defaults-cyclic-fail.rs:8:5
|
LL | const B: u8 = Self::A;
| ^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires const-evaluating `Tr::B`...
--> $DIR/defaults-cyclic-fail.rs:8:19
|
LL | const B: u8 = Self::A;
| ^^^^^^^
= note: ...which again requires const-evaluating `Tr::A`, completing the cycle
= note: ...which again requires const-evaluating + checking `Tr::A`, completing the cycle
note: cycle used when const-evaluating `main`
--> $DIR/defaults-cyclic-fail.rs:16:16
|

View File

@ -1,4 +1,4 @@
// compile-fail
// build-fail
trait Tr {
const A: u8 = 255;