File tree 4 files changed +88
-0
lines changed
4 files changed +88
-0
lines changed Original file line number Diff line number Diff line change
1
+ // This test ensures that the 2024 edition merged doctest will not use `#[allow(unused)]`.
2
+
3
+ //@ compile-flags:--test -Zunstable-options --edition 2024
4
+ //@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
5
+ //@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
6
+ //@ failure-status: 101
7
+
8
+ #![ doc( test( attr( allow( unused_variables) , deny( warnings) ) ) ) ]
9
+
10
+ /// Example
11
+ ///
12
+ /// ```rust,no_run
13
+ /// trait T { fn f(); }
14
+ /// ```
15
+ pub fn f ( ) { }
Original file line number Diff line number Diff line change
1
+
2
+ running 1 test
3
+ test $DIR/dead-code-2024.rs - f (line 12) - compile ... FAILED
4
+
5
+ failures:
6
+
7
+ ---- $DIR/dead-code-2024.rs - f (line 12) stdout ----
8
+ error: trait `T` is never used
9
+ --> $DIR/dead-code-2024.rs:13:7
10
+ |
11
+ LL | trait T { fn f(); }
12
+ | ^
13
+ |
14
+ note: the lint level is defined here
15
+ --> $DIR/dead-code-2024.rs:11:9
16
+ |
17
+ LL | #![deny(warnings)]
18
+ | ^^^^^^^^
19
+ = note: `#[deny(dead_code)]` implied by `#[deny(warnings)]`
20
+
21
+ error: aborting due to 1 previous error
22
+
23
+ Couldn't compile the test.
24
+
25
+ failures:
26
+ $DIR/dead-code-2024.rs - f (line 12)
27
+
28
+ test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
29
+
Original file line number Diff line number Diff line change
1
+ // This test ensures that the doctest will not use `#[allow(unused)]`.
2
+
3
+ //@ compile-flags:--test
4
+ //@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
5
+ //@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
6
+ //@ failure-status: 101
7
+
8
+ #![ doc( test( attr( allow( unused_variables) , deny( warnings) ) ) ) ]
9
+
10
+ /// Example
11
+ ///
12
+ /// ```rust,no_run
13
+ /// trait T { fn f(); }
14
+ /// ```
15
+ pub fn f ( ) { }
Original file line number Diff line number Diff line change
1
+
2
+ running 1 test
3
+ test $DIR/dead-code.rs - f (line 12) - compile ... FAILED
4
+
5
+ failures:
6
+
7
+ ---- $DIR/dead-code.rs - f (line 12) stdout ----
8
+ error: trait `T` is never used
9
+ --> $DIR/dead-code.rs:13:7
10
+ |
11
+ LL | trait T { fn f(); }
12
+ | ^
13
+ |
14
+ note: the lint level is defined here
15
+ --> $DIR/dead-code.rs:11:9
16
+ |
17
+ LL | #![deny(warnings)]
18
+ | ^^^^^^^^
19
+ = note: `#[deny(dead_code)]` implied by `#[deny(warnings)]`
20
+
21
+ error: aborting due to 1 previous error
22
+
23
+ Couldn't compile the test.
24
+
25
+ failures:
26
+ $DIR/dead-code.rs - f (line 12)
27
+
28
+ test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
29
+
You can’t perform that action at this time.
0 commit comments