Skip to content

Commit f116d4d

Browse files
committed
Move tests that no longer ICE
1 parent 8140dcd commit f116d4d

8 files changed

+163
-0
lines changed
File renamed without changes.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
error[E0782]: trait objects must include the `dyn` keyword
2+
--> $DIR/missing-dyn-trait-2.rs:8:20
3+
|
4+
LL | fn concrete(b: B) -> B;
5+
| ^
6+
|
7+
= note: `B` it is not object safe, so it can't be `dyn`
8+
help: use a new generic type parameter, constrained by `B`
9+
|
10+
LL | fn concrete<T: B>(b: T) -> B;
11+
| ++++++ ~
12+
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
13+
|
14+
LL | fn concrete(b: impl B) -> B;
15+
| ++++
16+
17+
error[E0782]: trait objects must include the `dyn` keyword
18+
--> $DIR/missing-dyn-trait-2.rs:8:26
19+
|
20+
LL | fn concrete(b: B) -> B;
21+
| ^
22+
|
23+
help: `B` is not object safe, use `impl B` to return an opaque type, as long as you return a single underlying type
24+
|
25+
LL | fn concrete(b: B) -> impl B;
26+
| ++++
27+
28+
error[E0782]: trait objects must include the `dyn` keyword
29+
--> $DIR/missing-dyn-trait-2.rs:5:13
30+
|
31+
LL | fn f(a: A) -> A;
32+
| ^
33+
|
34+
= note: `A` it is not object safe, so it can't be `dyn`
35+
help: use a new generic type parameter, constrained by `A`
36+
|
37+
LL | fn f<T: A>(a: T) -> A;
38+
| ++++++ ~
39+
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
40+
|
41+
LL | fn f(a: impl A) -> A;
42+
| ++++
43+
44+
error[E0782]: trait objects must include the `dyn` keyword
45+
--> $DIR/missing-dyn-trait-2.rs:5:19
46+
|
47+
LL | fn f(a: A) -> A;
48+
| ^
49+
|
50+
help: `A` is not object safe, use `impl A` to return an opaque type, as long as you return a single underlying type
51+
|
52+
LL | fn f(a: A) -> impl A;
53+
| ++++
54+
55+
error: aborting due to 4 previous errors
56+
57+
For more information about this error, try `rustc --explain E0782`.
File renamed without changes.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
error[E0782]: trait objects must include the `dyn` keyword
2+
--> $DIR/missing-dyn-trait-3.rs:10:13
3+
|
4+
LL | fn g(b: B) -> B;
5+
| ^
6+
|
7+
= note: `B` it is not object safe, so it can't be `dyn`
8+
help: use a new generic type parameter, constrained by `B`
9+
|
10+
LL | fn g<T: B>(b: T) -> B;
11+
| ++++++ ~
12+
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
13+
|
14+
LL | fn g(b: impl B) -> B;
15+
| ++++
16+
17+
error[E0782]: trait objects must include the `dyn` keyword
18+
--> $DIR/missing-dyn-trait-3.rs:10:19
19+
|
20+
LL | fn g(b: B) -> B;
21+
| ^
22+
|
23+
help: `B` is not object safe, use `impl B` to return an opaque type, as long as you return a single underlying type
24+
|
25+
LL | fn g(b: B) -> impl B;
26+
| ++++
27+
28+
error[E0782]: trait objects must include the `dyn` keyword
29+
--> $DIR/missing-dyn-trait-3.rs:6:13
30+
|
31+
LL | fn f(a: A) -> A;
32+
| ^
33+
|
34+
= note: `A` it is not object safe, so it can't be `dyn`
35+
help: use a new generic type parameter, constrained by `A`
36+
|
37+
LL | fn f<T: A>(a: T) -> A;
38+
| ++++++ ~
39+
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
40+
|
41+
LL | fn f(a: impl A) -> A;
42+
| ++++
43+
44+
error[E0782]: trait objects must include the `dyn` keyword
45+
--> $DIR/missing-dyn-trait-3.rs:6:19
46+
|
47+
LL | fn f(a: A) -> A;
48+
| ^
49+
|
50+
help: `A` is not object safe, use `impl A` to return an opaque type, as long as you return a single underlying type
51+
|
52+
LL | fn f(a: A) -> impl A;
53+
| ++++
54+
55+
error: aborting due to 4 previous errors
56+
57+
For more information about this error, try `rustc --explain E0782`.
File renamed without changes.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0782]: trait objects must include the `dyn` keyword
2+
--> $DIR/missing-dyn-trait-4.rs:6:14
3+
|
4+
LL | fn guard(_s: Copy) -> bool {
5+
| ^^^^
6+
|
7+
= note: `Copy` it is not object safe, so it can't be `dyn`
8+
help: use a new generic type parameter, constrained by `Copy`
9+
|
10+
LL | fn guard<T: Copy>(_s: T) -> bool {
11+
| +++++++++ ~
12+
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
13+
|
14+
LL | fn guard(_s: impl Copy) -> bool {
15+
| ++++
16+
17+
error: aborting due to 1 previous error
18+
19+
For more information about this error, try `rustc --explain E0782`.
File renamed without changes.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
error[E0782]: trait objects must include the `dyn` keyword
2+
--> $DIR/missing-dyn-trait.rs:10:15
3+
|
4+
LL | fn g(new: B) -> B;
5+
| ^
6+
|
7+
= note: `B` it is not object safe, so it can't be `dyn`
8+
help: use a new generic type parameter, constrained by `B`
9+
|
10+
LL | fn g<T: B>(new: T) -> B;
11+
| ++++++ ~
12+
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
13+
|
14+
LL | fn g(new: impl B) -> B;
15+
| ++++
16+
17+
error[E0782]: trait objects must include the `dyn` keyword
18+
--> $DIR/missing-dyn-trait.rs:10:21
19+
|
20+
LL | fn g(new: B) -> B;
21+
| ^
22+
|
23+
help: `B` is not object safe, use `impl B` to return an opaque type, as long as you return a single underlying type
24+
|
25+
LL | fn g(new: B) -> impl B;
26+
| ++++
27+
28+
error: aborting due to 2 previous errors
29+
30+
For more information about this error, try `rustc --explain E0782`.

0 commit comments

Comments
 (0)