Skip to content

Commit

Permalink
Rollup merge of #72710 - jsgf:unused-deps-test, r=jsgf
Browse files Browse the repository at this point in the history
Add test to make sure -Wunused-crate-dependencies works with tests

Make sure code in `#[test]` blocks counts as a use of a crate.
  • Loading branch information
JohnTitor authored May 30, 2020
2 parents ca8640e + ce81d15 commit 875c6b2
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
Original file line number Diff line number Diff line change
@@ -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 875c6b2

Please sign in to comment.