Detect when a lifetime is being reused in suggestion
This commit is contained in:
@@ -164,7 +164,10 @@ infer_label_bad = {$bad_kind ->
|
||||
infer_lf_bound_not_satisfied = lifetime bound not satisfied
|
||||
infer_lifetime_mismatch = lifetime mismatch
|
||||
|
||||
infer_lifetime_param_suggestion = consider introducing a named lifetime parameter{$is_impl ->
|
||||
infer_lifetime_param_suggestion = consider {$is_reuse ->
|
||||
[true] reusing
|
||||
*[false] introducing
|
||||
} a named lifetime parameter{$is_impl ->
|
||||
[true] {" "}and update trait if needed
|
||||
*[false] {""}
|
||||
}
|
||||
|
||||
@@ -517,6 +517,7 @@ impl Subdiagnostic for AddLifetimeParamsSuggestion<'_> {
|
||||
Applicability::MaybeIncorrect,
|
||||
);
|
||||
diag.arg("is_impl", is_impl);
|
||||
diag.arg("is_reuse", !introduce_new);
|
||||
|
||||
true
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user