Skip to content

Commit aa1e136

Browse files
committed
Merged migrated compile-fail tests and ui tests. Fixes rust-lang#46841.
1 parent ba8be83 commit aa1e136

File tree

6,580 files changed

+733
-511
lines changed

Some content is hidden

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

6,580 files changed

+733
-511
lines changed
File renamed without changes.
File renamed without changes.

src/test/ui/E0508-fail.ast.stderr

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
2+
--> $DIR/E0508-fail.rs:18:18
3+
|
4+
LL | let _value = array[0]; //[ast]~ ERROR [E0508]
5+
| ^^^^^^^^
6+
| |
7+
| cannot move out of here
8+
| help: consider using a reference instead: `&array[0]`
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0508`.

src/test/ui/E0508-fail.mir.stderr

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array
2+
--> $DIR/E0508-fail.rs:18:18
3+
|
4+
LL | let _value = array[0]; //[ast]~ ERROR [E0508]
5+
| ^^^^^^^^
6+
| |
7+
| cannot move out of here
8+
| help: consider using a reference instead: `&array[0]`
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0508`.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/test/ui/compile-fail-migration/associated-types-subtyping-1.rs renamed to src/test/ui/associated-types/associated-types-subtyping-1.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fn method1<'a,'b,T>(x: &'a T, y: &'b T)
2424
// Note that &'static T <: &'a T.
2525
let a: <T as Trait<'a>>::Type = loop { };
2626
let b: <T as Trait<'b>>::Type = loop { };
27-
let _: <T as Trait<'a>>::Type = a;
27+
let _c: <T as Trait<'a>>::Type = a;
2828
}
2929

3030
fn method2<'a,'b,T>(x: &'a T, y: &'b T)
@@ -33,7 +33,7 @@ fn method2<'a,'b,T>(x: &'a T, y: &'b T)
3333
// Note that &'static T <: &'a T.
3434
let a: <T as Trait<'a>>::Type = loop { };
3535
let b: <T as Trait<'b>>::Type = loop { };
36-
let _: <T as Trait<'b>>::Type = a; //~ ERROR E0623
36+
let _c: <T as Trait<'b>>::Type = a; //~ ERROR E0623
3737
}
3838

3939
fn method3<'a,'b,T>(x: &'a T, y: &'b T)
@@ -42,7 +42,7 @@ fn method3<'a,'b,T>(x: &'a T, y: &'b T)
4242
// Note that &'static T <: &'a T.
4343
let a: <T as Trait<'a>>::Type = loop { };
4444
let b: <T as Trait<'b>>::Type = loop { };
45-
let _: <T as Trait<'a>>::Type = b; //~ ERROR E0623
45+
let _c: <T as Trait<'a>>::Type = b; //~ ERROR E0623
4646
}
4747

4848
fn method4<'a,'b,T>(x: &'a T, y: &'b T)
@@ -51,7 +51,7 @@ fn method4<'a,'b,T>(x: &'a T, y: &'b T)
5151
// Note that &'static T <: &'a T.
5252
let a: <T as Trait<'a>>::Type = loop { };
5353
let b: <T as Trait<'b>>::Type = loop { };
54-
let _: <T as Trait<'b>>::Type = b;
54+
let _c: <T as Trait<'b>>::Type = b;
5555
}
5656

5757
fn main() { }

src/test/ui/compile-fail-migration/associated-types-subtyping-1.stderr renamed to src/test/ui/associated-types/associated-types-subtyping-1.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
error[E0623]: lifetime mismatch
2-
--> $DIR/associated-types-subtyping-1.rs:36:37
2+
--> $DIR/associated-types-subtyping-1.rs:36:38
33
|
44
LL | fn method2<'a,'b,T>(x: &'a T, y: &'b T)
55
| ----- ----- these two types are declared with different lifetimes...
66
...
7-
LL | let _: <T as Trait<'b>>::Type = a; //~ ERROR E0623
8-
| ^ ...but data from `y` flows into `x` here
7+
LL | let _c: <T as Trait<'b>>::Type = a; //~ ERROR E0623
8+
| ^ ...but data from `y` flows into `x` here
99

1010
error[E0623]: lifetime mismatch
11-
--> $DIR/associated-types-subtyping-1.rs:45:37
11+
--> $DIR/associated-types-subtyping-1.rs:45:38
1212
|
1313
LL | fn method3<'a,'b,T>(x: &'a T, y: &'b T)
1414
| ----- ----- these two types are declared with different lifetimes...
1515
...
16-
LL | let _: <T as Trait<'a>>::Type = b; //~ ERROR E0623
17-
| ^ ...but data from `y` flows into `x` here
16+
LL | let _c: <T as Trait<'a>>::Type = b; //~ ERROR E0623
17+
| ^ ...but data from `y` flows into `x` here
1818

1919
error: aborting due to 2 previous errors
2020

src/test/ui/compile-fail-migration/associated-types-unsized.stderr renamed to src/test/ui/associated-types/associated-types-unsized.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let x = t.get(); //~ ERROR the size for values of type
55
| ^ doesn't have a size known at compile-time
66
|
77
= help: the trait `std::marker::Sized` is not implemented for `<T as Get>::Value`
8-
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized>
8+
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
99
= help: consider adding a `where <T as Get>::Value: std::marker::Sized` bound
1010
= note: all local variables must have a statically known size
1111

File renamed without changes.

src/test/ui/compile-fail-migration/bad-sized.stderr renamed to src/test/ui/bad/bad-sized.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LL | let x: Vec<Trait + Sized> = Vec::new();
1111
| ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
1212
|
1313
= help: the trait `std::marker::Sized` is not implemented for `dyn Trait`
14-
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized>
14+
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
1515
= note: required by `std::vec::Vec`
1616

1717
error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time
@@ -21,7 +21,7 @@ LL | let x: Vec<Trait + Sized> = Vec::new();
2121
| ^^^^^^^^ doesn't have a size known at compile-time
2222
|
2323
= help: the trait `std::marker::Sized` is not implemented for `dyn Trait`
24-
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized>
24+
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
2525
= note: required by `<std::vec::Vec<T>>::new`
2626

2727
error: aborting due to 3 previous errors

0 commit comments

Comments
 (0)