-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #113456 - spastorino:new-rpitit-31, r=compiler-errors
Avoid calling report_forbidden_specialization for RPITITs Fixes #113438 r? ``@compiler-errors``
- Loading branch information
Showing
4 changed files
with
94 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
tests/ui/async-await/in-trait/missing-feature-flag.current.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
error[E0046]: not all trait items implemented, missing: `foo` | ||
--> $DIR/missing-feature-flag.rs:14:1 | ||
| | ||
LL | async fn foo(_: T) -> &'static str; | ||
| ----------------------------------- `foo` from trait | ||
... | ||
LL | impl<T> MyTrait<T> for MyStruct {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation | ||
|
||
error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default` | ||
--> $DIR/missing-feature-flag.rs:18:5 | ||
| | ||
LL | impl<T> MyTrait<T> for MyStruct {} | ||
| ------------------------------- parent `impl` is here | ||
... | ||
LL | async fn foo(_: i32) -> &'static str {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo` | ||
| | ||
= note: to specialize, `foo` in the parent `impl` must be marked `default` | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/missing-feature-flag.rs:18:42 | ||
| | ||
LL | async fn foo(_: i32) -> &'static str {} | ||
| ^^ expected `&str`, found `()` | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
Some errors have detailed explanations: E0046, E0308, E0520. | ||
For more information about an error, try `rustc --explain E0046`. |
30 changes: 30 additions & 0 deletions
30
tests/ui/async-await/in-trait/missing-feature-flag.next.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
error[E0046]: not all trait items implemented, missing: `foo` | ||
--> $DIR/missing-feature-flag.rs:14:1 | ||
| | ||
LL | async fn foo(_: T) -> &'static str; | ||
| ----------------------------------- `foo` from trait | ||
... | ||
LL | impl<T> MyTrait<T> for MyStruct {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation | ||
|
||
error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default` | ||
--> $DIR/missing-feature-flag.rs:18:5 | ||
| | ||
LL | impl<T> MyTrait<T> for MyStruct {} | ||
| ------------------------------- parent `impl` is here | ||
... | ||
LL | async fn foo(_: i32) -> &'static str {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo` | ||
| | ||
= note: to specialize, `foo` in the parent `impl` must be marked `default` | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/missing-feature-flag.rs:18:42 | ||
| | ||
LL | async fn foo(_: i32) -> &'static str {} | ||
| ^^ expected `&str`, found `()` | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
Some errors have detailed explanations: E0046, E0308, E0520. | ||
For more information about an error, try `rustc --explain E0046`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// edition:2018 | ||
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty | ||
// revisions: current next | ||
|
||
#![feature(async_fn_in_trait)] | ||
#![feature(min_specialization)] | ||
|
||
struct MyStruct; | ||
|
||
trait MyTrait<T> { | ||
async fn foo(_: T) -> &'static str; | ||
} | ||
|
||
impl<T> MyTrait<T> for MyStruct {} | ||
//~^ ERROR: not all trait items implemented, missing: `foo` [E0046] | ||
|
||
impl MyTrait<i32> for MyStruct { | ||
async fn foo(_: i32) -> &'static str {} | ||
//~^ ERROR: `foo` specializes an item from a parent `impl`, but that item is not marked `default` [E0520] | ||
//~| ERROR: mismatched types [E0308] | ||
} | ||
|
||
fn main() {} |