Skip to content

Commit

Permalink
Add test to make sure -Wunused-crate-dependencies works with tests
Browse files Browse the repository at this point in the history
Make sure code in `#[test]` blocks counts as a use of a crate.
  • Loading branch information
jsgf committed May 28, 2020
1 parent 4512721 commit ce81d15
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/ui/unused-crate-deps/test-use-ok.rs
@@ -0,0 +1,15 @@
// Test-only use OK

// edition:2018
// check-pass
// aux-crate:bar=bar.rs
// compile-flags:--test

#![deny(unused_crate_dependencies)]

fn main() {}

#[test]
fn test_bar() {
assert_eq!(bar::BAR, "bar");
}

0 comments on commit ce81d15

Please sign in to comment.