rust/compiler/rustc_infer/src
bors 7bbbaabbb6 Auto merge of #105805 - yanchen4791:issue-105227-fix, r=estebank
Suggest adding named lifetime when the return contains value borrowed from more than one lifetimes of function inputs

fix for #105227.

The problem: The suggestion of adding an explicit `'_` lifetime bound is **incorrect** when the function's return type contains a value which could be borrowed from more than one lifetimes of the function's inputs. Instead, a named lifetime parameter can be introduced in such a case.

The solution: Checking the number of elided lifetimes in the function signature. If more than one lifetimes found in the function inputs when the suggestion of adding explicit `'_` lifetime, change it to using named lifetime parameter `'a` instead.
2023-01-06 12:08:49 +00:00
..
errors Rename Rptr to Ref in AST and HIR 2022-12-28 18:52:36 +01:00
infer Auto merge of #105805 - yanchen4791:issue-105227-fix, r=estebank 2023-01-06 12:08:49 +00:00
traits don't restuct references just to reborrow 2022-12-18 17:04:32 +01:00
lib.rs Remove #![allow(rustc::potential_query_instability)] from rustc_infer 2022-10-28 15:32:49 +02:00