Handle provided trait methods when giving inference error suggestions
This fixes an ICE. Closes issue #17758
This commit is contained in:
parent
908c9e6a1b
commit
4c166abbbb
1 changed files with 13 additions and 0 deletions
|
|
@ -869,6 +869,19 @@ impl<'a, 'tcx> ErrorReporting for InferCtxt<'a, 'tcx> {
|
|||
ast::TypeImplItem(_) => None,
|
||||
}
|
||||
},
|
||||
ast_map::NodeTraitItem(ref item) => {
|
||||
match **item {
|
||||
ast::ProvidedMethod(ref m) => {
|
||||
Some((m.pe_fn_decl(),
|
||||
m.pe_generics(),
|
||||
m.pe_fn_style(),
|
||||
m.pe_ident(),
|
||||
Some(&m.pe_explicit_self().node),
|
||||
m.span))
|
||||
}
|
||||
_ => None
|
||||
}
|
||||
}
|
||||
_ => None
|
||||
},
|
||||
None => None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue