Rollup merge of #86678 - FabianWolff:issue-86667, r=jackh726
Fix garbled suggestion for missing lifetime specifier This PR fixes #86667. The suggestion code currently checks whether there is a generic parameter that is not a synthetic `impl Trait` parameter and, if so, suggests to insert a new lifetime `'a` before that generic parameter. However, it does not make sense to insert `'a` in front of an elided lifetime parameter, since these are synthetic as well, which leads to the garbled suggestion in #86667.
This commit is contained in:
commit
a89c6be16e
3 changed files with 45 additions and 0 deletions
|
@ -1962,6 +1962,8 @@ impl<'tcx> LifetimeContext<'_, 'tcx> {
|
|||
hir::GenericParamKind::Type {
|
||||
synthetic: Some(hir::SyntheticTyParamKind::ImplTrait),
|
||||
..
|
||||
} | hir::GenericParamKind::Lifetime {
|
||||
kind: hir::LifetimeParamKind::Elided
|
||||
}
|
||||
)
|
||||
}) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue