Skip to content

Commit 10602f1

Browse files
varkoryodaldevoid
andcommitted
Drive-by cleanup
Co-Authored-By: Gabriel Smith <[email protected]>
1 parent 7f3c6d7 commit 10602f1

File tree

5 files changed

+10
-20
lines changed

5 files changed

+10
-20
lines changed

src/librustc/hir/def.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ pub enum Def {
5252
AssociatedExistential(DefId),
5353
PrimTy(hir::PrimTy),
5454
TyParam(DefId),
55-
ConstParam(DefId),
5655
SelfTy(Option<DefId> /* trait */, Option<DefId> /* impl */),
5756
ToolMod, // e.g., `rustfmt` in `#[rustfmt::skip]`
5857

5958
// Value namespace
6059
Fn(DefId),
6160
Const(DefId),
61+
ConstParam(DefId),
6262
Static(DefId, bool /* is_mutbl */),
6363
StructCtor(DefId, CtorKind), // `DefId` refers to `NodeId` of the struct's constructor
6464
VariantCtor(DefId, CtorKind), // `DefId` refers to the enum variant

src/librustc/hir/pat_util.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,6 @@ impl hir::Pat {
6464
}
6565
}
6666

67-
pub fn is_const(&self) -> bool {
68-
match self.node {
69-
PatKind::Path(hir::QPath::TypeRelative(..)) => true,
70-
PatKind::Path(hir::QPath::Resolved(_, ref path)) => {
71-
match path.def {
72-
Def::Const(..) | Def::AssociatedConst(..) => true,
73-
_ => false
74-
}
75-
}
76-
_ => false
77-
}
78-
}
79-
8067
/// Call `f` on every "binding" in a pattern, e.g., on `a` in
8168
/// `match foo() { Some(a) => (), None => () }`
8269
pub fn each_binding<F>(&self, mut f: F)

src/librustc/middle/reachable.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,11 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
315315
Node::Ty(_) |
316316
Node::MacroDef(_) => {}
317317
_ => {
318-
bug!("found unexpected thingy in worklist: {}",
319-
self.tcx.hir().node_to_string(search_item))
318+
bug!(
319+
"found unexpected node kind in worklist: {} ({:?})",
320+
self.tcx.hir().node_to_string(search_item),
321+
node,
322+
);
320323
}
321324
}
322325
}

src/librustdoc/clean/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,7 @@ impl Clean<GenericParamDef> for hir::GenericParam {
15021502
};
15031503
(name, GenericParamDefKind::Lifetime)
15041504
}
1505-
hir::GenericParamKind::Type { ref default, synthetic, .. } => {
1505+
hir::GenericParamKind::Type { ref default, synthetic } => {
15061506
(self.name.ident().name.clean(cx), GenericParamDefKind::Type {
15071507
did: cx.tcx.hir().local_def_id(self.id),
15081508
bounds: self.bounds.clean(cx),
@@ -2577,7 +2577,7 @@ impl Clean<Type> for hir::Ty {
25772577
let mut j = 0;
25782578
let lifetime = generic_args.args.iter().find_map(|arg| {
25792579
match arg {
2580-
GenericArg::Lifetime(lt) => {
2580+
hir::GenericArg::Lifetime(lt) => {
25812581
if indices.lifetimes == j {
25822582
return Some(lt);
25832583
}
@@ -2602,7 +2602,7 @@ impl Clean<Type> for hir::Ty {
26022602
let mut j = 0;
26032603
let type_ = generic_args.args.iter().find_map(|arg| {
26042604
match arg {
2605-
GenericArg::Type(ty) => {
2605+
hir::GenericArg::Type(ty) => {
26062606
if indices.types == j {
26072607
return Some(ty);
26082608
}

src/librustdoc/core.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ impl<'a, 'tcx, 'rcx> DocContext<'a, 'tcx, 'rcx> {
218218
name: hir::LifetimeName::Param(name),
219219
}));
220220
}
221-
ty::GenericParamDefKind::Type {..} => {
221+
ty::GenericParamDefKind::Type { .. } => {
222222
args.push(hir::GenericArg::Type(self.ty_param_to_ty(param.clone())));
223223
}
224224
}

0 commit comments

Comments
 (0)