diff --git a/tests/ui/lint/lint-non-snake-case-crate-dylib.rs b/tests/ui/lint/lint-non-snake-case-crate-dylib.rs
index 1ab974c54f6e3..d735a91adf605 100644
--- a/tests/ui/lint/lint-non-snake-case-crate-dylib.rs
+++ b/tests/ui/lint/lint-non-snake-case-crate-dylib.rs
@@ -1,3 +1,4 @@
+//@ ignore-wasm
 #![crate_type = "dylib"]
 #![crate_name = "NonSnakeCase"]
 //~^ ERROR crate `NonSnakeCase` should have a snake case name
diff --git a/tests/ui/lint/lint-non-snake-case-crate-dylib.stderr b/tests/ui/lint/lint-non-snake-case-crate-dylib.stderr
index 23d40c2394d95..4ee1a9cb3ddd5 100644
--- a/tests/ui/lint/lint-non-snake-case-crate-dylib.stderr
+++ b/tests/ui/lint/lint-non-snake-case-crate-dylib.stderr
@@ -1,11 +1,11 @@
 error: crate `NonSnakeCase` should have a snake case name
-  --> $DIR/lint-non-snake-case-crate-dylib.rs:2:18
+  --> $DIR/lint-non-snake-case-crate-dylib.rs:3:18
    |
 LL | #![crate_name = "NonSnakeCase"]
    |                  ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
    |
 note: the lint level is defined here
-  --> $DIR/lint-non-snake-case-crate-dylib.rs:4:9
+  --> $DIR/lint-non-snake-case-crate-dylib.rs:5:9
    |
 LL | #![deny(non_snake_case)]
    |         ^^^^^^^^^^^^^^
diff --git a/tests/ui/lint/lint-non-snake-case-crate-proc-macro.rs b/tests/ui/lint/lint-non-snake-case-crate-proc-macro.rs
index 949abe5573c79..78bc630cc4e0d 100644
--- a/tests/ui/lint/lint-non-snake-case-crate-proc-macro.rs
+++ b/tests/ui/lint/lint-non-snake-case-crate-proc-macro.rs
@@ -1,3 +1,4 @@
+//@ ignore-wasm
 #![crate_type = "proc-macro"]
 #![crate_name = "NonSnakeCase"]
 //~^ ERROR crate `NonSnakeCase` should have a snake case name
diff --git a/tests/ui/lint/lint-non-snake-case-crate-proc-macro.stderr b/tests/ui/lint/lint-non-snake-case-crate-proc-macro.stderr
index 4963eef88e4b8..e0091057bc971 100644
--- a/tests/ui/lint/lint-non-snake-case-crate-proc-macro.stderr
+++ b/tests/ui/lint/lint-non-snake-case-crate-proc-macro.stderr
@@ -1,11 +1,11 @@
 error: crate `NonSnakeCase` should have a snake case name
-  --> $DIR/lint-non-snake-case-crate-proc-macro.rs:2:18
+  --> $DIR/lint-non-snake-case-crate-proc-macro.rs:3:18
    |
 LL | #![crate_name = "NonSnakeCase"]
    |                  ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case`
    |
 note: the lint level is defined here
-  --> $DIR/lint-non-snake-case-crate-proc-macro.rs:4:9
+  --> $DIR/lint-non-snake-case-crate-proc-macro.rs:5:9
    |
 LL | #![deny(non_snake_case)]
    |         ^^^^^^^^^^^^^^