about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorJana Dönszelmann <jonathan@donsz.nl>2025-06-23 12:39:09 +0200
committerGitHub <noreply@github.com>2025-06-23 12:39:09 +0200
commit6cee0a6ead11c006884d4fcd89ebe7afaac08608 (patch)
tree9e43f950416daa6cbf224e8f41968c067767e01c /tests
parentc8df66f84c94eaca3903a6747f3781f77d4791fe (diff)
parent269b67d6b8529850233b60817773b75c54206962 (diff)
downloadrust-6cee0a6ead11c006884d4fcd89ebe7afaac08608.tar.gz
rust-6cee0a6ead11c006884d4fcd89ebe7afaac08608.zip
Rollup merge of #142892 - jdonszelmann:fix-142891, r=oli-obk
Fix ICE on debug builds where lints are delayed on the crate root

r? ``@oli-obk``

Closes rust-lang/rust#142891

thanks to ``@JonathanBrouwer`` for finding it!
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/attributes/lint_on_root.rs7
-rw-r--r--tests/ui/attributes/lint_on_root.stderr12
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/attributes/lint_on_root.rs b/tests/ui/attributes/lint_on_root.rs
new file mode 100644
index 00000000000..93d47bf0d71
--- /dev/null
+++ b/tests/ui/attributes/lint_on_root.rs
@@ -0,0 +1,7 @@
+// NOTE: this used to panic in debug builds (by a sanity assertion)
+// and not emit any lint on release builds. See https://github.com/rust-lang/rust/issues/142891.
+#![inline = ""]
+//~^ ERROR valid forms for the attribute are `#[inline(always|never)]` and `#[inline]`
+//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+
+fn main() {}
diff --git a/tests/ui/attributes/lint_on_root.stderr b/tests/ui/attributes/lint_on_root.stderr
new file mode 100644
index 00000000000..aaa46e6f54b
--- /dev/null
+++ b/tests/ui/attributes/lint_on_root.stderr
@@ -0,0 +1,12 @@
+error: valid forms for the attribute are `#[inline(always|never)]` and `#[inline]`
+  --> $DIR/lint_on_root.rs:3:1
+   |
+LL | #![inline = ""]
+   | ^^^^^^^^^^^^^^^
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
+   = note: `#[deny(ill_formed_attribute_input)]` on by default
+
+error: aborting due to 1 previous error
+