From 9930e1ff0a889631f853a31838121600cea2b400 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Sun, 5 Jan 2020 02:12:16 +0100 Subject: [PATCH] Fix tests that fail with `--emit metadata` --- .../ui/associated-const/defaults-cyclic-fail.rs | 4 ++-- .../associated-const/defaults-cyclic-fail.stderr | 14 ++++++++++++-- .../associated-const/defaults-not-assumed-fail.rs | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/test/ui/associated-const/defaults-cyclic-fail.rs b/src/test/ui/associated-const/defaults-cyclic-fail.rs index 0f54d67574d..9b899ee316a 100644 --- a/src/test/ui/associated-const/defaults-cyclic-fail.rs +++ b/src/test/ui/associated-const/defaults-cyclic-fail.rs @@ -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; } diff --git a/src/test/ui/associated-const/defaults-cyclic-fail.stderr b/src/test/ui/associated-const/defaults-cyclic-fail.stderr index dee4620cdf6..940182d4aa6 100644 --- a/src/test/ui/associated-const/defaults-cyclic-fail.stderr +++ b/src/test/ui/associated-const/defaults-cyclic-fail.stderr @@ -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 | diff --git a/src/test/ui/associated-const/defaults-not-assumed-fail.rs b/src/test/ui/associated-const/defaults-not-assumed-fail.rs index 27435ef34a0..5a0704231ad 100644 --- a/src/test/ui/associated-const/defaults-not-assumed-fail.rs +++ b/src/test/ui/associated-const/defaults-not-assumed-fail.rs @@ -1,4 +1,4 @@ -// compile-fail +// build-fail trait Tr { const A: u8 = 255;