File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
compiler/rustc_trait_selection/src/traits/error_reporting Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -498,12 +498,14 @@ impl<'tcx> OnUnimplementedDirective {
498498 }
499499
500500 if is_diagnostic_namespace_variant {
501- tcx. emit_node_span_lint (
502- UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES ,
503- tcx. local_def_id_to_hir_id ( item_def_id. expect_local ( ) ) ,
504- vec ! [ item. span( ) ] ,
505- MalformedOnUnimplementedAttrLint :: new ( item. span ( ) ) ,
506- ) ;
501+ if let Some ( def_id) = item_def_id. as_local ( ) {
502+ tcx. emit_node_span_lint (
503+ UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES ,
504+ tcx. local_def_id_to_hir_id ( def_id) ,
505+ vec ! [ item. span( ) ] ,
506+ MalformedOnUnimplementedAttrLint :: new ( item. span ( ) ) ,
507+ ) ;
508+ }
507509 } else {
508510 // nothing found
509511 tcx. dcx ( ) . emit_err ( NoValueInOnUnimplemented { span : item. span ( ) } ) ;
You can’t perform that action at this time.
0 commit comments