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.
This commit is contained in:
commit
875c6b281d
15
src/test/ui/unused-crate-deps/test-use-ok.rs
Normal file
15
src/test/ui/unused-crate-deps/test-use-ok.rs
Normal file
@ -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");
|
||||
}
|
Loading…
Reference in New Issue
Block a user