Skip to content

Commit 31c431f

Browse files
committed
Revert "Rollup merge of rust-lang#99213 - davidtwco:translation-migrate-passes, r=compiler-errors"
This reverts commit 79857a7, reversing changes made to 6f8fb91.
1 parent 1cd72b7 commit 31c431f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+718
-1090
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4239,7 +4239,6 @@ dependencies = [
42394239
"rustc_hir",
42404240
"rustc_index",
42414241
"rustc_lexer",
4242-
"rustc_macros",
42434242
"rustc_middle",
42444243
"rustc_serialize",
42454244
"rustc_session",

compiler/rustc_error_messages/locales/en-US/passes.ftl

Lines changed: 0 additions & 151 deletions
This file was deleted.

compiler/rustc_error_messages/locales/en-US/privacy.ftl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,3 @@ privacy-unnamed-item-is-private = {$kind} is private
1010
privacy-in-public-interface = {$vis_descr} {$kind} `{$descr}` in public interface
1111
.label = can't leak {$vis_descr} {$kind}
1212
.visibility-label = `{$descr}` declared as {$vis_descr}
13-
14-
privacy-from-private-dep-in-public-interface =
15-
{$kind} `{$descr}` from private dependency '{$krate}' in public interface
16-
17-
private-in-public-lint =
18-
{$vis_descr} {$kind} `{$descr}` in public interface (error {$kind ->
19-
[trait] E0445
20-
*[other] E0446
21-
})

compiler/rustc_error_messages/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ fluent_messages! {
3737
expand => "../locales/en-US/expand.ftl",
3838
lint => "../locales/en-US/lint.ftl",
3939
parser => "../locales/en-US/parser.ftl",
40-
passes => "../locales/en-US/passes.ftl",
4140
privacy => "../locales/en-US/privacy.ftl",
4241
typeck => "../locales/en-US/typeck.ftl",
4342
}

compiler/rustc_errors/src/diagnostic.rs

Lines changed: 77 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -40,35 +40,6 @@ pub trait IntoDiagnosticArg {
4040
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static>;
4141
}
4242

43-
macro_rules! into_diagnostic_arg_using_display {
44-
($( $ty:ty ),+ $(,)?) => {
45-
$(
46-
impl IntoDiagnosticArg for $ty {
47-
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
48-
self.to_string().into_diagnostic_arg()
49-
}
50-
}
51-
)+
52-
}
53-
}
54-
55-
into_diagnostic_arg_using_display!(
56-
i8,
57-
u8,
58-
i16,
59-
u16,
60-
i32,
61-
u32,
62-
i64,
63-
u64,
64-
i128,
65-
u128,
66-
std::num::NonZeroU32,
67-
hir::Target,
68-
Edition,
69-
Ident,
70-
);
71-
7243
impl IntoDiagnosticArg for bool {
7344
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
7445
if self {
@@ -79,9 +50,81 @@ impl IntoDiagnosticArg for bool {
7950
}
8051
}
8152

82-
impl IntoDiagnosticArg for char {
53+
impl IntoDiagnosticArg for i8 {
54+
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
55+
DiagnosticArgValue::Str(Cow::Owned(self.to_string()))
56+
}
57+
}
58+
59+
impl IntoDiagnosticArg for u8 {
8360
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
84-
DiagnosticArgValue::Str(Cow::Owned(format!("{:?}", self)))
61+
DiagnosticArgValue::Str(Cow::Owned(self.to_string()))
62+
}
63+
}
64+
65+
impl IntoDiagnosticArg for i16 {
66+
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
67+
DiagnosticArgValue::Str(Cow::Owned(self.to_string()))
68+
}
69+
}
70+
71+
impl IntoDiagnosticArg for u16 {
72+
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
73+
DiagnosticArgValue::Str(Cow::Owned(self.to_string()))
74+
}
75+
}
76+
77+
impl IntoDiagnosticArg for i32 {
78+
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
79+
DiagnosticArgValue::Str(Cow::Owned(self.to_string()))
80+
}
81+
}
82+
83+
impl IntoDiagnosticArg for u32 {
84+
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
85+
DiagnosticArgValue::Str(Cow::Owned(self.to_string()))
86+
}
87+
}
88+
89+
impl IntoDiagnosticArg for i64 {
90+
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
91+
DiagnosticArgValue::Str(Cow::Owned(self.to_string()))
92+
}
93+
}
94+
95+
impl IntoDiagnosticArg for u64 {
96+
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
97+
DiagnosticArgValue::Str(Cow::Owned(self.to_string()))
98+
}
99+
}
100+
101+
impl IntoDiagnosticArg for i128 {
102+
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
103+
DiagnosticArgValue::Str(Cow::Owned(self.to_string()))
104+
}
105+
}
106+
107+
impl IntoDiagnosticArg for u128 {
108+
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
109+
DiagnosticArgValue::Str(Cow::Owned(self.to_string()))
110+
}
111+
}
112+
113+
impl IntoDiagnosticArg for String {
114+
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
115+
DiagnosticArgValue::Str(Cow::Owned(self))
116+
}
117+
}
118+
119+
impl IntoDiagnosticArg for std::num::NonZeroU32 {
120+
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
121+
DiagnosticArgValue::Str(Cow::Owned(self.to_string()))
122+
}
123+
}
124+
125+
impl IntoDiagnosticArg for Edition {
126+
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
127+
DiagnosticArgValue::Str(Cow::Owned(self.to_string()))
85128
}
86129
}
87130

@@ -91,15 +134,15 @@ impl IntoDiagnosticArg for Symbol {
91134
}
92135
}
93136

94-
impl<'a> IntoDiagnosticArg for &'a str {
137+
impl IntoDiagnosticArg for Ident {
95138
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
96139
self.to_string().into_diagnostic_arg()
97140
}
98141
}
99142

100-
impl IntoDiagnosticArg for String {
143+
impl<'a> IntoDiagnosticArg for &'a str {
101144
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
102-
DiagnosticArgValue::Str(Cow::Owned(self))
145+
self.to_string().into_diagnostic_arg()
103146
}
104147
}
105148

compiler/rustc_errors/src/diagnostic_builder.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,6 @@ macro_rules! error_code {
595595
pub struct LintDiagnosticBuilder<'a, G: EmissionGuarantee>(DiagnosticBuilder<'a, G>);
596596

597597
impl<'a, G: EmissionGuarantee> LintDiagnosticBuilder<'a, G> {
598-
#[rustc_lint_diagnostics]
599598
/// Return the inner `DiagnosticBuilder`, first setting the primary message to `msg`.
600599
pub fn build(mut self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'a, G> {
601600
self.0.set_primary_message(msg);

compiler/rustc_macros/src/diagnostics/diagnostic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl<'a> SessionDiagnosticDerive<'a> {
5959
return DiagnosticDeriveError::ErrorHandled.to_compile_error();
6060
}
6161
(Some(DiagnosticDeriveKind::Lint), _) => {
62-
span_err(span, "only `#[error(..)]` and `#[warning(..)]` are supported")
62+
span_err(span, "only `#[error(..)]` and `#[warn(..)]` are supported")
6363
.help("use the `#[error(...)]` attribute to create a error")
6464
.emit();
6565
return DiagnosticDeriveError::ErrorHandled.to_compile_error();

0 commit comments

Comments
 (0)