about summary refs log tree commit diff
path: root/tests/rustdoc-ui
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2024-06-27 08:05:07 +0200
committerUrgau <urgau@numericable.fr>2024-06-27 08:05:07 +0200
commit0c0dfb88eeefbbaa4c10cfa4a7f0e16541e086eb (patch)
treecc298a4858e33cc7ee75e39869a4c6eb0956efd4 /tests/rustdoc-ui
parentd929a42a664c026167800801b26d734db925314f (diff)
downloadrust-0c0dfb88eeefbbaa4c10cfa4a7f0e16541e086eb.tar.gz
rust-0c0dfb88eeefbbaa4c10cfa4a7f0e16541e086eb.zip
Switch back `non_local_definitions` lint to allow-by-default
as request T-lang is requesting some major changes in the lint inner
workings in #126768#issuecomment-2192634762
Diffstat (limited to 'tests/rustdoc-ui')
-rw-r--r--tests/rustdoc-ui/doctest/non_local_defs.rs2
-rw-r--r--tests/rustdoc-ui/doctest/non_local_defs.stderr8
-rw-r--r--tests/rustdoc-ui/doctest/non_local_defs.stdout2
3 files changed, 9 insertions, 3 deletions
diff --git a/tests/rustdoc-ui/doctest/non_local_defs.rs b/tests/rustdoc-ui/doctest/non_local_defs.rs
index aa166c343b2..d8cfe5637ae 100644
--- a/tests/rustdoc-ui/doctest/non_local_defs.rs
+++ b/tests/rustdoc-ui/doctest/non_local_defs.rs
@@ -4,6 +4,8 @@
 //@ normalize-stderr-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
 //@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
 
+#![doc(test(attr(warn(non_local_definitions))))]
+
 //! ```
 //! #[macro_export]
 //! macro_rules! a_macro { () => {} }
diff --git a/tests/rustdoc-ui/doctest/non_local_defs.stderr b/tests/rustdoc-ui/doctest/non_local_defs.stderr
index 2b47e6b5bc4..13cd2558793 100644
--- a/tests/rustdoc-ui/doctest/non_local_defs.stderr
+++ b/tests/rustdoc-ui/doctest/non_local_defs.stderr
@@ -1,5 +1,5 @@
 warning: non-local `macro_rules!` definition, `#[macro_export]` macro should be written at top level module
-  --> $DIR/non_local_defs.rs:9:1
+  --> $DIR/non_local_defs.rs:11:1
    |
 LL | macro_rules! a_macro { () => {} }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -7,7 +7,11 @@ LL | macro_rules! a_macro { () => {} }
    = help: remove the `#[macro_export]` or make this doc-test a standalone test with its own `fn main() { ... }`
    = note: a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
    = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
-   = note: `#[warn(non_local_definitions)]` on by default
+note: the lint level is defined here
+  --> $DIR/non_local_defs.rs:8:9
+   |
+LL | #![warn(non_local_definitions)]
+   |         ^^^^^^^^^^^^^^^^^^^^^
 
 warning: 1 warning emitted
 
diff --git a/tests/rustdoc-ui/doctest/non_local_defs.stdout b/tests/rustdoc-ui/doctest/non_local_defs.stdout
index bee195fcdd7..61b4074886e 100644
--- a/tests/rustdoc-ui/doctest/non_local_defs.stdout
+++ b/tests/rustdoc-ui/doctest/non_local_defs.stdout
@@ -1,6 +1,6 @@
 
 running 1 test
-test $DIR/non_local_defs.rs - (line 7) ... ok
+test $DIR/non_local_defs.rs - (line 9) ... ok
 
 test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME