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