Skip to content

Commit 072a896

Browse files
committed
rustdoc: Remove traces of old closures
1 parent 8a69d35 commit 072a896

File tree

2 files changed

+0
-78
lines changed

2 files changed

+0
-78
lines changed

src/librustdoc/clean/mod.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,27 +1055,6 @@ impl Clean<Item> for doctree::Function {
10551055
}
10561056
}
10571057

1058-
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Show)]
1059-
pub struct ClosureDecl {
1060-
pub lifetimes: Vec<Lifetime>,
1061-
pub decl: FnDecl,
1062-
pub onceness: ast::Onceness,
1063-
pub unsafety: ast::Unsafety,
1064-
pub bounds: Vec<TyParamBound>,
1065-
}
1066-
1067-
impl Clean<ClosureDecl> for ast::ClosureTy {
1068-
fn clean(&self, cx: &DocContext) -> ClosureDecl {
1069-
ClosureDecl {
1070-
lifetimes: self.lifetimes.clean(cx),
1071-
decl: self.decl.clean(cx),
1072-
onceness: self.onceness,
1073-
unsafety: self.unsafety,
1074-
bounds: self.bounds.clean(cx)
1075-
}
1076-
}
1077-
}
1078-
10791058
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Show)]
10801059
pub struct FnDecl {
10811060
pub inputs: Arguments,
@@ -1352,8 +1331,6 @@ pub enum Type {
13521331
Generic(String),
13531332
/// Primitives are just the fixed-size numeric types (plus int/uint/float), and char.
13541333
Primitive(PrimitiveType),
1355-
Closure(Box<ClosureDecl>),
1356-
Proc(Box<ClosureDecl>),
13571334
/// extern "ABI" fn
13581335
BareFunction(Box<BareFunctionDecl>),
13591336
Tuple(Vec<Type>),

src/librustdoc/html/format.rs

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -465,61 +465,6 @@ impl fmt::String for clean::Type {
465465
}
466466
clean::Infer => write!(f, "_"),
467467
clean::Primitive(prim) => primitive_link(f, prim, prim.to_string()),
468-
clean::Closure(ref decl) => {
469-
write!(f, "{style}{lifetimes}|{args}|{bounds}{arrow}",
470-
style = UnsafetySpace(decl.unsafety),
471-
lifetimes = if decl.lifetimes.len() == 0 {
472-
"".to_string()
473-
} else {
474-
format!("for &lt;{}&gt;",
475-
CommaSep(decl.lifetimes.as_slice()))
476-
},
477-
args = decl.decl.inputs,
478-
arrow = decl.decl.output,
479-
bounds = {
480-
let mut ret = String::new();
481-
for bound in decl.bounds.iter() {
482-
match *bound {
483-
clean::RegionBound(..) => {}
484-
clean::TraitBound(ref t, modifier) => {
485-
if ret.len() == 0 {
486-
ret.push_str(": ");
487-
} else {
488-
ret.push_str(" + ");
489-
}
490-
if modifier == ast::TraitBoundModifier::Maybe {
491-
ret.push_str("?");
492-
}
493-
ret.push_str(format!("{}",
494-
*t).as_slice());
495-
}
496-
}
497-
}
498-
ret
499-
})
500-
}
501-
clean::Proc(ref decl) => {
502-
write!(f, "{style}{lifetimes}proc({args}){bounds}{arrow}",
503-
style = UnsafetySpace(decl.unsafety),
504-
lifetimes = if decl.lifetimes.len() == 0 {
505-
"".to_string()
506-
} else {
507-
format!("for &lt;{}&gt;",
508-
CommaSep(decl.lifetimes.as_slice()))
509-
},
510-
args = decl.decl.inputs,
511-
bounds = if decl.bounds.len() == 0 {
512-
"".to_string()
513-
} else {
514-
let m = decl.bounds
515-
.iter()
516-
.map(|s| s.to_string());
517-
format!(
518-
": {}",
519-
m.collect::<Vec<String>>().connect(" + "))
520-
},
521-
arrow = decl.decl.output)
522-
}
523468
clean::BareFunction(ref decl) => {
524469
write!(f, "{}{}fn{}{}",
525470
UnsafetySpace(decl.unsafety),

0 commit comments

Comments
 (0)