Skip to content

Commit 1c9b979

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 44cde5d commit 1c9b979

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

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

+1-3
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

+3-3
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)