Don't ICE on Fn trait error for foreign fn

This commit is contained in:
Michael Goulet 2024-08-07 13:08:24 -04:00
parent 833af65f38
commit d850f85055
3 changed files with 61 additions and 0 deletions

View file

@ -2729,6 +2729,10 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
| Node::ImplItem(&hir::ImplItem { kind: hir::ImplItemKind::Fn(ref sig, _), .. })
| Node::TraitItem(&hir::TraitItem {
kind: hir::TraitItemKind::Fn(ref sig, _), ..
})
| Node::ForeignItem(&hir::ForeignItem {
kind: hir::ForeignItemKind::Fn(ref sig, _, _),
..
}) => (
sig.span,
None,