Skip to content

Commit 2f35141

Browse files
committed
Auto merge of #46641 - petrochenkov:nohelp2, r=nikomatsakis
Move compile-fail tests with NOTE/HELP annotations to UI Remove NOTE/HELP annotations from UI tests cc #44844 @oli-obk @est31 r? @nikomatsakis
2 parents 0077d12 + 66bd53a commit 2f35141

File tree

714 files changed

+6707
-1976
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

714 files changed

+6707
-1976
lines changed

src/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/test/COMPILER_TESTS.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,15 @@ Sometimes these built-in normalizations are not enough. In such cases, you
133133
may provide custom normalization rules using the header commands, e.g.
134134

135135
```
136-
// normalize-stderr-32bit: "fn() (32 bits)" -> "fn() ($PTR bits)"
137-
// normalize-stderr-64bit: "fn() (64 bits)" -> "fn() ($PTR bits)"
136+
// normalize-stdout-test: "foo" -> "bar"
137+
// normalize-stderr-32bit: "fn\(\) \(32 bits\)" -> "fn\(\) \($$PTR bits\)"
138+
// normalize-stderr-64bit: "fn\(\) \(64 bits\)" -> "fn\(\) \($$PTR bits\)"
138139
```
139140

140141
This tells the test, on 32-bit platforms, whenever the compiler writes
141142
`fn() (32 bits)` to stderr, it should be normalized to read `fn() ($PTR bits)`
142-
instead. Similar for 64-bit.
143+
instead. Similar for 64-bit. The replacement is performed by regexes using
144+
default regex flavor provided by `regex` crate.
143145

144146
The corresponding reference file will use the normalized output to test both
145147
32-bit and 64-bit platforms:
@@ -156,4 +158,5 @@ Please see `ui/transmute/main.rs` and `.stderr` for a concrete usage example.
156158

157159
Besides `normalize-stderr-32bit` and `-64bit`, one may use any target
158160
information or stage supported by `ignore-X` here as well (e.g.
159-
`normalize-stderr-windows`).
161+
`normalize-stderr-windows` or simply `normalize-stderr-test` for unconditional
162+
replacement).

src/test/compile-fail/E0005.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@
1111
fn main() {
1212
let x = Some(1);
1313
let Some(y) = x; //~ ERROR E0005
14-
//~| NOTE pattern `None` not covered
1514
}

src/test/compile-fail/E0007.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ fn main() {
1313
match x {
1414
op_string @ Some(s) => {},
1515
//~^ ERROR E0007
16-
//~| NOTE binds an already bound by-move value by moving it
1716
//~| ERROR E0303
18-
//~| NOTE not allowed after `@`
1917
None => {},
2018
}
2119
}

src/test/compile-fail/E0008.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ fn main() {
1212
match Some("hi".to_string()) {
1313
Some(s) if s.len() == 0 => {},
1414
//~^ ERROR E0008
15-
//~| NOTE moves value into pattern guard
1615
_ => {},
1716
}
1817
}

src/test/compile-fail/E0009.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ fn main() {
1414
match x {
1515
Some((y, ref z)) => {},
1616
//~^ ERROR E0009
17-
//~| NOTE by-move pattern here
18-
//~| NOTE both by-ref and by-move used
1917
None => panic!()
2018
}
2119
}

src/test/compile-fail/E0010.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@
1212
#![allow(warnings)]
1313

1414
const CON : Box<i32> = box 0; //~ ERROR E0010
15-
//~| NOTE allocation not allowed in
1615

1716
fn main() {}

src/test/compile-fail/E0017.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ static X: i32 = 1;
1212
const C: i32 = 2;
1313

1414
const CR: &'static mut i32 = &mut C; //~ ERROR E0017
15-
//~| NOTE constants require immutable values
1615
static STATIC_REF: &'static mut i32 = &mut X; //~ ERROR E0017
17-
//~| NOTE statics require immutable values
1816
//~| ERROR cannot borrow
1917
static CONST_REF: &'static mut i32 = &mut C; //~ ERROR E0017
20-
//~| NOTE statics require immutable values
2118
fn main() {}

src/test/compile-fail/E0023.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ fn main() {
1818
let x = Fruit::Apple(String::new(), String::new());
1919
match x {
2020
Fruit::Apple(a) => {}, //~ ERROR E0023
21-
//~| NOTE expected 2 fields, found 1
2221
Fruit::Apple(a, b, c) => {}, //~ ERROR E0023
23-
//~| NOTE expected 2 fields, found 3
2422
Fruit::Pear(1, 2) => {}, //~ ERROR E0023
25-
//~| NOTE expected 1 field, found 2
2623
}
2724
}

src/test/compile-fail/E0025.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,4 @@ fn main() {
1717
let x = Foo { a:1, b:2 };
1818
let Foo { a: x, a: y, b: 0 } = x;
1919
//~^ ERROR field `a` bound multiple times in the pattern
20-
//~| NOTE multiple uses of `a` in pattern
21-
//~| NOTE first use of `a`
2220
}

0 commit comments

Comments
 (0)