Skip to content

Commit eb7f645

Browse files
committed
Specialization involving RPITITs is broken so ignore the diagnostic differences for them
1 parent 478cbb4 commit eb7f645

3 files changed

+38
-2
lines changed

Diff for: tests/ui/async-await/in-trait/dont-project-to-specializable-projection.stderr renamed to tests/ui/async-await/in-trait/dont-project-to-specializable-projection.current.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
2-
--> $DIR/dont-project-to-specializable-projection.rs:4:12
2+
--> $DIR/dont-project-to-specializable-projection.rs:6:12
33
|
44
LL | #![feature(async_fn_in_trait)]
55
| ^^^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | #![feature(async_fn_in_trait)]
88
= note: `#[warn(incomplete_features)]` on by default
99

1010
error: async associated function in trait cannot be specialized
11-
--> $DIR/dont-project-to-specializable-projection.rs:14:5
11+
--> $DIR/dont-project-to-specializable-projection.rs:16:5
1212
|
1313
LL | default async fn foo(_: T) -> &'static str {
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/dont-project-to-specializable-projection.rs:6:12
3+
|
4+
LL | #![feature(async_fn_in_trait)]
5+
| ^^^^^^^^^^^^^^^^^
6+
|
7+
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
8+
= note: `#[warn(incomplete_features)]` on by default
9+
10+
error[E0053]: method `foo` has an incompatible type for trait
11+
--> $DIR/dont-project-to-specializable-projection.rs:16:35
12+
|
13+
LL | default async fn foo(_: T) -> &'static str {
14+
| ^^^^^^^^^^^^ expected associated type, found future
15+
|
16+
note: type in trait
17+
--> $DIR/dont-project-to-specializable-projection.rs:12:27
18+
|
19+
LL | async fn foo(_: T) -> &'static str;
20+
| ^^^^^^^^^^^^
21+
= note: expected signature `fn(_) -> impl Future<Output = &'static str>`
22+
found signature `fn(_) -> impl Future<Output = &'static str>`
23+
24+
error: async associated function in trait cannot be specialized
25+
--> $DIR/dont-project-to-specializable-projection.rs:16:5
26+
|
27+
LL | default async fn foo(_: T) -> &'static str {
28+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29+
|
30+
= note: specialization behaves in inconsistent and surprising ways with `#![feature(async_fn_in_trait)]`, and for now is disallowed
31+
32+
error: aborting due to 2 previous errors; 1 warning emitted
33+
34+
For more information about this error, try `rustc --explain E0053`.

Diff for: tests/ui/async-await/in-trait/dont-project-to-specializable-projection.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// edition: 2021
22
// known-bug: #108309
3+
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
4+
// revisions: current next
35

46
#![feature(async_fn_in_trait)]
57
#![feature(min_specialization)]

0 commit comments

Comments
 (0)