Move FnPtrAddr
error to SessionDiagnostic
This commit is contained in:
parent
94524020ea
commit
f7f2eb3e41
3 changed files with 14 additions and 4 deletions
|
@ -8,6 +8,8 @@ use rustc_span::sym;
|
|||
use rustc_trait_selection::traits;
|
||||
use traits::{translate_substs, Reveal};
|
||||
|
||||
use crate::errors::UnexpectedFnPtrAssociatedItem;
|
||||
|
||||
fn resolve_instance<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
key: ty::ParamEnvAnd<'tcx, (DefId, SubstsRef<'tcx>)>,
|
||||
|
@ -282,10 +284,9 @@ fn resolve_associated_item<'tcx>(
|
|||
substs: rcvr_substs,
|
||||
})
|
||||
} else {
|
||||
tcx.sess.span_fatal(
|
||||
tcx.def_span(trait_item_id),
|
||||
"`FnPtrAddr` trait with unexpected assoc item",
|
||||
)
|
||||
tcx.sess.emit_fatal(UnexpectedFnPtrAssociatedItem {
|
||||
span: tcx.def_span(trait_item_id),
|
||||
})
|
||||
}
|
||||
} else {
|
||||
None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue