Skip to content

Commit 3bd4475

Browse files
committed
rustdoc: Remove dummy UnknownBound variant
1 parent 7be2057 commit 3bd4475

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

src/librustdoc/clean/inline.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,7 @@ fn build_impl(cx: &DocContext, tcx: &ty::ctxt,
325325
match bound {
326326
clean::TraitBound(ty) => ty,
327327
clean::UnboxedFnBound(..) |
328-
clean::RegionBound(..) |
329-
clean::UnknownBound => unreachable!(),
328+
clean::RegionBound(..) => unreachable!(),
330329
}
331330
}),
332331
for_: ty.ty.clean(cx),

src/librustdoc/clean/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,6 @@ impl Clean<TyParam> for ty::TypeParameterDef {
475475
pub enum TyParamBound {
476476
RegionBound(Lifetime),
477477
UnboxedFnBound(UnboxedFnType),
478-
UnknownBound,
479478
TraitBound(Type)
480479
}
481480

@@ -521,7 +520,7 @@ impl Clean<TyParamBound> for ty::BuiltinBound {
521520
fn clean(&self, cx: &DocContext) -> TyParamBound {
522521
let tcx = match cx.tcx_opt() {
523522
Some(tcx) => tcx,
524-
None => return UnknownBound
523+
None => return RegionBound(Lifetime::statik())
525524
};
526525
let empty = subst::Substs::empty();
527526
let (did, path) = match *self {
@@ -554,7 +553,7 @@ impl Clean<TyParamBound> for ty::TraitRef {
554553
fn clean(&self, cx: &DocContext) -> TyParamBound {
555554
let tcx = match cx.tcx_opt() {
556555
Some(tcx) => tcx,
557-
None => return UnknownBound
556+
None => return RegionBound(Lifetime::statik())
558557
};
559558
let fqn = csearch::get_item_path(tcx, self.def_id);
560559
let fqn = fqn.into_iter().map(|i| i.to_string())

src/librustdoc/html/format.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,6 @@ impl fmt::Show for clean::TyParamBound {
146146
clean::UnboxedFnBound(ref ty) => {
147147
write!(f, "{}{}", ty.path, ty.decl)
148148
}
149-
clean::UnknownBound => {
150-
write!(f, "'static")
151-
}
152149
clean::TraitBound(ref ty) => {
153150
write!(f, "{}", *ty)
154151
}
@@ -408,8 +405,7 @@ impl fmt::Show for clean::Type {
408405
for bound in decl.bounds.iter() {
409406
match *bound {
410407
clean::RegionBound(..) |
411-
clean::UnboxedFnBound(..) |
412-
clean::UnknownBound => {}
408+
clean::UnboxedFnBound(..) => {}
413409
clean::TraitBound(ref t) => {
414410
if ret.len() == 0 {
415411
ret.push_str(": ");

0 commit comments

Comments
 (0)