Skip to content

Commit 7ecff52

Browse files
committed
---
yaml --- r: 150751 b: refs/heads/try2 c: 9351c01 h: refs/heads/master i: 150749: 0b2363d 150747: 32d6bea 150743: accd76f 150735: ee6a659 150719: 2681098 v: v3
1 parent 9e85959 commit 7ecff52

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 0ac532686f0134d28602fdb01d7fe128bc2f498e
8+
refs/heads/try2: 9351c01b3576f32206b80b32a03b66be66f18b39
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustdoc/clean.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,6 @@ impl Clean<Item> for doctree::Function {
474474

475475
#[deriving(Clone, Encodable, Decodable)]
476476
pub struct ClosureDecl {
477-
pub sigil: ast::Sigil,
478-
pub region: Option<Lifetime>,
479477
pub lifetimes: Vec<Lifetime>,
480478
pub decl: FnDecl,
481479
pub onceness: ast::Onceness,
@@ -486,8 +484,6 @@ pub struct ClosureDecl {
486484
impl Clean<ClosureDecl> for ast::ClosureTy {
487485
fn clean(&self) -> ClosureDecl {
488486
ClosureDecl {
489-
sigil: self.sigil,
490-
region: self.region.clean(),
491487
lifetimes: self.lifetimes.clean().move_iter().collect(),
492488
decl: self.decl.clean(),
493489
onceness: self.onceness,
@@ -652,7 +648,8 @@ pub enum Type {
652648
Self(ast::NodeId),
653649
/// Primitives are just the fixed-size numeric types (plus int/uint/float), and char.
654650
Primitive(ast::PrimTy),
655-
Closure(~ClosureDecl),
651+
Closure(~ClosureDecl, Option<Lifetime>),
652+
Proc(~ClosureDecl),
656653
/// extern "ABI" fn
657654
BareFunction(~BareFunctionDecl),
658655
Tuple(Vec<Type> ),
@@ -706,7 +703,8 @@ impl Clean<Type> for ast::Ty {
706703
tpbs.clean().map(|x| x.move_iter().collect()),
707704
id)
708705
}
709-
TyClosure(ref c) => Closure(~c.clean()),
706+
TyClosure(ref c, region) => Closure(~c.clean(), region.clean()),
707+
TyProc(ref c) => Proc(~c.clean()),
710708
TyBareFn(ref barefn) => BareFunction(~barefn.clean()),
711709
TyBot => Bottom,
712710
ref x => fail!("Unimplemented type {:?}", x),

branches/try2/src/librustdoc/html/format.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -337,19 +337,24 @@ impl fmt::Show for clean::Type {
337337
};
338338
f.buf.write(s.as_bytes())
339339
}
340-
clean::Closure(ref decl) => {
341-
let region = match decl.region {
340+
clean::Closure(ref decl, ref region) => {
341+
let region = match *region {
342342
Some(ref region) => format!("{} ", *region),
343343
None => ~"",
344344
};
345345

346-
write!(f.buf, "{}{}{arrow, select, yes{ -&gt; {ret}} other{}}",
346+
write!(f.buf, "{}{}|{}|{arrow, select, yes{ -&gt; {ret}} other{}}",
347347
FnStyleSpace(decl.fn_style),
348-
match decl.sigil {
349-
ast::OwnedSigil => format!("proc({})", decl.decl.inputs),
350-
ast::BorrowedSigil => format!("{}|{}|", region, decl.decl.inputs),
351-
ast::ManagedSigil => format!("@{}fn({})", region, decl.decl.inputs),
352-
},
348+
region,
349+
decl.decl.inputs,
350+
arrow = match decl.decl.output { clean::Unit => "no", _ => "yes" },
351+
ret = decl.decl.output)
352+
// FIXME: where are bounds and lifetimes printed?!
353+
}
354+
clean::Proc(ref decl) => {
355+
write!(f.buf, "{}proc({}){arrow, select, yes{ -&gt; {ret}} other{}}",
356+
FnStyleSpace(decl.fn_style),
357+
decl.decl.inputs,
353358
arrow = match decl.decl.output { clean::Unit => "no", _ => "yes" },
354359
ret = decl.decl.output)
355360
// FIXME: where are bounds and lifetimes printed?!

0 commit comments

Comments
 (0)