-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #109238 - spastorino:new-rpitit-12, r=compiler-errors
Fix generics mismatch errors for RPITITs on -Zlower-impl-trait-in-trait-to-assoc-ty This PR stops reporting errors due to different count of generics on the new synthesized associated types for RPITITs. Those were already reported when we compare the function on the triat with the function on the impl. r? `@compiler-errors`
- Loading branch information
Showing
7 changed files
with
76 additions
and
1 deletion.
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
16 changes: 16 additions & 0 deletions
16
tests/ui/async-await/in-trait/generics-mismatch.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,16 @@ | ||
error[E0053]: method `foo` has an incompatible generic parameter for trait `Foo` | ||
--> $DIR/generics-mismatch.rs:13:18 | ||
| | ||
LL | trait Foo { | ||
| --- | ||
LL | async fn foo<T>(); | ||
| - expected type parameter | ||
... | ||
LL | impl Foo for () { | ||
| --------------- | ||
LL | async fn foo<const N: usize>() {} | ||
| ^^^^^^^^^^^^^^ found const parameter of type `usize` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0053`. |
16 changes: 16 additions & 0 deletions
16
tests/ui/async-await/in-trait/generics-mismatch.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,16 @@ | ||
error[E0053]: method `foo` has an incompatible generic parameter for trait `Foo` | ||
--> $DIR/generics-mismatch.rs:13:18 | ||
| | ||
LL | trait Foo { | ||
| --- | ||
LL | async fn foo<T>(); | ||
| - expected type parameter | ||
... | ||
LL | impl Foo for () { | ||
| --------------- | ||
LL | async fn foo<const N: usize>() {} | ||
| ^^^^^^^^^^^^^^ found const parameter of type `usize` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0053`. |
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,17 @@ | ||
// edition: 2021 | ||
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty | ||
// revisions: current next | ||
|
||
#![feature(async_fn_in_trait)] | ||
#![allow(incomplete_features)] | ||
|
||
trait Foo { | ||
async fn foo<T>(); | ||
} | ||
|
||
impl Foo for () { | ||
async fn foo<const N: usize>() {} | ||
//~^ ERROR: method `foo` has an incompatible generic parameter for trait `Foo` [E0053] | ||
} | ||
|
||
fn main() {} |
2 changes: 1 addition & 1 deletion
2
...l-trait/in-trait/generics-mismatch.stderr → ...in-trait/generics-mismatch.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
12 changes: 12 additions & 0 deletions
12
tests/ui/impl-trait/in-trait/generics-mismatch.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,12 @@ | ||
error[E0049]: method `bar` has 1 type parameter but its trait declaration has 0 type parameters | ||
--> $DIR/generics-mismatch.rs:14:12 | ||
| | ||
LL | fn bar(&self) -> impl Sized; | ||
| - expected 0 type parameters | ||
... | ||
LL | fn bar<T>(&self) {} | ||
| ^ found 1 type parameter | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0049`. |
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