forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There were none at all. These test for original functionality, but this also adds a test that `-Dunused-crate-dependencies` causes a compilation failure, which currently fails (rust-lang#96068). This is fixed in subsequent changes.
- Loading branch information
Showing
8 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Check for unused crate dep, no path | ||
|
||
// edition:2018 | ||
// aux-crate:bar=bar.rs | ||
|
||
#![deny(unused_crate_dependencies)] | ||
//~^ ERROR external crate `bar` unused in | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error: external crate `bar` unused in `deny_attr`: remove the dependency or add `use bar as _;` | ||
--> $DIR/deny-attr.rs:6:1 | ||
| | ||
LL | #![deny(unused_crate_dependencies)] | ||
| ^ | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/deny-attr.rs:6:9 | ||
| | ||
LL | #![deny(unused_crate_dependencies)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Check for unused crate dep, no path | ||
|
||
// edition:2018 | ||
// compile-flags: -Dunused-crate-dependencies -Zunstable-options --json unused-externs --error-format=json | ||
// aux-crate:bar=bar.rs | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"lint_level":"deny","unused_extern_names":["bar"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Check for unused crate dep, no path | ||
|
||
// edition:2018 | ||
// compile-flags: -Dunused-crate-dependencies | ||
// aux-crate:bar=bar.rs | ||
|
||
fn main() {} | ||
//~^ ERROR external crate `bar` unused in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
error: external crate `bar` unused in `deny_cmdline`: remove the dependency or add `use bar as _;` | ||
--> $DIR/deny-cmdline.rs:7:1 | ||
| | ||
LL | fn main() {} | ||
| ^ | ||
| | ||
= note: requested on the command line with `-D unused-crate-dependencies` | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Check for unused crate dep, no path | ||
|
||
// edition:2018 | ||
// check-pass | ||
// compile-flags: -Wunused-crate-dependencies -Zunstable-options --json unused-externs --error-format=json | ||
// aux-crate:bar=bar.rs | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"lint_level":"warn","unused_extern_names":["bar"]} |