trait_: associated_trait.clean(cx).map(|bound| {
match bound {
clean::TraitBound(ty) => ty,
- clean::UnboxedFnBound => unimplemented!(),
+ clean::UnboxedFnBound(..) |
clean::RegionBound(..) |
clean::UnknownBound => unreachable!(),
}
#[deriving(Clone, Encodable, Decodable, PartialEq)]
pub enum TyParamBound {
RegionBound(Lifetime),
- UnboxedFnBound, // FIXME
+ UnboxedFnBound(UnboxedFnType),
UnknownBound,
TraitBound(Type)
}
fn clean(&self, cx: &DocContext) -> TyParamBound {
match *self {
ast::RegionTyParamBound(lt) => RegionBound(lt.clean(cx)),
- ast::UnboxedFnTyParamBound(_) => {
- // FIXME(pcwalton): Wrong.
- UnboxedFnBound
- },
+ ast::UnboxedFnTyParamBound(ref ty) => { UnboxedFnBound(ty.clean(cx)) },
ast::TraitTyParamBound(ref t) => TraitBound(t.clean(cx)),
}
}
}
}
+#[deriving(Clone, Encodable, Decodable, PartialEq)]
+pub struct UnboxedFnType {
+ pub path: Path,
+ pub decl: FnDecl
+}
+
+impl Clean<UnboxedFnType> for ast::UnboxedFnBound {
+ fn clean(&self, cx: &DocContext) -> UnboxedFnType {
+ UnboxedFnType {
+ path: self.path.clean(cx),
+ decl: self.decl.clean(cx)
+ }
+ }
+}
+
#[deriving(Clone, Encodable, Decodable, PartialEq)]
pub struct Lifetime(String);
clean::RegionBound(ref lt) => {
write!(f, "{}", *lt)
}
- clean::UnboxedFnBound(..) => {
- write!(f, "Fn(???)") // FIXME
+ clean::UnboxedFnBound(ref ty) => {
+ write!(f, "{}{}", ty.path, ty.decl)
}
clean::UnknownBound => {
write!(f, "'static")
for bound in decl.bounds.iter() {
match *bound {
clean::RegionBound(..) |
- clean::UnboxedFnBound |
+ clean::UnboxedFnBound(..) |
clean::UnknownBound => {}
clean::TraitBound(ref t) => {
if ret.len() == 0 {