rustdoc: Support unboxed fn sugar in bounds
This commit is contained in:
parent
2f955c73d6
commit
7be20574e0
3 changed files with 21 additions and 9 deletions
|
@ -474,7 +474,7 @@ impl Clean<TyParam> for ty::TypeParameterDef {
|
|||
#[deriving(Clone, Encodable, Decodable, PartialEq)]
|
||||
pub enum TyParamBound {
|
||||
RegionBound(Lifetime),
|
||||
UnboxedFnBound, // FIXME
|
||||
UnboxedFnBound(UnboxedFnType),
|
||||
UnknownBound,
|
||||
TraitBound(Type)
|
||||
}
|
||||
|
@ -483,10 +483,7 @@ impl Clean<TyParamBound> for ast::TyParamBound {
|
|||
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)),
|
||||
}
|
||||
}
|
||||
|
@ -598,6 +595,21 @@ impl Clean<Option<Vec<TyParamBound>>> for subst::Substs {
|
|||
}
|
||||
}
|
||||
|
||||
#[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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue