From 23ada9495ff8dccc2c38f235f8289b0ee76cee6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Thu, 24 Oct 2019 00:00:00 +0000 Subject: [PATCH] Avoid mixing error patterns with error annotations When both error patterns and error annotations are present in an ui test, only error patterns are validated against the output. Replace the error pattern with an error annotation to avoid silently ignoring the other error annotation. --- src/test/ui/continue-after-missing-main.nll.stderr | 4 ++-- src/test/ui/continue-after-missing-main.rs | 4 +--- src/test/ui/continue-after-missing-main.stderr | 6 +++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/test/ui/continue-after-missing-main.nll.stderr b/src/test/ui/continue-after-missing-main.nll.stderr index b94c365f2539..c3eea2e7b8ad 100644 --- a/src/test/ui/continue-after-missing-main.nll.stderr +++ b/src/test/ui/continue-after-missing-main.nll.stderr @@ -3,8 +3,8 @@ error[E0601]: `main` function not found in crate `continue_after_missing_main` | LL | / #![allow(dead_code)] LL | | -LL | | // error-pattern:`main` function not found in crate -LL | | +LL | | struct Tableau<'a, MP> { +LL | | provider: &'a MP, ... | LL | | LL | | } diff --git a/src/test/ui/continue-after-missing-main.rs b/src/test/ui/continue-after-missing-main.rs index 7455c2a431d6..55796408e9d7 100644 --- a/src/test/ui/continue-after-missing-main.rs +++ b/src/test/ui/continue-after-missing-main.rs @@ -1,6 +1,4 @@ -#![allow(dead_code)] - -// error-pattern:`main` function not found in crate +#![allow(dead_code)] //~ ERROR `main` function not found in crate struct Tableau<'a, MP> { provider: &'a MP, diff --git a/src/test/ui/continue-after-missing-main.stderr b/src/test/ui/continue-after-missing-main.stderr index d764e7d860af..64d34cb6a194 100644 --- a/src/test/ui/continue-after-missing-main.stderr +++ b/src/test/ui/continue-after-missing-main.stderr @@ -3,15 +3,15 @@ error[E0601]: `main` function not found in crate `continue_after_missing_main` | LL | / #![allow(dead_code)] LL | | -LL | | // error-pattern:`main` function not found in crate -LL | | +LL | | struct Tableau<'a, MP> { +LL | | provider: &'a MP, ... | LL | | LL | | } | |_^ consider adding a `main` function to `$DIR/continue-after-missing-main.rs` error[E0623]: lifetime mismatch - --> $DIR/continue-after-missing-main.rs:30:56 + --> $DIR/continue-after-missing-main.rs:28:56 | LL | tableau: Tableau<'data_provider, AdaptedMatrixProvider<'original_data, MP>>, | ------------------------------------------------------------------ these two types are declared with different lifetimes...