-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
NLL regresses diagnostic for impl-trait/static-return-lifetime-infered.rs #53900
Conversation
src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr
Outdated
Show resolved
Hide resolved
src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
c30710f
to
df4b196
Compare
src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
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.
Looks mostly good. Left a few nits.
src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
@bors r+ |
📌 Commit cd19ce4ad0273ae7dcc0634499fc883609bf95df has been approved by |
☔ The latest upstream changes (presumably #53327) made this pull request unmergeable. Please resolve the merge conflicts. |
cd19ce4
to
b1e7c63
Compare
Rebased. |
if let Ok(snippet) = infcx.tcx.sess.source_map().span_to_snippet(span) { | ||
let suggestable_fr_name = match fr_name { | ||
RegionName::Named(name) => format!("{}", name), | ||
RegionName::Synthesized(_) => "'_".to_string(), |
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.
Hmm, I just noticed this; it is not always going to be correct, right?
e.g., in this example
fn foo(x: &[i32], y: &[i32]) -> impl Iterator<Item = i32> {
y.iter().cloned()
}
but we should probably just file a follow-up issue.
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.
We currently get the following for that example:
error[E0621]: explicit lifetime required in the type of `y`
--> test.rs:2:5
|
1 | fn foo(x: &[i32], y: &[i32]) -> impl Iterator<Item = i32> {
| ------ help: add explicit lifetime `'static` to the type of `y`: `&'static [i32]`
2 | y.iter().cloned()
| ^^^^^^^^^^^^^^^^^ lifetime `'static` required
error: unsatisfied lifetime constraints
--> test.rs:2:5
|
1 | fn foo(x: &[i32], y: &[i32]) -> impl Iterator<Item = i32> {
| - - let's call the lifetime of this reference `'1`
| |
| let's call the lifetime of this reference `'2`
2 | y.iter().cloned()
| ^^^^^^^^ requires that `'1` must outlive `'2`
@bors r+ |
📌 Commit b1e7c635c877c048a1b13087d19eee7cf96ba7f4 has been approved by |
⌛ Testing commit b1e7c635c877c048a1b13087d19eee7cf96ba7f4 with merge d0d3b809ab3cc7ddeca8caa7f79c56a6ff5b8385... |
💔 Test failed - status-appveyor |
Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
⌛ Testing commit b1e7c635c877c048a1b13087d19eee7cf96ba7f4 with merge ce7917c3f41561c8b662faf0b7598a837b825174... |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
💔 Test failed - status-travis |
b1e7c63
to
18c1374
Compare
Rebased this. |
@bors r+ |
📌 Commit 18c1374 has been approved by |
@davidtwco btw, as you have r+ now, you can feel free to do |
NLL regresses diagnostic for impl-trait/static-return-lifetime-infered.rs Fixes #53771. r? @nikomatsakis cc @pnkfelix @estebank
☀️ Test successful - status-appveyor, status-travis |
Fixes #53771.
r? @nikomatsakis
cc @pnkfelix @estebank