Do not ICE on foreign malformed diagnostic::on_unimplemented
Fix #124651.
This commit is contained in:
parent
0d7b2fb797
commit
4847f2249f
@ -499,12 +499,14 @@ fn parse(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if is_diagnostic_namespace_variant {
|
if is_diagnostic_namespace_variant {
|
||||||
tcx.emit_node_span_lint(
|
if let Some(def_id) = item_def_id.as_local() {
|
||||||
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
|
tcx.emit_node_span_lint(
|
||||||
tcx.local_def_id_to_hir_id(item_def_id.expect_local()),
|
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
|
||||||
vec![item.span()],
|
tcx.local_def_id_to_hir_id(def_id),
|
||||||
MalformedOnUnimplementedAttrLint::new(item.span()),
|
vec![item.span()],
|
||||||
);
|
MalformedOnUnimplementedAttrLint::new(item.span()),
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// nothing found
|
// nothing found
|
||||||
tcx.dcx().emit_err(NoValueInOnUnimplemented { span: item.span() });
|
tcx.dcx().emit_err(NoValueInOnUnimplemented { span: item.span() });
|
||||||
|
Loading…
Reference in New Issue
Block a user