Suggest the right help message for as_ref
This commit is contained in:
parent
1603a70f82
commit
3de74f7e2b
3 changed files with 57 additions and 1 deletions
|
@ -2078,7 +2078,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