Skip to content

Commit 69c3d0a

Browse files
Remove unused TypeError variants
These weren't flagged by the lint because they were still technically created somewhere... if you created them before, somehow.
1 parent dcc8d57 commit 69c3d0a

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

src/librustc/ty/error.rs

-27
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,21 @@ pub enum TypeError<'tcx> {
3333
UnsafetyMismatch(ExpectedFound<hir::Unsafety>),
3434
AbiMismatch(ExpectedFound<abi::Abi>),
3535
Mutability,
36-
BoxMutability,
37-
PtrMutability,
38-
RefMutability,
39-
VecMutability,
4036
TupleSize(ExpectedFound<usize>),
4137
FixedArraySize(ExpectedFound<usize>),
42-
TyParamSize(ExpectedFound<usize>),
4338
ArgCount,
4439
RegionsDoesNotOutlive(&'tcx Region, &'tcx Region),
4540
RegionsNotSame(&'tcx Region, &'tcx Region),
4641
RegionsNoOverlap(&'tcx Region, &'tcx Region),
4742
RegionsInsufficientlyPolymorphic(BoundRegion, &'tcx Region),
4843
RegionsOverlyPolymorphic(BoundRegion, &'tcx Region),
4944
Sorts(ExpectedFound<Ty<'tcx>>),
50-
IntegerAsChar,
5145
IntMismatch(ExpectedFound<ty::IntVarValue>),
5246
FloatMismatch(ExpectedFound<ast::FloatTy>),
5347
Traits(ExpectedFound<DefId>),
5448
BuiltinBoundsMismatch(ExpectedFound<ty::BuiltinBounds>),
5549
VariadicMismatch(ExpectedFound<bool>),
5650
CyclicTy,
57-
ConvergenceMismatch(ExpectedFound<bool>),
5851
ProjectionNameMismatched(ExpectedFound<Name>),
5952
ProjectionBoundsLength(ExpectedFound<usize>),
6053
TyParamDefaultMismatch(ExpectedFound<type_variable::Default<'tcx>>)
@@ -99,18 +92,6 @@ impl<'tcx> fmt::Display for TypeError<'tcx> {
9992
values.found)
10093
}
10194
Mutability => write!(f, "types differ in mutability"),
102-
BoxMutability => {
103-
write!(f, "boxed types differ in mutability")
104-
}
105-
VecMutability => write!(f, "vectors differ in mutability"),
106-
PtrMutability => write!(f, "pointers differ in mutability"),
107-
RefMutability => write!(f, "references differ in mutability"),
108-
TyParamSize(values) => {
109-
write!(f, "expected a type with {} type params, \
110-
found one with {} type params",
111-
values.expected,
112-
values.found)
113-
}
11495
FixedArraySize(values) => {
11596
write!(f, "expected an array with a fixed size of {} elements, \
11697
found one with {} elements",
@@ -167,9 +148,6 @@ impl<'tcx> fmt::Display for TypeError<'tcx> {
167148
values.found)
168149
}
169150
}
170-
IntegerAsChar => {
171-
write!(f, "expected an integral type, found `char`")
172-
}
173151
IntMismatch(ref values) => {
174152
write!(f, "expected `{:?}`, found `{:?}`",
175153
values.expected,
@@ -185,11 +163,6 @@ impl<'tcx> fmt::Display for TypeError<'tcx> {
185163
if values.expected { "variadic" } else { "non-variadic" },
186164
if values.found { "variadic" } else { "non-variadic" })
187165
}
188-
ConvergenceMismatch(ref values) => {
189-
write!(f, "expected {} fn, found {} function",
190-
if values.expected { "converging" } else { "diverging" },
191-
if values.found { "converging" } else { "diverging" })
192-
}
193166
ProjectionNameMismatched(ref values) => {
194167
write!(f, "expected {}, found {}",
195168
values.expected,

src/librustc/ty/structural_impls.rs

-7
Original file line numberDiff line numberDiff line change
@@ -296,13 +296,8 @@ impl<'a, 'tcx> Lift<'tcx> for ty::error::TypeError<'a> {
296296
UnsafetyMismatch(x) => UnsafetyMismatch(x),
297297
AbiMismatch(x) => AbiMismatch(x),
298298
Mutability => Mutability,
299-
BoxMutability => BoxMutability,
300-
PtrMutability => PtrMutability,
301-
RefMutability => RefMutability,
302-
VecMutability => VecMutability,
303299
TupleSize(x) => TupleSize(x),
304300
FixedArraySize(x) => FixedArraySize(x),
305-
TyParamSize(x) => TyParamSize(x),
306301
ArgCount => ArgCount,
307302
RegionsDoesNotOutlive(a, b) => {
308303
return tcx.lift(&(a, b)).map(|(a, b)| RegionsDoesNotOutlive(a, b))
@@ -319,14 +314,12 @@ impl<'a, 'tcx> Lift<'tcx> for ty::error::TypeError<'a> {
319314
RegionsOverlyPolymorphic(a, b) => {
320315
return tcx.lift(&b).map(|b| RegionsOverlyPolymorphic(a, b))
321316
}
322-
IntegerAsChar => IntegerAsChar,
323317
IntMismatch(x) => IntMismatch(x),
324318
FloatMismatch(x) => FloatMismatch(x),
325319
Traits(x) => Traits(x),
326320
BuiltinBoundsMismatch(x) => BuiltinBoundsMismatch(x),
327321
VariadicMismatch(x) => VariadicMismatch(x),
328322
CyclicTy => CyclicTy,
329-
ConvergenceMismatch(x) => ConvergenceMismatch(x),
330323
ProjectionNameMismatched(x) => ProjectionNameMismatched(x),
331324
ProjectionBoundsLength(x) => ProjectionBoundsLength(x),
332325

0 commit comments

Comments
 (0)