Skip to content

Commit b220b74

Browse files
committed
Fix source ordering of IntoDiagArg impls
1 parent c88bb6c commit b220b74

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

compiler/rustc_errors/src/diagnostic_impls.rs

+30-30
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,36 @@ impl IntoDiagArg for rustc_lint_defs::Level {
227227
}
228228
}
229229

230+
impl<Id> IntoDiagArg for hir::def::Res<Id> {
231+
fn into_diag_arg(self) -> DiagArgValue {
232+
DiagArgValue::Str(Cow::Borrowed(self.descr()))
233+
}
234+
}
235+
236+
impl IntoDiagArg for DiagLocation {
237+
fn into_diag_arg(self) -> DiagArgValue {
238+
DiagArgValue::Str(Cow::from(self.to_string()))
239+
}
240+
}
241+
242+
impl IntoDiagArg for Backtrace {
243+
fn into_diag_arg(self) -> DiagArgValue {
244+
DiagArgValue::Str(Cow::from(self.to_string()))
245+
}
246+
}
247+
248+
impl IntoDiagArg for Level {
249+
fn into_diag_arg(self) -> DiagArgValue {
250+
DiagArgValue::Str(Cow::from(self.to_string()))
251+
}
252+
}
253+
254+
impl IntoDiagArg for type_ir::ClosureKind {
255+
fn into_diag_arg(self) -> DiagArgValue {
256+
DiagArgValue::Str(self.as_str().into())
257+
}
258+
}
259+
230260
#[derive(Clone)]
231261
pub struct DiagSymbolList(Vec<Symbol>);
232262

@@ -244,12 +274,6 @@ impl IntoDiagArg for DiagSymbolList {
244274
}
245275
}
246276

247-
impl<Id> IntoDiagArg for hir::def::Res<Id> {
248-
fn into_diag_arg(self) -> DiagArgValue {
249-
DiagArgValue::Str(Cow::Borrowed(self.descr()))
250-
}
251-
}
252-
253277
impl<G: EmissionGuarantee> Diagnostic<'_, G> for TargetDataLayoutErrors<'_> {
254278
fn into_diag(self, dcx: &DiagCtxt, level: Level) -> Diag<'_, G> {
255279
match self {
@@ -316,24 +340,6 @@ pub struct ExpectedLifetimeParameter {
316340
pub count: usize,
317341
}
318342

319-
impl IntoDiagArg for DiagLocation {
320-
fn into_diag_arg(self) -> DiagArgValue {
321-
DiagArgValue::Str(Cow::from(self.to_string()))
322-
}
323-
}
324-
325-
impl IntoDiagArg for Backtrace {
326-
fn into_diag_arg(self) -> DiagArgValue {
327-
DiagArgValue::Str(Cow::from(self.to_string()))
328-
}
329-
}
330-
331-
impl IntoDiagArg for Level {
332-
fn into_diag_arg(self) -> DiagArgValue {
333-
DiagArgValue::Str(Cow::from(self.to_string()))
334-
}
335-
}
336-
337343
#[derive(Subdiagnostic)]
338344
#[suggestion(errors_indicate_anonymous_lifetime, code = "{suggestion}", style = "verbose")]
339345
pub struct IndicateAnonymousLifetime {
@@ -342,9 +348,3 @@ pub struct IndicateAnonymousLifetime {
342348
pub count: usize,
343349
pub suggestion: String,
344350
}
345-
346-
impl IntoDiagArg for type_ir::ClosureKind {
347-
fn into_diag_arg(self) -> DiagArgValue {
348-
DiagArgValue::Str(self.as_str().into())
349-
}
350-
}

0 commit comments

Comments
 (0)