-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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 #114301 - compiler-errors:dont-error-on-missing-regio…
…n-outlives, r=spastorino Don't check unnecessarily that impl trait is RPIT We have this random `return_type_impl_trait` function to detect if a function returns an RPIT which is used in outlives suggestions, but removing it doesn't actually change any diagnostics. Let's just remove it. Also, suppress a spurious outlives error from a ReError. Fixes #114274
- Loading branch information
Showing
6 changed files
with
46 additions
and
35 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
12 changes: 12 additions & 0 deletions
12
tests/ui/impl-trait/in-trait/missing-lt-outlives-in-rpitit-114274.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#![feature(return_position_impl_trait_in_trait)] | ||
|
||
trait Iterable { | ||
type Item<'a> | ||
where | ||
Self: 'a; | ||
|
||
fn iter(&self) -> impl Iterator<Item = Self::Item<'missing>>; | ||
//~^ ERROR use of undeclared lifetime name `'missing` | ||
} | ||
|
||
fn main() {} |
23 changes: 23 additions & 0 deletions
23
tests/ui/impl-trait/in-trait/missing-lt-outlives-in-rpitit-114274.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,23 @@ | ||
error[E0261]: use of undeclared lifetime name `'missing` | ||
--> $DIR/missing-lt-outlives-in-rpitit-114274.rs:8:55 | ||
| | ||
LL | fn iter(&self) -> impl Iterator<Item = Self::Item<'missing>>; | ||
| ^^^^^^^^ undeclared lifetime | ||
| | ||
= note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html | ||
help: consider making the bound lifetime-generic with a new `'missing` lifetime | ||
| | ||
LL | fn iter(&self) -> impl for<'missing> Iterator<Item = Self::Item<'missing>>; | ||
| +++++++++++++ | ||
help: consider introducing lifetime `'missing` here | ||
| | ||
LL | fn iter<'missing>(&self) -> impl Iterator<Item = Self::Item<'missing>>; | ||
| ++++++++++ | ||
help: consider introducing lifetime `'missing` here | ||
| | ||
LL | trait Iterable<'missing> { | ||
| ++++++++++ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0261`. |