Logo
Explore Help
Register Sign In
mikros/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Packages Projects Releases Wiki Activity
rust/tests/ui/lifetimes/unnamed-closure-doesnt-life-long-enough-issue-67634.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

4 lines
97 B
Rust
Raw Normal View History

Do not ICE on lifetime error involving closures
2019-12-28 13:51:29 -08: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 13:54:56 -04: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 13:51:29 -08:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.1 Page: 7929ms Template: 11ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API