Rollup merge of #100617 - chenyukang:fix-100605, r=compiler-errors
Suggest the right help message for as_ref Fixes #100605
This commit is contained in:
commit
61a529d902
3 changed files with 57 additions and 1 deletions
|
@ -2079,7 +2079,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
|||
diag.span_suggestion(
|
||||
span,
|
||||
*msg,
|
||||
format!("{}.as_ref()", snippet),
|
||||
// HACK: fix issue# 100605, suggesting convert from &Option<T> to Option<&T>, remove the extra `&`
|
||||
format!("{}.as_ref()", snippet.trim_start_matches('&')),
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue