File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
ide-diagnostics/src/handlers Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -563,6 +563,10 @@ impl<'a> DeclValidator<'a> {
563563 cov_mark:: hit!( extern_static_incorrect_case_ignored) ;
564564 return ;
565565 }
566+ if self . db . attrs ( static_id. into ( ) ) . by_key ( sym:: no_mangle) . exists ( ) {
567+ cov_mark:: hit!( no_mangle_static_incorrect_case_ignored) ;
568+ return ;
569+ }
566570
567571 self . create_incorrect_case_diagnostic_for_item_name (
568572 static_id,
Original file line number Diff line number Diff line change @@ -439,10 +439,27 @@ fn f((_O): u8) {}
439439 #[ test]
440440 fn ignores_no_mangle_items ( ) {
441441 cov_mark:: check!( extern_func_no_mangle_ignored) ;
442+ cov_mark:: check!( no_mangle_static_incorrect_case_ignored) ;
442443 check_diagnostics (
443444 r#"
444445#[no_mangle]
445446extern "C" fn NonSnakeCaseName(some_var: u8) -> u8;
447+ #[no_mangle]
448+ static lower_case: () = ();
449+ "# ,
450+ ) ;
451+ }
452+
453+ #[ test]
454+ fn ignores_unsafe_no_mangle_items ( ) {
455+ cov_mark:: check!( extern_func_no_mangle_ignored) ;
456+ cov_mark:: check!( no_mangle_static_incorrect_case_ignored) ;
457+ check_diagnostics (
458+ r#"
459+ #[unsafe(no_mangle)]
460+ extern "C" fn NonSnakeCaseName(some_var: u8) -> u8;
461+ #[unsafe(no_mangle)]
462+ static lower_case: () = ();
446463 "# ,
447464 ) ;
448465 }
You can’t perform that action at this time.
0 commit comments