Skip to content

Commit d4e51a8

Browse files
committed
Move compile-fail tests with NOTE/HELP annotations to UI
1 parent 3a2ad57 commit d4e51a8

File tree

451 files changed

+5821
-7
lines changed

Some content is hidden

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

451 files changed

+5821
-7
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0038]: the trait `Foo` cannot be made into an object
2+
--> $DIR/arbitrary-self-types-not-object-safe.rs:40:33
3+
|
4+
40 | let x = Box::new(5usize) as Box<Foo>;
5+
| ^^^^^^^^ the trait `Foo` cannot be made into an object
6+
|
7+
= note: method `foo` has a non-standard `self` type. Only `&self`, `&mut self`, and `Box<Self>` are currently supported for trait objects
8+
9+
error[E0038]: the trait `Foo` cannot be made into an object
10+
--> $DIR/arbitrary-self-types-not-object-safe.rs:40:13
11+
|
12+
40 | let x = Box::new(5usize) as Box<Foo>;
13+
| ^^^^^^^^^^^^^^^^ the trait `Foo` cannot be made into an object
14+
|
15+
= note: method `foo` has a non-standard `self` type. Only `&self`, `&mut self`, and `Box<Self>` are currently supported for trait objects
16+
= note: required because of the requirements on the impl of `std::ops::CoerceUnsized<std::boxed::Box<Foo>>` for `std::boxed::Box<usize>`
17+
18+
error: aborting due to 2 previous errors
19+

src/test/ui/asm-out-assign-imm.stderr

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0384]: cannot assign twice to immutable variable `x`
2+
--> $DIR/asm-out-assign-imm.rs:29:9
3+
|
4+
26 | x = 1; //~ NOTE first assignment
5+
| ----- first assignment to `x`
6+
...
7+
29 | asm!("mov $1, $0" : "=r"(x) : "r"(5));
8+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot assign twice to immutable variable
9+
10+
error: aborting due to previous error
11+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/associated-const-impl-wrong-lifetime.rs:19:5
3+
|
4+
19 | const NAME: &'a str = "unit";
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
6+
|
7+
= note: expected type `&'static str`
8+
found type `&'a str`
9+
note: the lifetime 'a as defined on the impl at 17:1...
10+
--> $DIR/associated-const-impl-wrong-lifetime.rs:17:1
11+
|
12+
17 | / impl<'a> Foo for &'a () {
13+
18 | | //~^ NOTE the lifetime 'a as defined
14+
19 | | const NAME: &'a str = "unit";
15+
20 | | //~^ ERROR mismatched types [E0308]
16+
... |
17+
23 | | //~| NOTE ...does not necessarily outlive the static lifetime
18+
24 | | }
19+
| |_^
20+
= note: ...does not necessarily outlive the static lifetime
21+
22+
error: aborting due to previous error
23+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0326]: implemented const `BAR` has an incompatible type for trait
2+
--> $DIR/associated-const-impl-wrong-type.rs:19:16
3+
|
4+
13 | const BAR: u32; //~ NOTE type in trait
5+
| --- type in trait
6+
...
7+
19 | const BAR: i32 = -1;
8+
| ^^^ expected u32, found i32
9+
10+
error: aborting due to previous error
11+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
error[E0221]: ambiguous associated type `Color` in bounds of `C`
2+
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:35:32
3+
|
4+
15 | type Color;
5+
| ----------- ambiguous `Color` from `Vehicle`
6+
...
7+
24 | type Color;
8+
| ----------- ambiguous `Color` from `Box`
9+
...
10+
35 | fn dent<C:BoxCar>(c: C, color: C::Color) {
11+
| ^^^^^^^^ ambiguous associated type `Color`
12+
13+
error[E0221]: ambiguous associated type `Color` in bounds of `BoxCar`
14+
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:40:33
15+
|
16+
15 | type Color;
17+
| ----------- ambiguous `Color` from `Vehicle`
18+
...
19+
24 | type Color;
20+
| ----------- ambiguous `Color` from `Box`
21+
...
22+
40 | fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
23+
| ^^^^^^^^^^^ ambiguous associated type `Color`
24+
25+
error[E0191]: the value of the associated type `Color` (from the trait `Vehicle`) must be specified
26+
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:40:26
27+
|
28+
40 | fn dent_object<COLOR>(c: BoxCar<Color=COLOR>) {
29+
| ^^^^^^^^^^^^^^^^^^^ missing associated type `Color` value
30+
31+
error[E0221]: ambiguous associated type `Color` in bounds of `C`
32+
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:47:29
33+
|
34+
15 | type Color;
35+
| ----------- ambiguous `Color` from `Vehicle`
36+
...
37+
24 | type Color;
38+
| ----------- ambiguous `Color` from `Box`
39+
...
40+
47 | fn paint<C:BoxCar>(c: C, d: C::Color) {
41+
| ^^^^^^^^ ambiguous associated type `Color`
42+
43+
error: aborting due to 4 previous errors
44+

0 commit comments

Comments
 (0)