Skip to content

Commit 23ada94

Browse files
committed
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.
1 parent dae4c6e commit 23ada94

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

src/test/ui/continue-after-missing-main.nll.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ error[E0601]: `main` function not found in crate `continue_after_missing_main`
33
|
44
LL | / #![allow(dead_code)]
55
LL | |
6-
LL | | // error-pattern:`main` function not found in crate
7-
LL | |
6+
LL | | struct Tableau<'a, MP> {
7+
LL | | provider: &'a MP,
88
... |
99
LL | |
1010
LL | | }

src/test/ui/continue-after-missing-main.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#![allow(dead_code)]
2-
3-
// error-pattern:`main` function not found in crate
1+
#![allow(dead_code)] //~ ERROR `main` function not found in crate
42

53
struct Tableau<'a, MP> {
64
provider: &'a MP,

src/test/ui/continue-after-missing-main.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ error[E0601]: `main` function not found in crate `continue_after_missing_main`
33
|
44
LL | / #![allow(dead_code)]
55
LL | |
6-
LL | | // error-pattern:`main` function not found in crate
7-
LL | |
6+
LL | | struct Tableau<'a, MP> {
7+
LL | | provider: &'a MP,
88
... |
99
LL | |
1010
LL | | }
1111
| |_^ consider adding a `main` function to `$DIR/continue-after-missing-main.rs`
1212

1313
error[E0623]: lifetime mismatch
14-
--> $DIR/continue-after-missing-main.rs:30:56
14+
--> $DIR/continue-after-missing-main.rs:28:56
1515
|
1616
LL | tableau: Tableau<'data_provider, AdaptedMatrixProvider<'original_data, MP>>,
1717
| ------------------------------------------------------------------ these two types are declared with different lifetimes...

0 commit comments

Comments
 (0)