rust/tests/ui/asm
León Orell Valerian Liehr 94d780d647
Rollup merge of #131558 - sassman:feat/warnin-for-no-mangle-together-with-export-name, r=Urgau
Lint on combining `#[no_mangle]` and `#[export_name]`

This is my very first contribution to the compiler, even though I read the [chapter about lints](https://rustc-dev-guide.rust-lang.org/diagnostics.html) I'm not very certain that this ~~new lint is done right as a builtin lint~~ PR is right. I appreciate any guidance on how to improve the code.

- Add test for issue #47446
- ~~Implement the new lint `mixed_export_name_and_no_mangle` as a builtin lint (not sure if that is the right way to go)~~ Extend `unused_attributes` lint
- Add suggestion how to fix it

<details>

<summary>Old proposed new lint</summary>

> The `mixed_export_name_and_no_mangle` lint detects usage of both `#[export_name]` and `#[no_mangle]` on the same item which results on `#[no_mangle]` being ignored.
>
> *warn-by-default*
>
> ### Example
>
> ```rust
> #[no_mangle] // ignored
> #[export_name = "foo"] // takes precedences
> pub fn bar() {}
> ```
>
> ### Explanation
>
> The compiler will not respect the `#[no_mangle]` attribute when generating the symbol name for the function, as the `#[export_name]` attribute takes precedence. This can lead to confusion and is unnecessary.

</details>
2024-12-10 08:55:54 +01:00
..
aarch64 Stabilize Arm64EC inline assembly 2024-11-10 17:43:46 +09:00
loongarch Fix target_feature handling in freg of LoongArch inline assembly 2024-11-29 03:01:33 +09:00
powerpc Support floats in input/output in vector registers of PowerPC inline assembly 2024-11-29 03:10:07 +09:00
riscv Move tests/ui/abi/riscv32e-registers.rs to tests/ui/asm/riscv 2024-11-03 18:32:04 +09:00
s390x Make s390x non-clobber-only vector register support unstable 2024-11-24 21:42:22 +09:00
sparc Basic inline assembly support for SPARC and SPARC64 2024-11-07 21:19:03 +09:00
x86_64 Make asm_goto_with_outputs a separate feature gate 2024-11-24 15:24:01 +00:00
arm-low-dreg.rs compiler: Fix arm32 asm issues by hierarchically sorting reg classes 2024-06-22 21:39:58 -07:00
bad-template.aarch64.stderr Update tests 2024-03-03 09:24:38 -05:00
bad-template.rs stabilize asm_const 2024-08-13 23:18:31 +02:00
bad-template.x86_64.stderr Update tests 2024-03-03 09:24:38 -05:00
binary_asm_labels.rs add lint for inline asm labels that look like binary 2024-07-09 01:23:49 +00:00
binary_asm_labels.stderr Update the binary_asm_label message 2024-07-18 17:00:43 -04:00
binary_asm_labels_allowed.rs Change binary_asm_labels to only fire on x86 and x86_64 2024-07-18 15:00:56 -05:00
const-error.rs adjust test 2024-09-29 08:49:37 +02:00
const-refs-to-static.rs Stabilize const_refs_to_static 2024-09-26 13:21:15 +02:00
const-refs-to-static.stderr Stabilize const_refs_to_static 2024-09-26 13:21:15 +02:00
empty_global_asm.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
fail-const-eval-issue-121099.rs stabilize asm_const 2024-08-13 23:18:31 +02:00
fail-const-eval-issue-121099.stderr stabilize asm_const 2024-08-13 23:18:31 +02:00
generic-const.rs stabilize asm_const 2024-08-13 23:18:31 +02:00
ice-bad-err-span-in-template-129503.rs Fix error span when arg to asm!() is a macro call 2024-09-27 09:49:15 +05:30
ice-bad-err-span-in-template-129503.stderr Fix error span when arg to asm!() is a macro call 2024-09-27 09:49:15 +05:30
inline-syntax.arm.stderr Update the minimum external LLVM to 18 2024-09-18 13:53:31 -07:00
inline-syntax.rs Update the minimum external LLVM to 18 2024-09-18 13:53:31 -07:00
inline-syntax.x86_64.stderr Update the minimum external LLVM to 18 2024-09-18 13:53:31 -07:00
invalid-const-operand.rs stabilize asm_const 2024-08-13 23:18:31 +02:00
invalid-const-operand.stderr stabilize asm_const 2024-08-13 23:18:31 +02:00
invalid-sym-operand.rs add needs-asm-support to invalid-sym-operand 2024-08-02 19:59:34 +01:00
invalid-sym-operand.stderr add needs-asm-support to invalid-sym-operand 2024-08-02 19:59:34 +01:00
issue-72570.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-72570.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-85247.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-85247.rwpi.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-87802.rs Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
issue-87802.stderr Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
issue-89305.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-89305.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-92378.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-97490.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-99071.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-99071.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-99122-2.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-99122.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-99122.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-113788.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-113788.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
may_unwind.rs Add needs-unwind annotations to a couple of tests 2024-03-25 14:19:07 +00:00
naked-asm-outside-naked-fn.rs disallow naked_asm! outside of #[naked] functions 2024-09-10 15:19:14 +02:00
naked-asm-outside-naked-fn.stderr disallow naked_asm! outside of #[naked] functions 2024-09-10 15:19:14 +02:00
naked-functions-ffi.rs disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
naked-functions-ffi.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
naked-functions-inline.rs disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
naked-functions-inline.stderr switch to an allowlist approach 2024-07-27 12:55:39 +02:00
naked-functions-instruction-set.rs disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
naked-functions-testattrs.rs disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
naked-functions-testattrs.stderr switch to an allowlist approach 2024-07-27 12:55:39 +02:00
naked-functions-unused.aarch64.stderr use naked_asm! in naked-function tests 2024-10-06 18:12:25 +02:00
naked-functions-unused.rs disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
naked-functions-unused.x86_64.stderr use naked_asm! in naked-function tests 2024-10-06 18:12:25 +02:00
naked-functions.rs fix: rust-lang/rust#47446 2024-11-15 15:25:19 +01:00
naked-functions.stderr various fixes for naked_asm! implementation 2024-10-06 19:00:09 +02:00
naked-invalid-attr.rs disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
naked-invalid-attr.stderr disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
naked-with-invalid-repr-attr.rs disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
naked-with-invalid-repr-attr.stderr disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
named-asm-labels.rs disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
named-asm-labels.s Move /src/test to /tests 2023-01-11 09:32:08 +00:00
named-asm-labels.stderr disallow asm! in #[naked] functions 2024-10-06 18:12:25 +02:00
non-const.rs make type-check-4 asm tests about non-const expressions 2024-09-30 13:47:36 +02:00
non-const.stderr make type-check-4 asm tests about non-const expressions 2024-09-30 13:47:36 +02:00
noreturn.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
parse-error.rs stabilize asm_const 2024-08-13 23:18:31 +02:00
parse-error.stderr stabilize asm_const 2024-08-13 23:18:31 +02:00
reg-conflict.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
reg-conflict.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
simple_global_asm.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
type-check-1.rs stabilize asm_const 2024-08-13 23:18:31 +02:00
type-check-1.stderr stabilize asm_const 2024-08-13 23:18:31 +02:00
type-check-4.rs Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
type-check-4.stderr Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
unpretty-expanded.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unpretty-expanded.stdout [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unsupported-option.fixed add needs-asm-support to tests/ui/asm/unsupported-option.rs 2024-07-27 19:27:20 +02:00
unsupported-option.rs add needs-asm-support to tests/ui/asm/unsupported-option.rs 2024-07-27 19:27:20 +02:00
unsupported-option.stderr add needs-asm-support to tests/ui/asm/unsupported-option.rs 2024-07-27 19:27:20 +02:00