Skip to content

Commit f713bb2

Browse files
mejrsJonathanBrouwer
authored andcommitted
invert dependency on rustc_error_messages
1 parent 29dba3e commit f713bb2

5 files changed

Lines changed: 13 additions & 9 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3976,7 +3976,6 @@ dependencies = [
39763976
"rustc_macros",
39773977
"rustc_serialize",
39783978
"rustc_span",
3979-
"rustc_structures",
39803979
"unic-langid",
39813980
]
39823981

@@ -4788,6 +4787,7 @@ version = "0.0.0"
47884787
dependencies = [
47894788
"bitflags",
47904789
"rustc_data_structures",
4790+
"rustc_error_messages",
47914791
"rustc_macros",
47924792
"rustc_serialize",
47934793
"schemars",

compiler/rustc_error_messages/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ rustc_data_structures = { path = "../rustc_data_structures" }
1414
rustc_macros = { path = "../rustc_macros" }
1515
rustc_serialize = { path = "../rustc_serialize" }
1616
rustc_span = { path = "../rustc_span" }
17-
rustc_structures = { path = "../rustc_structures" }
1817
unic-langid = { version = "0.9.0", features = ["macros"] }
1918
# tidy-alphabetical-end

compiler/rustc_error_messages/src/diagnostic_impls.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use std::path::{Path, PathBuf};
66
use std::process::ExitStatus;
77

88
use rustc_span::edition::Edition;
9-
use rustc_structures::Limit;
109

1110
use crate::{DiagArgValue, IntoDiagArg};
1211

@@ -157,9 +156,3 @@ impl IntoDiagArg for Backtrace {
157156
DiagArgValue::Str(Cow::from(self.to_string()))
158157
}
159158
}
160-
161-
impl IntoDiagArg for Limit {
162-
fn into_diag_arg(self, _: &mut Option<std::path::PathBuf>) -> DiagArgValue {
163-
self.0.into_diag_arg(&mut None)
164-
}
165-
}

compiler/rustc_structures/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ edition = "2024"
77
# tidy-alphabetical-start
88
bitflags = "2.4.1"
99
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
10+
rustc_error_messages = { path = "../rustc_error_messages", optional = true }
1011
rustc_macros = { path = "../rustc_macros", optional = true }
1112
rustc_serialize = { path = "../rustc_serialize", optional = true }
1213
schemars = "1.0.4"
@@ -18,6 +19,7 @@ serde = "1.0.219"
1819
default = ["nightly"]
1920
nightly = [
2021
"dep:rustc_data_structures",
22+
"dep:rustc_error_messages",
2123
"dep:rustc_macros",
2224
"dep:rustc_serialize",
2325
]

compiler/rustc_structures/src/limit.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,13 @@ impl Mul<usize> for Limit {
5656
Limit::new(self.0 * rhs)
5757
}
5858
}
59+
60+
#[cfg(feature = "nightly")]
61+
impl rustc_error_messages::IntoDiagArg for Limit {
62+
fn into_diag_arg(
63+
self,
64+
_: &mut Option<std::path::PathBuf>,
65+
) -> rustc_error_messages::DiagArgValue {
66+
self.0.into_diag_arg(&mut None)
67+
}
68+
}

0 commit comments

Comments
 (0)