invert dependency on rustc_error_messages

This commit is contained in:
mejrs
2026-08-17 16:29:47 +02:00
committed by Jonathan Brouwer
parent 29dba3e326
commit f713bb2185
5 changed files with 13 additions and 9 deletions

View File

@@ -3976,7 +3976,6 @@ dependencies = [
"rustc_macros",
"rustc_serialize",
"rustc_span",
"rustc_structures",
"unic-langid",
]
@@ -4788,6 +4787,7 @@ version = "0.0.0"
dependencies = [
"bitflags",
"rustc_data_structures",
"rustc_error_messages",
"rustc_macros",
"rustc_serialize",
"schemars",

View File

@@ -14,6 +14,5 @@ rustc_data_structures = { path = "../rustc_data_structures" }
rustc_macros = { path = "../rustc_macros" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_span = { path = "../rustc_span" }
rustc_structures = { path = "../rustc_structures" }
unic-langid = { version = "0.9.0", features = ["macros"] }
# tidy-alphabetical-end

View File

@@ -6,7 +6,6 @@ use std::path::{Path, PathBuf};
use std::process::ExitStatus;
use rustc_span::edition::Edition;
use rustc_structures::Limit;
use crate::{DiagArgValue, IntoDiagArg};
@@ -157,9 +156,3 @@ impl IntoDiagArg for Backtrace {
DiagArgValue::Str(Cow::from(self.to_string()))
}
}
impl IntoDiagArg for Limit {
fn into_diag_arg(self, _: &mut Option<std::path::PathBuf>) -> DiagArgValue {
self.0.into_diag_arg(&mut None)
}
}

View File

@@ -7,6 +7,7 @@ edition = "2024"
# tidy-alphabetical-start
bitflags = "2.4.1"
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
rustc_error_messages = { path = "../rustc_error_messages", optional = true }
rustc_macros = { path = "../rustc_macros", optional = true }
rustc_serialize = { path = "../rustc_serialize", optional = true }
schemars = "1.0.4"
@@ -18,6 +19,7 @@ serde = "1.0.219"
default = ["nightly"]
nightly = [
"dep:rustc_data_structures",
"dep:rustc_error_messages",
"dep:rustc_macros",
"dep:rustc_serialize",
]

View File

@@ -56,3 +56,13 @@ impl Mul<usize> for Limit {
Limit::new(self.0 * rhs)
}
}
#[cfg(feature = "nightly")]
impl rustc_error_messages::IntoDiagArg for Limit {
fn into_diag_arg(
self,
_: &mut Option<std::path::PathBuf>,
) -> rustc_error_messages::DiagArgValue {
self.0.into_diag_arg(&mut None)
}
}