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* // Cyclic assoc. const defaults don't error unless *used*
trait Tr { trait Tr {
const A: u8 = Self::B; 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; 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 --> $DIR/defaults-cyclic-fail.rs:5:19
| |
LL | const A: u8 = Self::B; 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`... note: ...which requires const-evaluating `Tr::B`...
--> $DIR/defaults-cyclic-fail.rs:8:19 --> $DIR/defaults-cyclic-fail.rs:8:19
| |
LL | const B: u8 = Self::A; 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` note: cycle used when const-evaluating `main`
--> $DIR/defaults-cyclic-fail.rs:16:16 --> $DIR/defaults-cyclic-fail.rs:16:16
| |

View file

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