Skip to content

Commit 875c6b2

Browse files
authored
Rollup merge of #72710 - jsgf:unused-deps-test, r=jsgf
Add test to make sure -Wunused-crate-dependencies works with tests Make sure code in `#[test]` blocks counts as a use of a crate.
2 parents ca8640e + ce81d15 commit 875c6b2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Test-only use OK
2+
3+
// edition:2018
4+
// check-pass
5+
// aux-crate:bar=bar.rs
6+
// compile-flags:--test
7+
8+
#![deny(unused_crate_dependencies)]
9+
10+
fn main() {}
11+
12+
#[test]
13+
fn test_bar() {
14+
assert_eq!(bar::BAR, "bar");
15+
}

0 commit comments

Comments
 (0)