Determine self_ty
with expected ty
This commit is contained in:
parent
089677eb32
commit
2f65aac667
4 changed files with 24 additions and 2 deletions
|
@ -901,7 +901,7 @@ fn report_trait_method_mismatch<'tcx>(
|
|||
if trait_m.fn_has_self_parameter =>
|
||||
{
|
||||
let ty = trait_sig.inputs()[0];
|
||||
let sugg = match ExplicitSelf::determine(ty, |_| ty == impl_trait_ref.self_ty()) {
|
||||
let sugg = match ExplicitSelf::determine(ty, |ty| ty == impl_trait_ref.self_ty()) {
|
||||
ExplicitSelf::ByValue => "self".to_owned(),
|
||||
ExplicitSelf::ByReference(_, hir::Mutability::Not) => "&self".to_owned(),
|
||||
ExplicitSelf::ByReference(_, hir::Mutability::Mut) => "&mut self".to_owned(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue