-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Actually capture all in-scope lifetimes.
- Loading branch information
Showing
7 changed files
with
75 additions
and
93 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
27 changes: 27 additions & 0 deletions
27
tests/ui/associated-type-bounds/return-type-notation/impl-trait-in-trait.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,27 @@ | ||
error[E0391]: cycle detected when resolving lifetimes for `IntFactory::stream` | ||
--> $DIR/impl-trait-in-trait.rs:4:5 | ||
| | ||
LL | fn stream(self) -> impl IntFactory<stream(..): Send>; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: ...which requires computing function signature of `IntFactory::stream`... | ||
--> $DIR/impl-trait-in-trait.rs:4:5 | ||
| | ||
LL | fn stream(self) -> impl IntFactory<stream(..): Send>; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
note: ...which requires looking up late bound vars inside `IntFactory::stream`... | ||
--> $DIR/impl-trait-in-trait.rs:4:5 | ||
| | ||
LL | fn stream(self) -> impl IntFactory<stream(..): Send>; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= note: ...which again requires resolving lifetimes for `IntFactory::stream`, completing the cycle | ||
note: cycle used when listing captured lifetimes for opaque `IntFactory::stream::{opaque#0}` | ||
--> $DIR/impl-trait-in-trait.rs:4:24 | ||
| | ||
LL | fn stream(self) -> impl IntFactory<stream(..): Send>; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
= 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 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0391`. |
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
14 changes: 11 additions & 3 deletions
14
tests/ui/impl-trait/precise-capturing/capturing-implicit.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 |
---|---|---|
@@ -1,14 +1,22 @@ | ||
error: [] | ||
error: `impl Trait` captures lifetime parameter, but it is not mentioned in `use<...>` precise captures list | ||
--> $DIR/capturing-implicit.rs:8:11 | ||
| | ||
LL | fn foo(x: &()) -> impl IntoIterator<Item = impl Sized> + use<> { | ||
| ^ -------------------------------------------- lifetime captured due to being mentioned in the bounds of the `impl Trait` | ||
| | | ||
| this lifetime parameter is captured | ||
|
||
error: ['_: o] | ||
--> $DIR/capturing-implicit.rs:8:19 | ||
| | ||
LL | fn foo(x: &()) -> impl IntoIterator<Item = impl Sized> + use<> { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: [] | ||
error: ['_: o] | ||
--> $DIR/capturing-implicit.rs:8:44 | ||
| | ||
LL | fn foo(x: &()) -> impl IntoIterator<Item = impl Sized> + use<> { | ||
| ^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
error: aborting due to 3 previous errors | ||
|
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