Skip to content

Commit 1b1f973

Browse files
committed
---
yaml --- r: 83442 b: refs/heads/try c: e7fa081 h: refs/heads/master v: v3
1 parent a8da763 commit 1b1f973

File tree

3 files changed

+17
-23
lines changed

3 files changed

+17
-23
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0e4d1fc8cae42e15e00f71d9f439b01bb25a86ae
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
5-
refs/heads/try: f648690234ddbf4a8f91b7997a13ce72a8b36958
5+
refs/heads/try: e7fa081c18880a78c968a402367289a550bd5cb1
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustdoc/clean.rs

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,7 @@ impl Clean<Item> for doctree::Trait {
471471

472472
impl Clean<Type> for ast::trait_ref {
473473
fn clean(&self) -> Type {
474-
let t = Unresolved(self.path.clean(), None, self.ref_id);
475-
resolve_type(&t)
474+
resolve_type(self.path.clean(), None, self.ref_id)
476475
}
477476
}
478477

@@ -517,9 +516,6 @@ impl Clean<TraitMethod> for ast::trait_method {
517516
/// it does not preserve mutability or boxes.
518517
#[deriving(Clone, Encodable, Decodable)]
519518
pub enum Type {
520-
/// Most types start out as "Unresolved". It serves as an intermediate stage between cleaning
521-
/// and type resolution.
522-
Unresolved(Path, Option<~[TyParamBound]>, ast::NodeId),
523519
/// structs/enums/traits (anything that'd be an ast::ty_path)
524520
ResolvedPath { path: Path, typarams: Option<~[TyParamBound]>, id: ast::NodeId },
525521
/// Reference to an item in an external crate (fully qualified path)
@@ -558,25 +554,25 @@ impl Clean<Type> for ast::Ty {
558554
debug!("cleaning type `%?`", self);
559555
let codemap = local_data::get(super::ctxtkey, |x| *x.unwrap()).sess.codemap;
560556
debug!("span corresponds to `%s`", codemap.span_to_str(self.span));
561-
let t = match self.node {
557+
match self.node {
562558
ty_nil => Unit,
563-
ty_ptr(ref m) => RawPointer(m.mutbl.clean(), ~resolve_type(&m.ty.clean())),
559+
ty_ptr(ref m) => RawPointer(m.mutbl.clean(), ~m.ty.clean()),
564560
ty_rptr(ref l, ref m) =>
565561
BorrowedRef {lifetime: l.clean(), mutability: m.mutbl.clean(),
566-
type_: ~resolve_type(&m.ty.clean())},
567-
ty_box(ref m) => Managed(m.mutbl.clean(), ~resolve_type(&m.ty.clean())),
568-
ty_uniq(ref m) => Unique(~resolve_type(&m.ty.clean())),
569-
ty_vec(ref m) => Vector(~resolve_type(&m.ty.clean())),
570-
ty_fixed_length_vec(ref m, ref e) => FixedVector(~resolve_type(&m.ty.clean()),
562+
type_: ~m.ty.clean()},
563+
ty_box(ref m) => Managed(m.mutbl.clean(), ~m.ty.clean()),
564+
ty_uniq(ref m) => Unique(~m.ty.clean()),
565+
ty_vec(ref m) => Vector(~m.ty.clean()),
566+
ty_fixed_length_vec(ref m, ref e) => FixedVector(~m.ty.clean(),
571567
e.span.to_src()),
572-
ty_tup(ref tys) => Tuple(tys.iter().map(|x| resolve_type(&x.clean())).collect()),
573-
ty_path(ref p, ref tpbs, id) => Unresolved(p.clean(), tpbs.clean(), id),
568+
ty_tup(ref tys) => Tuple(tys.iter().map(|x| x.clean()).collect()),
569+
ty_path(ref p, ref tpbs, id) =>
570+
resolve_type(p.clean(), tpbs.clean(), id),
574571
ty_closure(ref c) => Closure(~c.clean()),
575572
ty_bare_fn(ref barefn) => BareFunction(~barefn.clean()),
576573
ty_bot => Bottom,
577574
ref x => fail!("Unimplemented type %?", x),
578-
};
579-
resolve_type(&t)
575+
}
580576
}
581577
}
582578

@@ -1039,14 +1035,10 @@ fn remove_comment_tags(s: &str) -> ~str {
10391035
}
10401036

10411037
/// Given a Type, resolve it using the def_map
1042-
fn resolve_type(t: &Type) -> Type {
1038+
fn resolve_type(path: Path, tpbs: Option<~[TyParamBound]>,
1039+
id: ast::NodeId) -> Type {
10431040
use syntax::ast::*;
10441041

1045-
let (path, tpbs, id) = match t {
1046-
&Unresolved(ref path, ref tbps, id) => (path, tbps, id),
1047-
_ => return (*t).clone(),
1048-
};
1049-
10501042
let dm = local_data::get(super::ctxtkey, |x| *x.unwrap()).tycx.def_map;
10511043
debug!("searching for %? in defmap", id);
10521044
let d = match dm.find(&id) {

branches/try/src/librustdoc/passes.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
use std::num;
1212
use std::uint;
1313

14+
use syntax::ast;
15+
1416
use clean;
1517
use clean::Item;
1618
use plugins;

0 commit comments

Comments
 (0)