Skip to content

Commit a2139d5

Browse files
committed
clean up some unused leftovers
1 parent d42a68b commit a2139d5

File tree

2 files changed

+1
-34
lines changed

2 files changed

+1
-34
lines changed

compiler/rustc_middle/src/error.rs

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
use std::io;
12
use std::path::Path;
2-
use std::{fmt, io};
33

44
use rustc_errors::codes::*;
5-
use rustc_errors::{DiagArgName, DiagArgValue, DiagMessage};
65
use rustc_macros::{Diagnostic, Subdiagnostic};
76
use rustc_span::{Span, Symbol};
87

@@ -114,29 +113,6 @@ pub(super) struct ConstNotUsedTraitAlias {
114113
pub span: Span,
115114
}
116115

117-
pub struct CustomSubdiagnostic<'a> {
118-
pub msg: fn() -> DiagMessage,
119-
pub add_args: Box<dyn FnOnce(&mut dyn FnMut(DiagArgName, DiagArgValue)) + 'a>,
120-
}
121-
122-
impl<'a> CustomSubdiagnostic<'a> {
123-
pub fn label(x: fn() -> DiagMessage) -> Self {
124-
Self::label_and_then(x, |_| {})
125-
}
126-
pub fn label_and_then<F: FnOnce(&mut dyn FnMut(DiagArgName, DiagArgValue)) + 'a>(
127-
msg: fn() -> DiagMessage,
128-
f: F,
129-
) -> Self {
130-
Self { msg, add_args: Box::new(move |x| f(x)) }
131-
}
132-
}
133-
134-
impl fmt::Debug for CustomSubdiagnostic<'_> {
135-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
136-
f.debug_struct("CustomSubdiagnostic").finish_non_exhaustive()
137-
}
138-
}
139-
140116
#[derive(Diagnostic)]
141117
pub enum LayoutError<'tcx> {
142118
#[diag("the type `{$ty}` has an unknown layout")]

compiler/rustc_middle/src/ty/consts/int.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use std::num::NonZero;
44
use rustc_abi::Size;
55
use rustc_apfloat::Float;
66
use rustc_apfloat::ieee::{Double, Half, Quad, Single};
7-
use rustc_errors::{DiagArgValue, IntoDiagArg};
87
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
98

109
use crate::ty::TyCtxt;
@@ -137,14 +136,6 @@ impl std::fmt::Debug for ConstInt {
137136
}
138137
}
139138

140-
impl IntoDiagArg for ConstInt {
141-
// FIXME this simply uses the Debug impl, but we could probably do better by converting both
142-
// to an inherent method that returns `Cow`.
143-
fn into_diag_arg(self, _: &mut Option<std::path::PathBuf>) -> DiagArgValue {
144-
DiagArgValue::Str(format!("{self:?}").into())
145-
}
146-
}
147-
148139
/// The raw bytes of a simple value.
149140
///
150141
/// This is a packed struct in order to allow this type to be optimally embedded in enums

0 commit comments

Comments
 (0)