Skip to content

Commit 598350c

Browse files
committed
Fix tidy errors
1 parent 286a502 commit 598350c

File tree

10 files changed

+33
-15
lines changed

10 files changed

+33
-15
lines changed

src/librustc/infer/freshen.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for TypeFreshener<'a, 'gcx, 'tcx> {
200200
ty::TyAnon(..) => {
201201
t.super_fold_with(self)
202202
}
203-
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => bug!("Unexpected TyUnusedParam in TypeFreshener"),
203+
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => {
204+
bug!("Unexpected {:?} in TypeFreshener", t);
205+
}
204206
}
205207
}
206208
}

src/librustc/traits/error_reporting.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
264264
ty::TyForeign(..) => Some(19),
265265
ty::TyGeneratorWitness(..) => Some(20),
266266
ty::TyInfer(..) | ty::TyError => None,
267-
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => bug!("unexpected TyUnusedParam in fuzzy_match_tys"),
267+
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => {
268+
bug!("unexpected {:?} in fuzzy_match_tys", t);
269+
}
268270
}
269271
}
270272

src/librustc/traits/select.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2037,7 +2037,8 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
20372037
))
20382038
}
20392039

2040-
ty::TyProjection(_) | ty::TyParam(_) | ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) | ty::TyAnon(..) => None,
2040+
ty::TyProjection(_) | ty::TyParam(_) | ty::TyUnusedParam |
2041+
ty::TyLayoutOnlyParam(_, _) | ty::TyAnon(..) => None,
20412042
ty::TyInfer(ty::TyVar(_)) => Ambiguous,
20422043

20432044
ty::TyInfer(ty::CanonicalTy(_)) |
@@ -2114,7 +2115,9 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
21142115
bug!("asked to assemble builtin bounds of unexpected type: {:?}",
21152116
self_ty);
21162117
}
2117-
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => bug!("Unexpected TyUnusedParam in copy_clone_conditions"),
2118+
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => {
2119+
bug!("Unexpected {:?} in copy_clone_conditions", self_ty);
2120+
}
21182121
}
21192122
}
21202123

src/librustc/ty/flags.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ impl FlagComputation {
190190
&ty::TyFnPtr(f) => {
191191
self.add_fn_sig(f);
192192
}
193-
&ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => bug!("Unexpected TyUnusedParam in FlagComputation::for_sty"),
193+
&ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => {
194+
bug!("Unexpected {:?} in FlagComputation::for_sty", st);
195+
}
194196
}
195197
}
196198

src/librustc/ty/layout.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,7 +1712,8 @@ impl<'a, 'tcx> LayoutCx<'tcx, TyCtxt<'a, 'tcx, 'tcx>> {
17121712
ty::TyParam(_) => {
17131713
return Err(LayoutError::Unknown(ty));
17141714
}
1715-
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) | ty::TyGeneratorWitness(..) | ty::TyInfer(_) | ty::TyError => {
1715+
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) | ty::TyGeneratorWitness(..) |
1716+
ty::TyInfer(_) | ty::TyError => {
17161717
bug!("LayoutDetails::compute: unexpected type `{}`", ty)
17171718
}
17181719
})
@@ -2287,8 +2288,8 @@ impl<'a, 'tcx> TyLayout<'tcx> {
22872288
}
22882289
}
22892290

2290-
ty::TyProjection(_) | ty::TyAnon(..) | ty::TyParam(_) | ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) |
2291-
ty::TyInfer(_) | ty::TyError => {
2291+
ty::TyProjection(_) | ty::TyAnon(..) | ty::TyParam(_) | ty::TyUnusedParam |
2292+
ty::TyLayoutOnlyParam(_, _) | ty::TyInfer(_) | ty::TyError => {
22922293
bug!("TyLayout::field_type: unexpected type `{}`", self.ty)
22932294
}
22942295
})

src/librustc/ty/outlives.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
167167
self.compute_components(subty, out);
168168
}
169169
}
170-
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => bug!("Unexpected TyUnusedParam in compute_components"),
170+
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => {
171+
bug!("Unexpected TyUnusedParam in compute_components");
172+
}
171173
}
172174
}
173175

src/librustc/ty/structural_impls.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,8 @@ impl<'tcx> TypeFoldable<'tcx> for Ty<'tcx> {
865865
ty::TyAnon(did, substs) => ty::TyAnon(did, substs.fold_with(folder)),
866866
ty::TyBool | ty::TyChar | ty::TyStr | ty::TyInt(_) |
867867
ty::TyUint(_) | ty::TyFloat(_) | ty::TyError | ty::TyInfer(_) |
868-
ty::TyParam(..) | ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) | ty::TyNever | ty::TyForeign(..) => return self
868+
ty::TyParam(..) | ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) |
869+
ty::TyNever | ty::TyForeign(..) => return self
869870
};
870871

871872
if self.sty == sty {
@@ -900,7 +901,8 @@ impl<'tcx> TypeFoldable<'tcx> for Ty<'tcx> {
900901
ty::TyAnon(_, ref substs) => substs.visit_with(visitor),
901902
ty::TyBool | ty::TyChar | ty::TyStr | ty::TyInt(_) |
902903
ty::TyUint(_) | ty::TyFloat(_) | ty::TyError | ty::TyInfer(_) |
903-
ty::TyParam(..) | ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) | ty::TyNever | ty::TyForeign(..) => false,
904+
ty::TyParam(..) | ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) |
905+
ty::TyNever | ty::TyForeign(..) => false,
904906
}
905907
}
906908

src/librustc/ty/util.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,9 @@ fn needs_drop_raw<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
11261126
|variant| variant.fields.iter().any(
11271127
|field| needs_drop(field.ty(tcx, substs)))),
11281128

1129-
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => bug!("Unexpected TyUnusedParam in needs_drop_raw"),
1129+
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => {
1130+
bug!("Unexpected type {:?} in needs_drop_raw", ty);
1131+
}
11301132
}
11311133
}
11321134

src/librustc/ty/walk.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ pub fn walk_shallow<'tcx>(ty: Ty<'tcx>) -> AccIntoIter<TypeWalkerArray<'tcx>> {
8282
fn push_subtypes<'tcx>(stack: &mut TypeWalkerStack<'tcx>, parent_ty: Ty<'tcx>) {
8383
match parent_ty.sty {
8484
ty::TyBool | ty::TyChar | ty::TyInt(_) | ty::TyUint(_) | ty::TyFloat(_) |
85-
ty::TyStr | ty::TyInfer(_) | ty::TyParam(_) | ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) | ty::TyNever |
86-
ty::TyError | ty::TyForeign(..) => {
85+
ty::TyStr | ty::TyInfer(_) | ty::TyParam(_) | ty::TyUnusedParam |
86+
ty::TyLayoutOnlyParam(_, _) | ty::TyNever | ty::TyError | ty::TyForeign(..) => {
8787
}
8888
ty::TyArray(ty, len) => {
8989
push_const(stack, len);

src/librustc_typeck/check/cast.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
137137
span, &format!("`{:?}` should be sized but is not?", t));
138138
return Err(ErrorReported);
139139
}
140-
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => bug!("Unexpected TyUnusedParam in FnCtxt::pointer_kind"),
140+
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => {
141+
bug!("Unexpected {:?} in FnCtxt::pointer_kind", t);
142+
}
141143
})
142144
}
143145
}

0 commit comments

Comments
 (0)