Skip to content

Commit

Permalink
Rollup merge of #114558 - Enselic:lifetime-diagnostic-fixed, r=cjgillot
Browse files Browse the repository at this point in the history
Remove FIXME about NLL diagnostic that is already improved

The FIXME was added in #46984 when the diagnostic message looked like this:

    // FIXME(#46983): error message should be better
    &s.0 //~ ERROR free region `` does not outlive free region `'static`

The message was improved in #90667 and now looks like this:

    &s.0 //~ ERROR lifetime may not live long enough

but the FIXME was not removed. The issue #46983 about that diagnostics should be improved has been closed. We can remove the FIXME now.

(This PR was made for #44366.)
  • Loading branch information
matthiaskrgr committed Aug 6, 2023
2 parents 44479d1 + 8a75209 commit f44f027
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion tests/ui/nll/guarantor-issue-46974.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ fn foo(s: &mut (i32,)) -> i32 {
}

fn bar(s: &Box<(i32,)>) -> &'static i32 {
// FIXME(#46983): error message should be better
&s.0 //~ ERROR lifetime may not live long enough
}

Expand Down
3 changes: 1 addition & 2 deletions tests/ui/nll/guarantor-issue-46974.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ LL | *x
| -- borrow later used here

error: lifetime may not live long enough
--> $DIR/guarantor-issue-46974.rs:13:5
--> $DIR/guarantor-issue-46974.rs:12:5
|
LL | fn bar(s: &Box<(i32,)>) -> &'static i32 {
| - let's call the lifetime of this reference `'1`
LL | // FIXME(#46983): error message should be better
LL | &s.0
| ^^^^ returning this value requires that `'1` must outlive `'static`

Expand Down

0 comments on commit f44f027

Please sign in to comment.