diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2020-06-27 13:54:56 -0400 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2020-06-27 14:01:59 -0400 |
| commit | 517d361a1f78cf13d589d0f6b94f5ca005bef540 (patch) | |
| tree | 01b4e4dcce5dbb0ada91a25ada41119a0c9205cc /src/libstd/sys/unix/stack_overflow.rs | |
| parent | 394e1b40d264aa6928811919c1124fa248e7d802 (diff) | |
| download | rust-517d361a1f78cf13d589d0f6b94f5ca005bef540.tar.gz rust-517d361a1f78cf13d589d0f6b94f5ca005bef540.zip | |
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`.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
