diff options
| author | bors <bors@rust-lang.org> | 2018-07-10 11:19:31 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-07-10 11:19:31 +0000 |
| commit | fc491526dd0b5d8c8c25faa6400599e08ede1907 (patch) | |
| tree | 8d5b3b48095d6d724f878f80f0d6e6385f2ab72e /src/libstd/sys/unix/stack_overflow.rs | |
| parent | e46bfa2879e92d3b8f1e204e3b786932c68047fe (diff) | |
| parent | a6adb1ebff51dd4ff2e724bf980c9b8586142beb (diff) | |
| download | rust-fc491526dd0b5d8c8c25faa6400599e08ede1907.tar.gz rust-fc491526dd0b5d8c8c25faa6400599e08ede1907.zip | |
Auto merge of #52168 - nikomatsakis:nll-region-name, r=estebank
find and highlight the `&` or `'_` in `region_name`
Before:
```
--> $DIR/dyn-trait-underscore.rs:18:5
|
LL | fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
- | ----- lifetime `'1` appears in this argument
LL | Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
| ^^^^^^^^^^^^^^^^^^^^^^ cast requires that `'1` must outlive `'static`
```
After:
```
--> $DIR/dyn-trait-underscore.rs:18:5
|
LL | fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
+ | - let's call the lifetime of this reference `'1`
LL | Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
| ^^^^^^^^^^^^^^^^^^^^^^ cast requires that `'1` must outlive `'static`
```
Not intended as the final end point necessarily in any sense. I intentionally left some to-do points to fill in later:
- Does not apply to upvars in closures yet (should be relatively easy)
- Does not handle the case where we can't find a precise match very well
- And of course we can still tweak wording
but shows the basic idea of how to make the `Ty` and `hir::Ty` to find a good spot to highlight.
r? @estebank
cc @davidtwco
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
