Skip to content

Commit 4c166ab

Browse files
committed
Handle provided trait methods when giving inference error suggestions
This fixes an ICE. Closes issue #17758
1 parent 908c9e6 commit 4c166ab

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/librustc/middle/typeck/infer/error_reporting.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,19 @@ impl<'a, 'tcx> ErrorReporting for InferCtxt<'a, 'tcx> {
869869
ast::TypeImplItem(_) => None,
870870
}
871871
},
872+
ast_map::NodeTraitItem(ref item) => {
873+
match **item {
874+
ast::ProvidedMethod(ref m) => {
875+
Some((m.pe_fn_decl(),
876+
m.pe_generics(),
877+
m.pe_fn_style(),
878+
m.pe_ident(),
879+
Some(&m.pe_explicit_self().node),
880+
m.span))
881+
}
882+
_ => None
883+
}
884+
}
872885
_ => None
873886
},
874887
None => None

0 commit comments

Comments
 (0)