-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle inherent associated types fallout
- Loading branch information
Showing
15 changed files
with
117 additions
and
72 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
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
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
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
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
error: overflow evaluating associated type `Carrier<'b>::Focus<i32>` | ||
--> $DIR/issue-111879-0.rs:11:25 | ||
--> $DIR/issue-111879-0.rs:9:25 | ||
| | ||
LL | pub type Focus<T> = &'a mut User; | ||
| ^^^^^^^^^^^^ | ||
LL | pub type Focus<T> = &'a mut for<'b> fn(Carrier<'b>::Focus<i32>); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
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
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: 0 additions & 16 deletions
16
tests/ui/associated-inherent-types/not-found-self-type-differs.alias.stderr
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
tests/ui/associated-inherent-types/not-found-self-type-differs.local.stderr
This file was deleted.
Oops, something went wrong.
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
29 changes: 29 additions & 0 deletions
29
tests/ui/associated-inherent-types/not-found-self-type-differs.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,29 @@ | ||
error[E0220]: associated type `Proj` not found for `Family<Option<()>>` in the current scope | ||
--> $DIR/not-found-self-type-differs.rs:15:32 | ||
| | ||
LL | struct Family<T>(T); | ||
| ---------------- associated item `Proj` not found for this struct | ||
... | ||
LL | let _: Family<Option<()>>::Proj; | ||
| ^^^^ associated item not found in `Family<Option<()>>` | ||
| | ||
= note: the associated type was found for | ||
- `Family<()>` | ||
- `Family<Result<T, ()>>` | ||
|
||
error[E0220]: associated type `Proj` not found for `Family<PathBuf>` in the current scope | ||
--> $DIR/not-found-self-type-differs.rs:16:40 | ||
| | ||
LL | struct Family<T>(T); | ||
| ---------------- associated item `Proj` not found for this struct | ||
... | ||
LL | let _: Family<std::path::PathBuf>::Proj = (); | ||
| ^^^^ associated item not found in `Family<PathBuf>` | ||
| | ||
= note: the associated type was found for | ||
- `Family<()>` | ||
- `Family<Result<T, ()>>` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0220`. |
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
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
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
55 changes: 55 additions & 0 deletions
55
tests/ui/associated-inherent-types/type-alias-bounds-are-enforced.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,55 @@ | ||
error[E0391]: cycle detected when expanding type alias `Alias` | ||
--> $DIR/type-alias-bounds-are-enforced.rs:19:1 | ||
| | ||
LL | pub type Alias<T: Bound> = (Source<T>::Assoc,); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: ...which requires computing the variances of `Source`... | ||
--> $DIR/type-alias-bounds-are-enforced.rs:21:1 | ||
| | ||
LL | pub struct Source<T>(T); | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
= note: ...which requires computing the variances for items in this crate... | ||
= note: ...which again requires expanding type alias `Alias`, completing the cycle | ||
note: cycle used when collecting item types in top-level module | ||
--> $DIR/type-alias-bounds-are-enforced.rs:5:1 | ||
| | ||
LL | / #![feature(inherent_associated_types)] | ||
LL | | #![allow(incomplete_features)] | ||
LL | | | ||
LL | | // Bounds on the self type play a major role in the resolution of inherent associated types (*). | ||
... | | ||
LL | | pub type Assoc = (); | ||
LL | | } | ||
| |_^ | ||
= 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 | ||
|
||
error[E0391]: cycle detected when expanding type alias `Alias` | ||
--> $DIR/type-alias-bounds-are-enforced.rs:19:1 | ||
| | ||
LL | pub type Alias<T: Bound> = (Source<T>::Assoc,); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: ...which requires computing the variances of `Source`... | ||
--> $DIR/type-alias-bounds-are-enforced.rs:21:1 | ||
| | ||
LL | pub struct Source<T>(T); | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
= note: ...which requires computing the variances for items in this crate... | ||
= note: ...which again requires expanding type alias `Alias`, completing the cycle | ||
note: cycle used when collecting item types in top-level module | ||
--> $DIR/type-alias-bounds-are-enforced.rs:5:1 | ||
| | ||
LL | / #![feature(inherent_associated_types)] | ||
LL | | #![allow(incomplete_features)] | ||
LL | | | ||
LL | | // Bounds on the self type play a major role in the resolution of inherent associated types (*). | ||
... | | ||
LL | | pub type Assoc = (); | ||
LL | | } | ||
| |_^ | ||
= 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 | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0391`. |