Skip to content

Commit

Permalink
rustdoc: Remove dummy UnknownBound variant
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjakubowski committed Oct 6, 2014
1 parent 7be2057 commit 3bd4475
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/librustdoc/clean/inline.rs
Expand Up @@ -325,8 +325,7 @@ fn build_impl(cx: &DocContext, tcx: &ty::ctxt,
match bound {
clean::TraitBound(ty) => ty,
clean::UnboxedFnBound(..) |
clean::RegionBound(..) |
clean::UnknownBound => unreachable!(),
clean::RegionBound(..) => unreachable!(),
}
}),
for_: ty.ty.clean(cx),
Expand Down
5 changes: 2 additions & 3 deletions src/librustdoc/clean/mod.rs
Expand Up @@ -475,7 +475,6 @@ impl Clean<TyParam> for ty::TypeParameterDef {
pub enum TyParamBound {
RegionBound(Lifetime),
UnboxedFnBound(UnboxedFnType),
UnknownBound,
TraitBound(Type)
}

Expand Down Expand Up @@ -521,7 +520,7 @@ impl Clean<TyParamBound> for ty::BuiltinBound {
fn clean(&self, cx: &DocContext) -> TyParamBound {
let tcx = match cx.tcx_opt() {
Some(tcx) => tcx,
None => return UnknownBound
None => return RegionBound(Lifetime::statik())
};
let empty = subst::Substs::empty();
let (did, path) = match *self {
Expand Down Expand Up @@ -554,7 +553,7 @@ impl Clean<TyParamBound> for ty::TraitRef {
fn clean(&self, cx: &DocContext) -> TyParamBound {
let tcx = match cx.tcx_opt() {
Some(tcx) => tcx,
None => return UnknownBound
None => return RegionBound(Lifetime::statik())
};
let fqn = csearch::get_item_path(tcx, self.def_id);
let fqn = fqn.into_iter().map(|i| i.to_string())
Expand Down
6 changes: 1 addition & 5 deletions src/librustdoc/html/format.rs
Expand Up @@ -146,9 +146,6 @@ impl fmt::Show for clean::TyParamBound {
clean::UnboxedFnBound(ref ty) => {
write!(f, "{}{}", ty.path, ty.decl)
}
clean::UnknownBound => {
write!(f, "'static")
}
clean::TraitBound(ref ty) => {
write!(f, "{}", *ty)
}
Expand Down Expand Up @@ -408,8 +405,7 @@ impl fmt::Show for clean::Type {
for bound in decl.bounds.iter() {
match *bound {
clean::RegionBound(..) |
clean::UnboxedFnBound(..) |
clean::UnknownBound => {}
clean::UnboxedFnBound(..) => {}
clean::TraitBound(ref t) => {
if ret.len() == 0 {
ret.push_str(": ");
Expand Down

0 comments on commit 3bd4475

Please sign in to comment.