Skip to content

Commit c18c0ad

Browse files
committed
Auto merge of #84068 - Amanieu:fix_lint, r=lcnr
Add `bad_asm_style` to HardwiredLints This was missed when the lint was added, which prevents the lint from being ignored with `#[allow]`.
2 parents 67e402f + 83c2c5b commit c18c0ad

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

compiler/rustc_lint_defs/src/builtin.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2944,6 +2944,7 @@ declare_lint_pass! {
29442944
NONTRIVIAL_STRUCTURAL_MATCH,
29452945
SOFT_UNSTABLE,
29462946
INLINE_NO_SANITIZE,
2947+
BAD_ASM_STYLE,
29472948
ASM_SUB_REGISTER,
29482949
UNSAFE_OP_IN_UNSAFE_FN,
29492950
INCOMPLETE_INCLUDE,

src/test/ui/asm/inline-syntax.arm.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: unknown directive
2-
--> $DIR/inline-syntax.rs:22:15
2+
--> $DIR/inline-syntax.rs:25:15
33
|
44
LL | asm!(".intel_syntax noprefix", "nop");
55
| ^
@@ -11,7 +11,7 @@ LL | .intel_syntax noprefix
1111
| ^
1212

1313
error: unknown directive
14-
--> $DIR/inline-syntax.rs:25:15
14+
--> $DIR/inline-syntax.rs:28:15
1515
|
1616
LL | asm!(".intel_syntax aaa noprefix", "nop");
1717
| ^
@@ -23,7 +23,7 @@ LL | .intel_syntax aaa noprefix
2323
| ^
2424

2525
error: unknown directive
26-
--> $DIR/inline-syntax.rs:28:15
26+
--> $DIR/inline-syntax.rs:31:15
2727
|
2828
LL | asm!(".att_syntax noprefix", "nop");
2929
| ^
@@ -35,7 +35,7 @@ LL | .att_syntax noprefix
3535
| ^
3636

3737
error: unknown directive
38-
--> $DIR/inline-syntax.rs:31:15
38+
--> $DIR/inline-syntax.rs:34:15
3939
|
4040
LL | asm!(".att_syntax bbb noprefix", "nop");
4141
| ^
@@ -47,7 +47,7 @@ LL | .att_syntax bbb noprefix
4747
| ^
4848

4949
error: unknown directive
50-
--> $DIR/inline-syntax.rs:34:15
50+
--> $DIR/inline-syntax.rs:37:15
5151
|
5252
LL | asm!(".intel_syntax noprefix; nop");
5353
| ^
@@ -59,7 +59,7 @@ LL | .intel_syntax noprefix; nop
5959
| ^
6060

6161
error: unknown directive
62-
--> $DIR/inline-syntax.rs:40:13
62+
--> $DIR/inline-syntax.rs:43:13
6363
|
6464
LL | .intel_syntax noprefix
6565
| ^

src/test/ui/asm/inline-syntax.rs

+3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
// revisions: x86_64 arm
33
//[x86_64] compile-flags: --target x86_64-unknown-linux-gnu
44
//[x86_64] check-pass
5+
//[x86_64_allowed] compile-flags: --target x86_64-unknown-linux-gnu
6+
//[x86_64_allowed] check-pass
57
//[arm] compile-flags: --target armv7-unknown-linux-gnueabihf
68
//[arm] build-fail
79

810
#![feature(no_core, lang_items, rustc_attrs)]
911
#![crate_type = "rlib"]
1012
#![no_core]
13+
#![cfg_attr(x86_64_allowed, allow(bad_asm_style))]
1114

1215
#[rustc_builtin_macro]
1316
macro_rules! asm {

src/test/ui/asm/inline-syntax.x86_64.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
warning: avoid using `.intel_syntax`, Intel syntax is the default
2-
--> $DIR/inline-syntax.rs:22:15
2+
--> $DIR/inline-syntax.rs:25:15
33
|
44
LL | asm!(".intel_syntax noprefix", "nop");
55
| ^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `#[warn(bad_asm_style)]` on by default
88

99
warning: avoid using `.intel_syntax`, Intel syntax is the default
10-
--> $DIR/inline-syntax.rs:25:15
10+
--> $DIR/inline-syntax.rs:28:15
1111
|
1212
LL | asm!(".intel_syntax aaa noprefix", "nop");
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
1414

1515
warning: avoid using `.att_syntax`, prefer using `options(att_syntax)` instead
16-
--> $DIR/inline-syntax.rs:28:15
16+
--> $DIR/inline-syntax.rs:31:15
1717
|
1818
LL | asm!(".att_syntax noprefix", "nop");
1919
| ^^^^^^^^^^^^^^^^^^^^
2020

2121
warning: avoid using `.att_syntax`, prefer using `options(att_syntax)` instead
22-
--> $DIR/inline-syntax.rs:31:15
22+
--> $DIR/inline-syntax.rs:34:15
2323
|
2424
LL | asm!(".att_syntax bbb noprefix", "nop");
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^
2626

2727
warning: avoid using `.intel_syntax`, Intel syntax is the default
28-
--> $DIR/inline-syntax.rs:34:15
28+
--> $DIR/inline-syntax.rs:37:15
2929
|
3030
LL | asm!(".intel_syntax noprefix; nop");
3131
| ^^^^^^^^^^^^^^^^^^^^^^
3232

3333
warning: avoid using `.intel_syntax`, Intel syntax is the default
34-
--> $DIR/inline-syntax.rs:40:13
34+
--> $DIR/inline-syntax.rs:43:13
3535
|
3636
LL | .intel_syntax noprefix
3737
| ^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)