Skip to content

Commit d7b53e4

Browse files
committed
---
yaml --- r: 110965 b: refs/heads/snap-stage3 c: 9351c01 h: refs/heads/master i: 110963: cf20f90 v: v3
1 parent 1d992e8 commit d7b53e4

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 296e60be6b027a52de58251848037a92f23a0878
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 0ac532686f0134d28602fdb01d7fe128bc2f498e
4+
refs/heads/snap-stage3: 9351c01b3576f32206b80b32a03b66be66f18b39
55
refs/heads/try: 38201d7c6bf0c32b0e5bdc8ecd63976ebc1b3a4c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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/snap-stage3/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)