Skip to content

Commit

Permalink
Remove unused TypeError variants
Browse files Browse the repository at this point in the history
These weren't flagged by the lint because they were still technically
created somewhere... if you created them before, somehow.
  • Loading branch information
jonas-schievink committed Sep 28, 2016
1 parent dcc8d57 commit 69c3d0a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
27 changes: 0 additions & 27 deletions src/librustc/ty/error.rs
Expand Up @@ -33,28 +33,21 @@ pub enum TypeError<'tcx> {
UnsafetyMismatch(ExpectedFound<hir::Unsafety>),
AbiMismatch(ExpectedFound<abi::Abi>),
Mutability,
BoxMutability,
PtrMutability,
RefMutability,
VecMutability,
TupleSize(ExpectedFound<usize>),
FixedArraySize(ExpectedFound<usize>),
TyParamSize(ExpectedFound<usize>),
ArgCount,
RegionsDoesNotOutlive(&'tcx Region, &'tcx Region),
RegionsNotSame(&'tcx Region, &'tcx Region),
RegionsNoOverlap(&'tcx Region, &'tcx Region),
RegionsInsufficientlyPolymorphic(BoundRegion, &'tcx Region),
RegionsOverlyPolymorphic(BoundRegion, &'tcx Region),
Sorts(ExpectedFound<Ty<'tcx>>),
IntegerAsChar,
IntMismatch(ExpectedFound<ty::IntVarValue>),
FloatMismatch(ExpectedFound<ast::FloatTy>),
Traits(ExpectedFound<DefId>),
BuiltinBoundsMismatch(ExpectedFound<ty::BuiltinBounds>),
VariadicMismatch(ExpectedFound<bool>),
CyclicTy,
ConvergenceMismatch(ExpectedFound<bool>),
ProjectionNameMismatched(ExpectedFound<Name>),
ProjectionBoundsLength(ExpectedFound<usize>),
TyParamDefaultMismatch(ExpectedFound<type_variable::Default<'tcx>>)
Expand Down Expand Up @@ -99,18 +92,6 @@ impl<'tcx> fmt::Display for TypeError<'tcx> {
values.found)
}
Mutability => write!(f, "types differ in mutability"),
BoxMutability => {
write!(f, "boxed types differ in mutability")
}
VecMutability => write!(f, "vectors differ in mutability"),
PtrMutability => write!(f, "pointers differ in mutability"),
RefMutability => write!(f, "references differ in mutability"),
TyParamSize(values) => {
write!(f, "expected a type with {} type params, \
found one with {} type params",
values.expected,
values.found)
}
FixedArraySize(values) => {
write!(f, "expected an array with a fixed size of {} elements, \
found one with {} elements",
Expand Down Expand Up @@ -167,9 +148,6 @@ impl<'tcx> fmt::Display for TypeError<'tcx> {
values.found)
}
}
IntegerAsChar => {
write!(f, "expected an integral type, found `char`")
}
IntMismatch(ref values) => {
write!(f, "expected `{:?}`, found `{:?}`",
values.expected,
Expand All @@ -185,11 +163,6 @@ impl<'tcx> fmt::Display for TypeError<'tcx> {
if values.expected { "variadic" } else { "non-variadic" },
if values.found { "variadic" } else { "non-variadic" })
}
ConvergenceMismatch(ref values) => {
write!(f, "expected {} fn, found {} function",
if values.expected { "converging" } else { "diverging" },
if values.found { "converging" } else { "diverging" })
}
ProjectionNameMismatched(ref values) => {
write!(f, "expected {}, found {}",
values.expected,
Expand Down
7 changes: 0 additions & 7 deletions src/librustc/ty/structural_impls.rs
Expand Up @@ -296,13 +296,8 @@ impl<'a, 'tcx> Lift<'tcx> for ty::error::TypeError<'a> {
UnsafetyMismatch(x) => UnsafetyMismatch(x),
AbiMismatch(x) => AbiMismatch(x),
Mutability => Mutability,
BoxMutability => BoxMutability,
PtrMutability => PtrMutability,
RefMutability => RefMutability,
VecMutability => VecMutability,
TupleSize(x) => TupleSize(x),
FixedArraySize(x) => FixedArraySize(x),
TyParamSize(x) => TyParamSize(x),
ArgCount => ArgCount,
RegionsDoesNotOutlive(a, b) => {
return tcx.lift(&(a, b)).map(|(a, b)| RegionsDoesNotOutlive(a, b))
Expand All @@ -319,14 +314,12 @@ impl<'a, 'tcx> Lift<'tcx> for ty::error::TypeError<'a> {
RegionsOverlyPolymorphic(a, b) => {
return tcx.lift(&b).map(|b| RegionsOverlyPolymorphic(a, b))
}
IntegerAsChar => IntegerAsChar,
IntMismatch(x) => IntMismatch(x),
FloatMismatch(x) => FloatMismatch(x),
Traits(x) => Traits(x),
BuiltinBoundsMismatch(x) => BuiltinBoundsMismatch(x),
VariadicMismatch(x) => VariadicMismatch(x),
CyclicTy => CyclicTy,
ConvergenceMismatch(x) => ConvergenceMismatch(x),
ProjectionNameMismatched(x) => ProjectionNameMismatched(x),
ProjectionBoundsLength(x) => ProjectionBoundsLength(x),

Expand Down

0 comments on commit 69c3d0a

Please sign in to comment.