-
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.
- Loading branch information
Showing
4 changed files
with
38 additions
and
9 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
3 changes: 2 additions & 1 deletion
3
tests/crashes/126850.rs → tests/ui/impl-trait/closure-in-type.rs
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#![allow(incomplete_features)] | ||
#![feature(return_type_notation)] | ||
|
||
trait IntFactory { | ||
fn stream(&self) -> impl IntFactory<stream(..): IntFactory<stream(..): Send> + Send>; | ||
//~^ ERROR cycle detected when resolving lifetimes for `IntFactory::stream` | ||
} | ||
|
||
pub fn main() {} |
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/return-type-notation.rs:5:5 | ||
| | ||
LL | fn stream(&self) -> impl IntFactory<stream(..): IntFactory<stream(..): Send> + Send>; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: ...which requires computing function signature of `IntFactory::stream`... | ||
--> $DIR/return-type-notation.rs:5:5 | ||
| | ||
LL | fn stream(&self) -> impl IntFactory<stream(..): IntFactory<stream(..): Send> + Send>; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
note: ...which requires looking up late bound vars inside `IntFactory::stream`... | ||
--> $DIR/return-type-notation.rs:5:5 | ||
| | ||
LL | fn stream(&self) -> impl IntFactory<stream(..): IntFactory<stream(..): Send> + 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/return-type-notation.rs:5:25 | ||
| | ||
LL | fn stream(&self) -> impl IntFactory<stream(..): IntFactory<stream(..): Send> + 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`. |