Skip to content

Commit c5c4340

Browse files
committed
Add revisions to fixed tests in -Zlower-impl-trait-in-trait-to-assoc-ty
1 parent 11f1810 commit c5c4340

15 files changed

+180
-19
lines changed

Diff for: tests/ui/async-await/in-trait/async-generics-and-bounds.stderr renamed to tests/ui/async-await/in-trait/async-generics-and-bounds.current.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
error[E0311]: the parameter type `U` may not live long enough
2-
--> $DIR/async-generics-and-bounds.rs:12:28
2+
--> $DIR/async-generics-and-bounds.rs:14:28
33
|
44
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
55
| ^^^^^^^
66
|
77
note: the parameter type `U` must be valid for the anonymous lifetime defined here...
8-
--> $DIR/async-generics-and-bounds.rs:12:18
8+
--> $DIR/async-generics-and-bounds.rs:14:18
99
|
1010
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
1111
| ^^^^^
1212
note: ...so that the reference type `&(T, U)` does not outlive the data it points at
13-
--> $DIR/async-generics-and-bounds.rs:12:28
13+
--> $DIR/async-generics-and-bounds.rs:14:28
1414
|
1515
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
1616
| ^^^^^^^
1717

1818
error[E0311]: the parameter type `T` may not live long enough
19-
--> $DIR/async-generics-and-bounds.rs:12:28
19+
--> $DIR/async-generics-and-bounds.rs:14:28
2020
|
2121
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
2222
| ^^^^^^^
2323
|
2424
note: the parameter type `T` must be valid for the anonymous lifetime defined here...
25-
--> $DIR/async-generics-and-bounds.rs:12:18
25+
--> $DIR/async-generics-and-bounds.rs:14:18
2626
|
2727
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
2828
| ^^^^^
2929
note: ...so that the reference type `&(T, U)` does not outlive the data it points at
30-
--> $DIR/async-generics-and-bounds.rs:12:28
30+
--> $DIR/async-generics-and-bounds.rs:14:28
3131
|
3232
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
3333
| ^^^^^^^
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
error[E0311]: the parameter type `U` may not live long enough
2+
--> $DIR/async-generics-and-bounds.rs:14:28
3+
|
4+
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
5+
| ^^^^^^^
6+
|
7+
note: the parameter type `U` must be valid for the anonymous lifetime defined here...
8+
--> $DIR/async-generics-and-bounds.rs:14:18
9+
|
10+
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
11+
| ^^^^^
12+
note: ...so that the reference type `&(T, U)` does not outlive the data it points at
13+
--> $DIR/async-generics-and-bounds.rs:14:28
14+
|
15+
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
16+
| ^^^^^^^
17+
18+
error[E0311]: the parameter type `T` may not live long enough
19+
--> $DIR/async-generics-and-bounds.rs:14:28
20+
|
21+
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
22+
| ^^^^^^^
23+
|
24+
note: the parameter type `T` must be valid for the anonymous lifetime defined here...
25+
--> $DIR/async-generics-and-bounds.rs:14:18
26+
|
27+
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
28+
| ^^^^^
29+
note: ...so that the reference type `&(T, U)` does not outlive the data it points at
30+
--> $DIR/async-generics-and-bounds.rs:14:28
31+
|
32+
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
33+
| ^^^^^^^
34+
35+
error: aborting due to 2 previous errors
36+
37+
For more information about this error, try `rustc --explain E0311`.

Diff for: tests/ui/async-await/in-trait/async-generics-and-bounds.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// check-fail
22
// known-bug: #102682
33
// edition: 2021
4+
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
5+
// revisions: current next
46

57
#![feature(async_fn_in_trait)]
68
#![allow(incomplete_features)]

Diff for: tests/ui/async-await/in-trait/async-generics.stderr renamed to tests/ui/async-await/in-trait/async-generics.current.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
error[E0311]: the parameter type `U` may not live long enough
2-
--> $DIR/async-generics.rs:9:28
2+
--> $DIR/async-generics.rs:11:28
33
|
44
LL | async fn foo(&self) -> &(T, U);
55
| ^^^^^^^
66
|
77
note: the parameter type `U` must be valid for the anonymous lifetime defined here...
8-
--> $DIR/async-generics.rs:9:18
8+
--> $DIR/async-generics.rs:11:18
99
|
1010
LL | async fn foo(&self) -> &(T, U);
1111
| ^^^^^
1212
note: ...so that the reference type `&(T, U)` does not outlive the data it points at
13-
--> $DIR/async-generics.rs:9:28
13+
--> $DIR/async-generics.rs:11:28
1414
|
1515
LL | async fn foo(&self) -> &(T, U);
1616
| ^^^^^^^
1717

1818
error[E0311]: the parameter type `T` may not live long enough
19-
--> $DIR/async-generics.rs:9:28
19+
--> $DIR/async-generics.rs:11:28
2020
|
2121
LL | async fn foo(&self) -> &(T, U);
2222
| ^^^^^^^
2323
|
2424
note: the parameter type `T` must be valid for the anonymous lifetime defined here...
25-
--> $DIR/async-generics.rs:9:18
25+
--> $DIR/async-generics.rs:11:18
2626
|
2727
LL | async fn foo(&self) -> &(T, U);
2828
| ^^^^^
2929
note: ...so that the reference type `&(T, U)` does not outlive the data it points at
30-
--> $DIR/async-generics.rs:9:28
30+
--> $DIR/async-generics.rs:11:28
3131
|
3232
LL | async fn foo(&self) -> &(T, U);
3333
| ^^^^^^^
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
error[E0311]: the parameter type `U` may not live long enough
2+
--> $DIR/async-generics.rs:11:28
3+
|
4+
LL | async fn foo(&self) -> &(T, U);
5+
| ^^^^^^^
6+
|
7+
note: the parameter type `U` must be valid for the anonymous lifetime defined here...
8+
--> $DIR/async-generics.rs:11:18
9+
|
10+
LL | async fn foo(&self) -> &(T, U);
11+
| ^^^^^
12+
note: ...so that the reference type `&(T, U)` does not outlive the data it points at
13+
--> $DIR/async-generics.rs:11:28
14+
|
15+
LL | async fn foo(&self) -> &(T, U);
16+
| ^^^^^^^
17+
18+
error[E0311]: the parameter type `T` may not live long enough
19+
--> $DIR/async-generics.rs:11:28
20+
|
21+
LL | async fn foo(&self) -> &(T, U);
22+
| ^^^^^^^
23+
|
24+
note: the parameter type `T` must be valid for the anonymous lifetime defined here...
25+
--> $DIR/async-generics.rs:11:18
26+
|
27+
LL | async fn foo(&self) -> &(T, U);
28+
| ^^^^^
29+
note: ...so that the reference type `&(T, U)` does not outlive the data it points at
30+
--> $DIR/async-generics.rs:11:28
31+
|
32+
LL | async fn foo(&self) -> &(T, U);
33+
| ^^^^^^^
34+
35+
error: aborting due to 2 previous errors
36+
37+
For more information about this error, try `rustc --explain E0311`.

Diff for: tests/ui/async-await/in-trait/async-generics.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// check-fail
22
// known-bug: #102682
33
// edition: 2021
4+
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
5+
// revisions: current next
46

57
#![feature(async_fn_in_trait)]
68
#![allow(incomplete_features)]

Diff for: tests/ui/impl-trait/in-trait/issue-102571.stderr renamed to tests/ui/impl-trait/in-trait/issue-102571.current.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/issue-102571.rs:20:9
2+
--> $DIR/issue-102571.rs:23:9
33
|
44
LL | let () = t.bar();
55
| ^^ ------- this expression has type `impl Deref<Target = impl std::fmt::Display + ?Sized>`
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/issue-102571.rs:23:9
3+
|
4+
LL | let () = t.bar();
5+
| ^^ ------- this expression has type `impl Deref<Target = impl std::fmt::Display + ?Sized>`
6+
| |
7+
| expected associated type, found `()`
8+
|
9+
= note: expected associated type `impl Deref<Target = impl std::fmt::Display + ?Sized>`
10+
found unit type `()`
11+
12+
error: aborting due to previous error
13+
14+
For more information about this error, try `rustc --explain E0308`.

Diff for: tests/ui/impl-trait/in-trait/issue-102571.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
2+
// revisions: current next
3+
14
#![feature(return_position_impl_trait_in_trait)]
25
#![allow(incomplete_features)]
36

Diff for: tests/ui/impl-trait/in-trait/specialization-broken.stderr renamed to tests/ui/impl-trait/in-trait/specialization-broken.current.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0053]: method `bar` has an incompatible type for trait
2-
--> $DIR/specialization-broken.rs:16:22
2+
--> $DIR/specialization-broken.rs:19:22
33
|
44
LL | default impl<U> Foo for U
55
| - this type parameter
@@ -11,15 +11,15 @@ LL | fn bar(&self) -> U {
1111
| help: change the output type to match the trait: `impl Sized`
1212
|
1313
note: type in trait
14-
--> $DIR/specialization-broken.rs:9:22
14+
--> $DIR/specialization-broken.rs:12:22
1515
|
1616
LL | fn bar(&self) -> impl Sized;
1717
| ^^^^^^^^^^
1818
= note: expected signature `fn(&U) -> impl Sized`
1919
found signature `fn(&U) -> U`
2020

2121
error: method with return-position `impl Trait` in trait cannot be specialized
22-
--> $DIR/specialization-broken.rs:16:5
22+
--> $DIR/specialization-broken.rs:19:5
2323
|
2424
LL | fn bar(&self) -> U {
2525
| ^^^^^^^^^^^^^^^^^^
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
error[E0053]: method `bar` has an incompatible type for trait
2+
--> $DIR/specialization-broken.rs:19:22
3+
|
4+
LL | default impl<U> Foo for U
5+
| - this type parameter
6+
...
7+
LL | fn bar(&self) -> U {
8+
| ^
9+
| |
10+
| expected associated type, found type parameter `U`
11+
| help: change the output type to match the trait: `impl Sized`
12+
|
13+
note: type in trait
14+
--> $DIR/specialization-broken.rs:12:22
15+
|
16+
LL | fn bar(&self) -> impl Sized;
17+
| ^^^^^^^^^^
18+
= note: expected signature `fn(&U) -> impl Sized`
19+
found signature `fn(&U) -> U`
20+
21+
error: method with return-position `impl Trait` in trait cannot be specialized
22+
--> $DIR/specialization-broken.rs:19:5
23+
|
24+
LL | fn bar(&self) -> U {
25+
| ^^^^^^^^^^^^^^^^^^
26+
|
27+
= note: specialization behaves in inconsistent and surprising ways with `#![feature(return_position_impl_trait_in_trait)]`, and for now is disallowed
28+
29+
error: aborting due to 2 previous errors
30+
31+
For more information about this error, try `rustc --explain E0053`.

Diff for: tests/ui/impl-trait/in-trait/specialization-broken.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
2+
// revisions: current next
3+
14
// FIXME(compiler-errors): I'm not exactly sure if this is expected to pass or not.
25
// But we fixed an ICE anyways.
36

Diff for: tests/ui/impl-trait/in-trait/wf-bounds.stderr renamed to tests/ui/impl-trait/in-trait/wf-bounds.current.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
2-
--> $DIR/wf-bounds.rs:9:22
2+
--> $DIR/wf-bounds.rs:11:22
33
|
44
LL | fn nya() -> impl Wf<Vec<[u8]>>;
55
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -9,14 +9,14 @@ note: required by a bound in `Vec`
99
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
1010

1111
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
12-
--> $DIR/wf-bounds.rs:12:23
12+
--> $DIR/wf-bounds.rs:14:23
1313
|
1414
LL | fn nya2() -> impl Wf<[u8]>;
1515
| ^^^^^^^^ doesn't have a size known at compile-time
1616
|
1717
= help: the trait `Sized` is not implemented for `[u8]`
1818
note: required by a bound in `Wf`
19-
--> $DIR/wf-bounds.rs:6:10
19+
--> $DIR/wf-bounds.rs:8:10
2020
|
2121
LL | trait Wf<T> {}
2222
| ^ required by this bound in `Wf`

Diff for: tests/ui/impl-trait/in-trait/wf-bounds.next.stderr

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
2+
--> $DIR/wf-bounds.rs:11:22
3+
|
4+
LL | fn nya() -> impl Wf<Vec<[u8]>>;
5+
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
6+
|
7+
= help: the trait `Sized` is not implemented for `[u8]`
8+
note: required by a bound in `Vec`
9+
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
10+
11+
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
12+
--> $DIR/wf-bounds.rs:14:23
13+
|
14+
LL | fn nya2() -> impl Wf<[u8]>;
15+
| ^^^^^^^^ doesn't have a size known at compile-time
16+
|
17+
= help: the trait `Sized` is not implemented for `[u8]`
18+
note: required by a bound in `Wf`
19+
--> $DIR/wf-bounds.rs:8:10
20+
|
21+
LL | trait Wf<T> {}
22+
| ^ required by this bound in `Wf`
23+
help: consider relaxing the implicit `Sized` restriction
24+
|
25+
LL | trait Wf<T: ?Sized> {}
26+
| ++++++++
27+
28+
error: aborting due to 2 previous errors
29+
30+
For more information about this error, try `rustc --explain E0277`.

Diff for: tests/ui/impl-trait/in-trait/wf-bounds.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// issue #101663
2+
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
3+
// revisions: current next
24

35
#![feature(return_position_impl_trait_in_trait)]
46
#![allow(incomplete_features)]

0 commit comments

Comments
 (0)