File tree 3 files changed +23
-0
lines changed
3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ // See https://github.com/andrewhickman/fn-error-context
2
+ #![ deny( dead_code) ]
3
+
4
+ use fn_error_context:: context;
5
+
6
+ #[ context( "context" ) ]
7
+ fn do_stuff ( ) -> anyhow:: Result < ( ) > {
8
+ anyhow:: bail!( "error" )
9
+ }
10
+
11
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error: function is never used: `do_stuff`
2
+ --> $DIR/preserve_lint.rs:7:4
3
+ |
4
+ 7 | fn do_stuff() -> anyhow::Result<()> {
5
+ | ^^^^^^^^
6
+ |
7
+ note: the lint level is defined here
8
+ --> $DIR/preserve_lint.rs:2:9
9
+ |
10
+ 2 | #![deny(dead_code)]
11
+ | ^^^^^^^^^
Original file line number Diff line number Diff line change @@ -16,4 +16,5 @@ fn tests() {
16
16
tests. compile_fail ( "tests/fmt_unused_arg.rs" ) ;
17
17
tests. pass ( "tests/fmt_named_arg.rs" ) ;
18
18
tests. compile_fail ( "tests/async_without_return.rs" ) ;
19
+ tests. compile_fail ( "tests/preserve_lint.rs" ) ;
19
20
}
You can’t perform that action at this time.
0 commit comments