Skip to content

Commit db10506

Browse files
committed
gate cargo_metadata on rustc feature too
1 parent a440504 commit db10506

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ rustc_version = "0.4"
1616
colored = "2"
1717
serde = { version = "1.0", features = ["derive"] }
1818
serde_json = "1.0"
19-
cargo_metadata = "0.18"
19+
cargo_metadata = { version = "0.18", optional = true }
2020
crossbeam-channel = "0.5.6"
2121
bstr = "1.0.1"
2222
rustfix = "0.8.1"
@@ -53,4 +53,4 @@ test = false
5353

5454
[features]
5555
default = ["rustc"]
56-
rustc = ["dep:cargo-platform"]
56+
rustc = ["dep:cargo-platform", "dep:cargo_metadata"]

src/diagnostics.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Data structures for handling diagnostic output from tests.
22
3+
#[cfg(feature = "rustc")]
34
use cargo_metadata::diagnostic::DiagnosticLevel;
45

56
#[derive(Copy, Clone, Debug, PartialOrd, Ord, PartialEq, Eq)]
@@ -19,6 +20,7 @@ pub enum Level {
1920
FailureNote = 0,
2021
}
2122

23+
#[cfg(feature = "rustc")]
2224
impl From<DiagnosticLevel> for Level {
2325
fn from(value: DiagnosticLevel) -> Self {
2426
match value {

0 commit comments

Comments
 (0)