File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Expand file tree Collapse file tree 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/issues/3
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() {
1616 tests. compile_fail ( "tests/fmt_unused_arg.rs" ) ;
1717 tests. pass ( "tests/fmt_named_arg.rs" ) ;
1818 tests. compile_fail ( "tests/async_without_return.rs" ) ;
19+ tests. compile_fail ( "tests/preserve_lint.rs" ) ;
1920}
You can’t perform that action at this time.
0 commit comments