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

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/test/COMPILER_TESTS.md

+7-4
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

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

-2
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

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

-2
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

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

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

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

-2
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
}

src/test/compile-fail/E0026.rs

-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,5 @@ fn main() {
1818
match thing {
1919
Thing { x, y, z } => {}
2020
//~^ ERROR struct `Thing` does not have a field named `z` [E0026]
21-
//~| NOTE struct `Thing` does not have field `z`
2221
}
2322
}

src/test/compile-fail/E0027.rs

-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ fn main() {
1919
match d {
2020
Dog { age: x } => {}
2121
//~^ ERROR pattern does not mention field `name`
22-
//~| NOTE missing field `name`
2322
}
2423
}

src/test/compile-fail/E0029.rs

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ fn main() {
1414
match s {
1515
"hello" ... "world" => {}
1616
//~^ ERROR only char and numeric types are allowed in range patterns
17-
//~| NOTE ranges require char or numeric types
18-
//~| NOTE start type: &'static str
19-
//~| NOTE end type: &'static str
2017
//~| ERROR non-reference pattern used to match a reference
2118
_ => {}
2219
}

src/test/compile-fail/E0030.rs

-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ fn main() {
1313
match 5u32 {
1414
1000 ... 5 => {}
1515
//~^ ERROR lower range bound must be less than or equal to upper
16-
//~| NOTE lower bound larger than upper bound
1716
}
1817
}

src/test/compile-fail/E0033.rs

-3
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@ trait SomeTrait {
1515
fn main() {
1616
let trait_obj: &SomeTrait = SomeTrait;
1717
//~^ ERROR expected value, found trait `SomeTrait`
18-
//~| NOTE not a value
1918
//~| ERROR E0038
2019
//~| method `foo` has no receiver
21-
//~| NOTE the trait `SomeTrait` cannot be made into an object
2220

2321
let &invalid = trait_obj;
2422
//~^ ERROR E0033
25-
//~| NOTE type `&SomeTrait` cannot be dereferenced
2623
}

src/test/compile-fail/E0034.rs

-3
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,12 @@ trait Trait2 {
2020

2121
impl Trait1 for Test {
2222
fn foo() {}
23-
//~^ NOTE candidate #1 is defined in an impl of the trait `Trait1` for the type `Test`
2423
}
2524

2625
impl Trait2 for Test {
2726
fn foo() {}
28-
//~^ NOTE candidate #2 is defined in an impl of the trait `Trait2` for the type `Test`
2927
}
3028

3129
fn main() {
3230
Test::foo() //~ ERROR multiple applicable items in scope
33-
//~| NOTE multiple `foo` found
3431
}

src/test/compile-fail/E0038.rs

-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ trait Trait {
1414

1515
fn call_foo(x: Box<Trait>) {
1616
//~^ ERROR E0038
17-
//~| NOTE the trait `Trait` cannot be made into an object
18-
//~| NOTE method `foo` references the `Self` type in its arguments or return type
1917
let y = x.foo();
2018
}
2119

src/test/compile-fail/E0040.rs

-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,4 @@ fn main() {
2222
let mut x = Foo { x: -7 };
2323
x.drop();
2424
//~^ ERROR E0040
25-
//~| NOTE explicit destructor calls not allowed
2625
}

src/test/compile-fail/E0045.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
extern "Rust" { fn foo(x: u8, ...); } //~ ERROR E0045
12-
//~| NOTE variadics require C or cdecl calling convention
1312

1413
fn main() {
1514
}

src/test/compile-fail/E0049.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99
// except according to those terms.
1010

1111
trait Foo {
12-
fn foo<T: Default>(x: T) -> Self; //~ NOTE expected 1 type parameter
12+
fn foo<T: Default>(x: T) -> Self;
1313
}
1414

1515
struct Bar;
1616

1717
impl Foo for Bar {
1818
fn foo(x: bool) -> Self { Bar } //~ ERROR E0049
19-
//~| NOTE found 0 type parameters
2019
}
2120

2221
fn main() {

src/test/compile-fail/E0050.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,17 @@
99
// except according to those terms.
1010

1111
trait Foo {
12-
fn foo(&self, x: u8) -> bool; //~ NOTE trait requires 2 parameters
13-
fn bar(&self, x: u8, y: u8, z: u8); //~ NOTE trait requires 4 parameters
14-
fn less(&self); //~ NOTE trait requires 1 parameter
12+
fn foo(&self, x: u8) -> bool;
13+
fn bar(&self, x: u8, y: u8, z: u8);
14+
fn less(&self);
1515
}
1616

1717
struct Bar;
1818

1919
impl Foo for Bar {
2020
fn foo(&self) -> bool { true } //~ ERROR E0050
21-
//~| NOTE expected 2 parameters, found 1
2221
fn bar(&self) { } //~ ERROR E0050
23-
//~| NOTE expected 4 parameters, found 1
2422
fn less(&self, x: u8, y: u8, z: u8) { } //~ ERROR E0050
25-
//~| NOTE expected 1 parameter, found 4
2623
}
2724

2825
fn main() {

src/test/compile-fail/E0055.rs

-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@ fn main() {
2020
let ref_foo = &&Foo;
2121
ref_foo.foo();
2222
//~^ ERROR E0055
23-
//~| NOTE deref recursion limit reached
2423
}

src/test/compile-fail/E0060.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
extern "C" {
1212
fn printf(_: *const u8, ...) -> u32;
13-
//~^ NOTE defined here
1413
}
1514

1615
fn main() {

src/test/compile-fail/E0061.rs

-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
// except according to those terms.
1010

1111
fn f(a: u16, b: &str) {}
12-
//~^ NOTE defined here
1312

1413
fn f2(a: u16) {}
15-
//~^ NOTE defined here
1614

1715
fn main() {
1816
f(0);

src/test/compile-fail/E0062.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ struct Foo {
1414

1515
fn main() {
1616
let x = Foo {
17-
x: 0, //~ NOTE first use of `x`
17+
x: 0,
1818
x: 0,
1919
//~^ ERROR E0062
20-
//~| NOTE used more than once
2120
};
2221
}

src/test/compile-fail/E0063.rs

-4
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,10 @@ struct TruncatedPluralFoo {
4141
fn main() {
4242
let w = SingleFoo { };
4343
//~^ ERROR missing field `x` in initializer of `SingleFoo`
44-
//~| NOTE missing `x`
4544
let x = PluralFoo {x: 1};
4645
//~^ ERROR missing fields `y`, `z` in initializer of `PluralFoo`
47-
//~| NOTE missing `y`, `z`
4846
let y = TruncatedFoo{x:1};
4947
//~^ missing fields `a`, `b`, `y` and 1 other field in initializer of `TruncatedFoo`
50-
//~| NOTE `a`, `b`, `y` and 1 other field
5148
let z = TruncatedPluralFoo{x:1};
5249
//~^ ERROR missing fields `a`, `b`, `c` and 2 other fields in initializer of `TruncatedPluralFoo`
53-
//~| NOTE missing `a`, `b`, `c` and 2 other fields
5450
}

src/test/compile-fail/E0067.rs

-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,4 @@ use std::collections::LinkedList;
1313
fn main() {
1414
LinkedList::new() += 1; //~ ERROR E0368
1515
//~^ ERROR E0067
16-
//~^^ NOTE invalid expression for left-hand side
17-
//~| NOTE cannot use `+=` on type `std::collections::LinkedList<_>`
1816
}

src/test/compile-fail/E0069.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
fn foo() -> u8 {
1212
return;
1313
//~^ ERROR `return;` in a function whose return type is not `()`
14-
//~| NOTE return type is not ()
1514
}
1615

1716
fn main() {

src/test/compile-fail/E0071.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ type FooAlias = Foo;
1414
fn main() {
1515
let u = FooAlias { value: 0 };
1616
//~^ ERROR expected struct, variant or union type, found enum `Foo` [E0071]
17-
//~| NOTE not a struct
1817
}

src/test/compile-fail/E0076.rs

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#[repr(simd)]
1414
struct Bad(u16, u32, u32);
1515
//~^ ERROR E0076
16-
//~| NOTE SIMD elements must have the same type
1716

1817
fn main() {
1918
}

src/test/compile-fail/E0081.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99
// except according to those terms.
1010

1111
enum Enum {
12-
P = 3, //~ NOTE first use of `3isize`
12+
P = 3,
1313
X = 3,
1414
//~^ ERROR discriminant value `3isize` already exists
15-
//~| NOTE enum already has `3isize`
1615
Y = 5
1716
}
1817

src/test/compile-fail/E0084.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
#[repr(i32)] //~ ERROR: E0084
12-
enum Foo {} //~ NOTE: zero-variant enum
12+
enum Foo {}
1313

1414
fn main() {
1515
}

src/test/compile-fail/E0087.rs

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ fn bar<T>() {}
1313

1414
fn main() {
1515
foo::<f64>(); //~ ERROR expected at most 0 type parameters, found 1 type parameter [E0087]
16-
//~^ NOTE expected 0 type parameters
1716

1817
bar::<f64, u64>(); //~ ERROR expected at most 1 type parameter, found 2 type parameters [E0087]
19-
//~^ NOTE expected 1 type parameter
2018
}

src/test/compile-fail/E0089.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@ fn foo<T, U>() {}
1212

1313
fn main() {
1414
foo::<f64>(); //~ ERROR expected 2 type parameters, found 1 type parameter [E0089]
15-
//~| NOTE expected 2 type parameters
1615
}

src/test/compile-fail/E0090.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@ fn foo<'a: 'b, 'b: 'a>() {}
1212

1313
fn main() {
1414
foo::<'static>(); //~ ERROR expected 2 lifetime parameters, found 1 lifetime parameter [E0090]
15-
//~^ NOTE expected 2 lifetime parameters
1615
}

src/test/compile-fail/E0091.rs

-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
// except according to those terms.
1010

1111
type Foo<T> = u32; //~ ERROR E0091
12-
//~| NOTE unused type parameter
1312
type Foo2<A, B> = Box<A>; //~ ERROR E0091
14-
//~| NOTE unused type parameter
1513

1614
fn main() {
1715
}

src/test/compile-fail/E0092.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![feature(intrinsics)]
1212
extern "rust-intrinsic" {
1313
fn atomic_foo(); //~ ERROR E0092
14-
} //~| NOTE unrecognized atomic operation
14+
}
1515

1616
fn main() {
1717
}

src/test/compile-fail/E0093.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
extern "rust-intrinsic" {
1313
fn foo();
1414
//~^ ERROR E0093
15-
//~| NOTE unrecognized intrinsic
1615
}
1716

1817
fn main() {

src/test/compile-fail/E0094.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#![feature(intrinsics)]
1212
extern "rust-intrinsic" {
1313
fn size_of<T, U>() -> usize; //~ ERROR E0094
14-
//~| NOTE expected 1 type parameter
1514
}
1615

1716
fn main() {

0 commit comments

Comments
 (0)