forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#52168 - nikomatsakis:nll-region-name, r=est…
…ebank 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
- Loading branch information
Showing
7 changed files
with
300 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.