hir: Remove opt_local_def_id_to_hir_id and opt_hir_node_by_def_id
Also replace a few `hir_node()` calls with `hir_node_by_def_id()`
This commit is contained in:
@@ -127,7 +127,7 @@ fn configure_main(tcx: TyCtxt<'_>, visitor: &EntryContext<'_>) -> Option<(DefId,
|
||||
{
|
||||
// non-local main imports are handled below
|
||||
if let Some(def_id) = def_id.as_local()
|
||||
&& matches!(tcx.opt_hir_node_by_def_id(def_id), Some(Node::ForeignItem(_)))
|
||||
&& matches!(tcx.hir_node_by_def_id(def_id), Node::ForeignItem(_))
|
||||
{
|
||||
tcx.dcx().emit_err(ExternMain { span: tcx.def_span(def_id) });
|
||||
return None;
|
||||
|
||||
Reference in New Issue
Block a user