Skip to content

Commit 5a7e6b1

Browse files
delete no_mangle from ui/panic-handler/panic-handler-wrong-location test
1 parent 8580abc commit 5a7e6b1

File tree

6 files changed

+10
-8
lines changed

6 files changed

+10
-8
lines changed

compiler/rustc_codegen_ssa/src/codegen_attrs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
620620
// This should never use the default as `no_mangle` is present in the attributes list
621621
let no_mangle_span = no_mangle_span.unwrap_or_default();
622622
let label_attr = format!("this defines it as the `{}` item", lang_item.name());
623-
let label = format!("is the {} item", lang_item.name());
623+
let label = format!("should be the {} item", lang_item.name());
624624
let mut err = tcx.dcx()
625625
.struct_span_err(no_mangle_span, "`#[no_mangle]` cannot be used on weak language items")
626626
.with_note("The linker requires specific names for internal language items,")
@@ -642,7 +642,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
642642
// This should never use the default as `no_mangle` is present in the attributes list
643643
let no_mangle_span = no_mangle_span.unwrap_or_default();
644644
let label_attr = format!("this defines it as the `{}` item", lang_item.name());
645-
let label = format!("is the {} item", lang_item.name());
645+
let label = format!("should be the {} item", lang_item.name());
646646
let mut warn = tcx
647647
.dcx()
648648
.struct_span_warn(

tests/ui/codegen/no_mangle_on_std_internal_lang_items.stderr renamed to tests/ui/codegen/no-mangle-on-std-internal-lang-items.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
warning: `#[no_mangle]` should not be used on std internal language items
2-
--> $DIR/no_mangle_on_std_internal_lang_items.rs:11:1
2+
--> $DIR/no-mangle-on-std-internal-lang-items.rs:11:1
33
|
44
LL | #[lang = "start"]
55
| ----------------- this defines it as the `start` item
66
LL | #[unsafe(no_mangle)]
77
| ^^^^^^^^^^^^^^^^^^^^
88
LL | fn my_custom_start<T>(main: fn() -> T, _argc: isize, _argv: *const *const u8, _arg: u8) -> isize {
9-
| ------------------------------------------------------------------------------------------------ is the start item
9+
| ------------------------------------------------------------------------------------------------ should be the start item
1010
|
1111
= note: The linker requires specific names for internal language items,
1212
= note: as they might require a specific link name in the future.
1313

1414
warning: functions generic over types or consts must be mangled
15-
--> $DIR/no_mangle_on_std_internal_lang_items.rs:12:1
15+
--> $DIR/no-mangle-on-std-internal-lang-items.rs:12:1
1616
|
1717
LL | #[unsafe(no_mangle)]
1818
| -------------------- help: remove this attribute

tests/ui/codegen/no_mangle_on_weak_lang_items.stderr renamed to tests/ui/codegen/no-mangle-on-weak-lang-items.stderr

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
error: `#[no_mangle]` cannot be used on weak language items
2-
--> $DIR/no_mangle_on_weak_lang_items.rs:10:1
2+
--> $DIR/no-mangle-on-weak-lang-items.rs:10:1
33
|
44
LL | #[unsafe(no_mangle)]
55
| ^^^^^^^^^^^^^^^^^^^^
66
LL | #[panic_handler]
77
| ---------------- this defines it as the `panic_impl` item
88
LL | pub unsafe fn panic_fmt(pi: &PanicInfo) -> ! {
9-
| -------------------------------------------- is the panic_impl item
9+
| -------------------------------------------- should be the panic_impl item
1010
|
1111
= note: The linker requires specific names for internal language items,
1212
= note: like panic handlers, eh personality functions or eh catch typeinfo variables.
13+
= note: If you are trying to prevent mangling to ease debugging, many
14+
= note: debuggers support a command such as `rbreak {sym}` to
15+
= note: match `.*{sym}.*` instead of `break {sym}` on a specific name
1316
= note: In this case it is automatically renamed to `rust_begin_unwind`
1417

1518
error: aborting due to 1 previous error

tests/ui/panic-handler/panic-handler-wrong-location.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#![no_main]
55

66
#[panic_handler] //~ ERROR `panic_impl` lang item must be applied to a function
7-
#[no_mangle]
87
static X: u32 = 42;
98

109
//~? ERROR `#[panic_handler]` function required, but not found

0 commit comments

Comments
 (0)