-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Normalize when collecting TAITs in signature #116819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
compiler-errors
wants to merge
3
commits into
rust-lang:master
from
compiler-errors:normalize-collecting-opaques
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 |
---|---|---|
@@ -1,14 +1,16 @@ | ||
error: non-defining opaque type use in defining scope | ||
--> $DIR/issue-88595.rs:21:23 | ||
--> $DIR/issue-88595.rs:21:35 | ||
| | ||
LL | fn a(&'a self) -> Self::B<'a> {} | ||
| ^^^^^^^^^^^ generic argument `'a` used twice | ||
| ^^ | ||
| | ||
note: for this opaque type | ||
--> $DIR/issue-88595.rs:19:18 | ||
note: lifetime used multiple times | ||
--> $DIR/issue-88595.rs:18:6 | ||
| | ||
LL | impl<'a> A<'a> for C { | ||
| ^^ | ||
LL | type B<'b> = impl Clone; | ||
| ^^^^^^^^^^ | ||
| ^^ | ||
|
||
error: aborting due to previous error | ||
|
This file contains hidden or 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
46 changes: 31 additions & 15 deletions
46
tests/ui/generic-associated-types/issue-90014-tait.stderr
This file contains hidden or 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 |
---|---|---|
@@ -1,22 +1,38 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/issue-90014-tait.rs:18:9 | ||
error: internal compiler error: no errors encountered even though `delay_span_bug` issued | ||
|
||
error: internal compiler error[E0391]: cycle detected when computing function signature of `<impl at $DIR/issue-90014-tait.rs:20:1: 20:13>::make_fut` | ||
--> $DIR/issue-90014-tait.rs:23:5 | ||
| | ||
LL | type Fut<'a> = impl Future<Output = ()>; | ||
| ------------------------ the expected future | ||
LL | | ||
LL | fn make_fut<'a>(&'a self) -> Self::Fut<'a> { | ||
| ------------- expected `Foo<'_>::Fut<'a>` because of return type | ||
LL | async { () } | ||
| ^^^^^^^^^^^^ expected future, found `async` block | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: ...which requires computing the variances of `Foo`... | ||
--> $DIR/issue-90014-tait.rs:18:1 | ||
| | ||
LL | struct Foo<'a>(&'a mut ()); | ||
| ^^^^^^^^^^^^^^ | ||
= note: ...which requires computing the variances for items in this crate... | ||
= note: ...which again requires computing function signature of `<impl at $DIR/issue-90014-tait.rs:20:1: 20:13>::make_fut`, completing the cycle | ||
note: cycle used when collecting item types in top-level module | ||
--> $DIR/issue-90014-tait.rs:1:1 | ||
| | ||
= note: expected opaque type `Foo<'_>::Fut<'a>` | ||
found `async` block `{async block@$DIR/issue-90014-tait.rs:18:9: 18:21}` | ||
note: this item must have the opaque type in its signature in order to be able to register hidden types | ||
--> $DIR/issue-90014-tait.rs:17:8 | ||
LL | / //! This test is reporting the wrong error. We need | ||
LL | | //! more inherent associated type tests that use opaque types | ||
LL | | //! in general. Some variant of this test should compile successfully. | ||
LL | | | ||
... | | ||
LL | | | ||
LL | | fn main() {} | ||
| |____________^ | ||
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information | ||
note: delayed at compiler/rustc_query_system/src/query/job.rs:602:16 - disabled backtrace | ||
--> $DIR/issue-90014-tait.rs:23:5 | ||
| | ||
LL | fn make_fut<'a>(&'a self) -> Self::Fut<'a> { | ||
| ^^^^^^^^ | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
query stack during panic: | ||
end of query stack | ||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. | ||
For more information about this error, try `rustc --explain E0391`. |
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
@@ -1,24 +1,12 @@ | ||
error[E0792]: non-defining opaque type use in defining scope | ||
--> $DIR/bound_reduction2.rs:15:46 | ||
| | ||
LL | fn foo_desugared<T: TraitWithAssoc>(_: T) -> Foo<T::Assoc> { | ||
| ^^^^^^^^^^^^^ argument `<T as TraitWithAssoc>::Assoc` is not a generic parameter | ||
| | ||
note: for this opaque type | ||
--> $DIR/bound_reduction2.rs:9:15 | ||
| | ||
LL | type Foo<V> = impl Trait<V>; | ||
| ^^^^^^^^^^^^^ | ||
|
||
error[E0792]: expected generic type parameter, found `<T as TraitWithAssoc>::Assoc` | ||
--> $DIR/bound_reduction2.rs:17:5 | ||
--> $DIR/bound_reduction2.rs:16:5 | ||
| | ||
LL | type Foo<V> = impl Trait<V>; | ||
| - this generic parameter must be used with a generic type parameter | ||
... | ||
LL | () | ||
| ^^ | ||
|
||
error: aborting due to 2 previous errors | ||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0792`. |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the comments to explain what the test is testing now (same for all the other tests)