about summary refs log tree commit diff
diff options
context:
space:
mode:
authorasquared31415 <34665709+asquared31415@users.noreply.github.com>2021-07-22 19:26:16 -0400
committerasquared31415 <34665709+asquared31415@users.noreply.github.com>2021-08-04 13:38:17 -0400
commit1ae19b69e820a4497a15a8c70a2e57bea3785405 (patch)
tree4ed49b170cf3a944df0d3134ad3d7e34e6d0175a
parent8e7bbc9e9da091f4e7d9f846f0f264420b8a6f0e (diff)
downloadrust-1ae19b69e820a4497a15a8c70a2e57bea3785405.tar.gz
rust-1ae19b69e820a4497a15a8c70a2e57bea3785405.zip
Fix lint capitalization and ignoring, test with include_str
-rw-r--r--compiler/rustc_builtin_macros/src/asm.rs6
-rw-r--r--compiler/rustc_lint/src/context.rs2
-rw-r--r--compiler/rustc_lint_defs/src/builtin.rs1
-rw-r--r--src/test/codegen/asm-sanitize-llvm.rs1
-rw-r--r--src/test/ui/asm/named-asm-labels.rs (renamed from src/test/ui/asm/named_asm_labels.rs)14
-rw-r--r--src/test/ui/asm/named-asm-labels.s5
-rw-r--r--src/test/ui/asm/named-asm-labels.stderr (renamed from src/test/ui/asm/named_asm_labels.stderr)223
7 files changed, 148 insertions, 104 deletions
diff --git a/compiler/rustc_builtin_macros/src/asm.rs b/compiler/rustc_builtin_macros/src/asm.rs
index 35dcd08951b..a1119916dc1 100644
--- a/compiler/rustc_builtin_macros/src/asm.rs
+++ b/compiler/rustc_builtin_macros/src/asm.rs
@@ -530,17 +530,17 @@ fn expand_preparsed_asm(
                             span,
                             ecx.current_expansion.lint_node_id,
                             "do not use named labels in inline assembly",
-                            BuiltinLintDiagnostics::NamedAsmLabel("Only GAS local labels of the form `N:` where N is a number may be used in inline asm".to_string()),
+                            BuiltinLintDiagnostics::NamedAsmLabel("only GAS local labels of the form `N:` where N is a number may be used in inline asm".to_string()),
                         );
                     }
                 } else {
                     // If there were labels but we couldn't find a span, combine the warnings and use the template span
                     ecx.parse_sess().buffer_lint_with_diagnostic(
                         lint::builtin::NAMED_ASM_LABELS,
-                        template_span,
+                        template_sp,
                         ecx.current_expansion.lint_node_id,
                         "do not use named labels in inline assembly",
-                        BuiltinLintDiagnostics::NamedAsmLabel("Only GAS local labels of the form `N:` where N is a number may be used in inline asm".to_string()),
+                        BuiltinLintDiagnostics::NamedAsmLabel("only GAS local labels of the form `N:` where N is a number may be used in inline asm".to_string()),
                     );
                 }
             }
diff --git a/compiler/rustc_lint/src/context.rs b/compiler/rustc_lint/src/context.rs
index 60d9e8e0e71..47c6e904cd7 100644
--- a/compiler/rustc_lint/src/context.rs
+++ b/compiler/rustc_lint/src/context.rs
@@ -760,7 +760,7 @@ pub trait LintContext: Sized {
                 }
                 BuiltinLintDiagnostics::NamedAsmLabel(help) => {
                     db.help(&help);
-                    db.note("See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information");
+                    db.note("see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information");
                 }
             }
             // Rewrap `db`, and pass control to the user.
diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs
index 641ae93fdb3..df17ec576e8 100644
--- a/compiler/rustc_lint_defs/src/builtin.rs
+++ b/compiler/rustc_lint_defs/src/builtin.rs
@@ -2990,6 +2990,7 @@ declare_lint_pass! {
         INLINE_NO_SANITIZE,
         BAD_ASM_STYLE,
         ASM_SUB_REGISTER,
+        NAMED_ASM_LABELS,
         UNSAFE_OP_IN_UNSAFE_FN,
         INCOMPLETE_INCLUDE,
         CENUM_IMPL_DROP_CAST,
diff --git a/src/test/codegen/asm-sanitize-llvm.rs b/src/test/codegen/asm-sanitize-llvm.rs
index 135177016bf..6dcacd08cac 100644
--- a/src/test/codegen/asm-sanitize-llvm.rs
+++ b/src/test/codegen/asm-sanitize-llvm.rs
@@ -7,6 +7,7 @@
 #![no_core]
 #![feature(no_core, lang_items, rustc_attrs)]
 #![crate_type = "rlib"]
+#![allow(named_asm_labels)]
 
 #[rustc_builtin_macro]
 macro_rules! asm {
diff --git a/src/test/ui/asm/named_asm_labels.rs b/src/test/ui/asm/named-asm-labels.rs
index db7d9a17b05..2a2d6e5cc78 100644
--- a/src/test/ui/asm/named_asm_labels.rs
+++ b/src/test/ui/asm/named-asm-labels.rs
@@ -114,6 +114,20 @@ fn main() {
         asm!(":lo12:FOO"); // this is apparently valid aarch64
         // is there an example that is valid x86 for this test?
         asm!(":bbb nop");
+
+        // Test include_str in asm
+        asm!(include_str!("named-asm-labels.s")); //~ ERROR do not use named labels
+
+        // Test allowing or warning on the lint instead
+        #[allow(named_asm_labels)]
+        {
+            asm!("allowed: nop"); // Should not emit anything
+        }
+
+        #[warn(named_asm_labels)]
+        {
+            asm!("warned: nop"); //~ WARNING do not use named labels
+        }
     }
 }
 
diff --git a/src/test/ui/asm/named-asm-labels.s b/src/test/ui/asm/named-asm-labels.s
new file mode 100644
index 00000000000..071356d75a0
--- /dev/null
+++ b/src/test/ui/asm/named-asm-labels.s
@@ -0,0 +1,5 @@
+lab1: nop
+// do more things
+lab2: nop // does bar
+// a: b
+lab3: nop; lab4: nop
diff --git a/src/test/ui/asm/named_asm_labels.stderr b/src/test/ui/asm/named-asm-labels.stderr
index 42641db603c..2e1258d127d 100644
--- a/src/test/ui/asm/named_asm_labels.stderr
+++ b/src/test/ui/asm/named-asm-labels.stderr
@@ -1,300 +1,323 @@
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:11:15
+  --> $DIR/named-asm-labels.rs:11:15
    |
 LL |         asm!("bar: nop");
    |               ^^^
    |
    = note: `#[deny(named_asm_labels)]` on by default
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:14:15
+  --> $DIR/named-asm-labels.rs:14:15
    |
 LL |         asm!("abcd:");
    |               ^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:17:15
+  --> $DIR/named-asm-labels.rs:17:15
    |
 LL |         asm!("foo: bar1: nop");
    |               ^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:17:20
+  --> $DIR/named-asm-labels.rs:17:20
    |
 LL |         asm!("foo: bar1: nop");
    |                    ^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:22:15
+  --> $DIR/named-asm-labels.rs:22:15
    |
 LL |         asm!("foo1: nop", "nop");
    |               ^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:23:15
+  --> $DIR/named-asm-labels.rs:23:15
    |
 LL |         asm!("foo2: foo3: nop", "nop");
    |               ^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:23:21
+  --> $DIR/named-asm-labels.rs:23:21
    |
 LL |         asm!("foo2: foo3: nop", "nop");
    |                     ^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:26:22
+  --> $DIR/named-asm-labels.rs:26:22
    |
 LL |         asm!("nop", "foo4: nop");
    |                      ^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:27:15
+  --> $DIR/named-asm-labels.rs:27:15
    |
 LL |         asm!("foo5: nop", "foo6: nop");
    |               ^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:27:28
+  --> $DIR/named-asm-labels.rs:27:28
    |
 LL |         asm!("foo5: nop", "foo6: nop");
    |                            ^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:32:15
+  --> $DIR/named-asm-labels.rs:32:15
    |
 LL |         asm!("foo7: nop; foo8: nop");
    |               ^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:32:26
+  --> $DIR/named-asm-labels.rs:32:26
    |
 LL |         asm!("foo7: nop; foo8: nop");
    |                          ^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:35:15
+  --> $DIR/named-asm-labels.rs:35:15
    |
 LL |         asm!("foo9: nop; nop");
    |               ^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:36:20
+  --> $DIR/named-asm-labels.rs:36:20
    |
 LL |         asm!("nop; foo10: nop");
    |                    ^^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:39:15
+  --> $DIR/named-asm-labels.rs:39:15
    |
 LL |         asm!("bar2: nop\n bar3: nop");
    |               ^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:39:27
+  --> $DIR/named-asm-labels.rs:39:27
    |
 LL |         asm!("bar2: nop\n bar3: nop");
    |                           ^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:42:15
+  --> $DIR/named-asm-labels.rs:42:15
    |
 LL |         asm!("bar4: nop\n nop");
    |               ^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:43:21
+  --> $DIR/named-asm-labels.rs:43:21
    |
 LL |         asm!("nop\n bar5: nop");
    |                     ^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:44:21
+  --> $DIR/named-asm-labels.rs:44:21
    |
 LL |         asm!("nop\n bar6: bar7: nop");
    |                     ^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:44:27
+  --> $DIR/named-asm-labels.rs:44:27
    |
 LL |         asm!("nop\n bar6: bar7: nop");
    |                           ^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:51:13
+  --> $DIR/named-asm-labels.rs:51:13
    |
 LL |             blah2: nop
    |             ^^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:52:13
+  --> $DIR/named-asm-labels.rs:52:13
    |
 LL |             blah3: nop
    |             ^^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:60:19
+  --> $DIR/named-asm-labels.rs:60:19
    |
 LL |             nop ; blah4: nop
    |                   ^^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:74:15
+  --> $DIR/named-asm-labels.rs:74:15
    |
 LL |         asm!("blah1: 2bar: nop");
    |               ^^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:77:15
+  --> $DIR/named-asm-labels.rs:77:15
    |
 LL |         asm!("def: def: nop");
    |               ^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:78:15
+  --> $DIR/named-asm-labels.rs:78:15
    |
 LL |         asm!("def: nop\ndef: nop");
    |               ^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:79:15
+  --> $DIR/named-asm-labels.rs:79:15
    |
 LL |         asm!("def: nop; def: nop");
    |               ^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:87:15
+  --> $DIR/named-asm-labels.rs:87:15
    |
 LL |         asm!("fooo\u{003A} nop");
    |               ^^^^^^^^^^^^^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:88:15
+  --> $DIR/named-asm-labels.rs:88:15
    |
 LL |         asm!("foooo\x3A nop");
    |               ^^^^^^^^^^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:91:15
+  --> $DIR/named-asm-labels.rs:91:15
    |
 LL |         asm!("fooooo:\u{000A} nop");
    |               ^^^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:92:15
+  --> $DIR/named-asm-labels.rs:92:15
    |
 LL |         asm!("foooooo:\x0A nop");
    |               ^^^^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:96:14
+  --> $DIR/named-asm-labels.rs:96:14
    |
 LL |         asm!("\x41\x42\x43\x3A\x20\x6E\x6F\x70");
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
 error: do not use named labels in inline assembly
-  --> $DIR/named_asm_labels.rs:107:13
+  --> $DIR/named-asm-labels.rs:107:13
    |
 LL |             ab: nop // ab: does foo
    |             ^^
    |
-   = help: Only GAS local labels of the form `N:` where N is a number may be used in inline asm
-   = note: See the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
 
-error: aborting due to 33 previous errors
+error: do not use named labels in inline assembly
+  --> $DIR/named-asm-labels.rs:119:14
+   |
+LL |         asm!(include_str!("named-asm-labels.s"));
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+warning: do not use named labels in inline assembly
+  --> $DIR/named-asm-labels.rs:129:19
+   |
+LL |             asm!("warned: nop");
+   |                   ^^^^^^
+   |
+note: the lint level is defined here
+  --> $DIR/named-asm-labels.rs:127:16
+   |
+LL |         #[warn(named_asm_labels)]
+   |                ^^^^^^^^^^^^^^^^
+   = help: only GAS local labels of the form `N:` where N is a number may be used in inline asm
+   = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: aborting due to 34 previous errors; 1 warning emitted