This website requires JavaScript.
Explore
Help
Register
Sign In
mikros
/
rust
Watch
1
Star
0
Fork
0
You've already forked rust
Code
Issues
Pull Requests
Packages
Projects
Releases
Wiki
Activity
e30d27be00
rust
/
tests
/
ui
/
lifetimes
/
unnamed-closure-doesnt-life-long-enough-issue-67634.rs
4 lines
97 B
Rust
Raw
Normal View
History
Unescape
Escape
Do not ICE on lifetime error involving closures
2019-12-28 15:51:29 -06:00
fn
main
(
)
{
Use an 'approximate' universal upper bound when reporting region errors Fixes #67765 When reporting errors during MIR region inference, we sometimes use `universal_upper_bound` to obtain a named universal region that we can display to the user. However, this is not always possible - in a case like `fn foo<'a, 'b>() { .. }`, the only upper bound for a region containing `'a` and `'b` is `'static`. When displaying diagnostics, it's usually better to display *some* named region (even if there are multiple involved) rather than fall back to a generic error involving `'static`. This commit adds a new `approx_universal_upper_bound` method, which uses the lowest-numbered universal region if the only alternative is to return `'static`.
2020-06-27 12:54:56 -05:00
[
0
]
.
iter
(
)
.
flat_map
(
|
a
|
[
0
]
.
iter
(
)
.
map
(
|
_
|
&
a
)
)
;
//~ ERROR closure may outlive
Do not ICE on lifetime error involving closures
2019-12-28 15:51:29 -06:00
}
Reference in New Issue
Copy Permalink