Skip to content

Commit 66fac68

Browse files
committed
---
yaml --- r: 96764 b: refs/heads/dist-snap c: 8b5a317 h: refs/heads/master v: v3
1 parent 9abccbb commit 66fac68

File tree

14 files changed

+113
-138
lines changed

14 files changed

+113
-138
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: d5798b3902c4af50bf0f24e1c4bbf5e4a4dcc6ca
9+
refs/heads/dist-snap: 8b5a317d48eb26c3af875a409e4a16587aec7544
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/doc/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ extern mod extra; // equivalent to: extern mod extra = "extra";
790790
791791
extern mod rustextra = "extra"; // linking to 'extra' under another name
792792
793-
extern mod foo = "some/where/rust-foo#foo:1.0"; // a full package ID for rustpkg
793+
extern mod foo = "some/where/foo#1.0"; // a full package ID for rustpkg
794794
~~~~
795795

796796
##### Use declarations

branches/dist-snap/src/librustc/middle/typeck/astconv.rs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,6 @@ pub static NO_TPS: uint = 2;
282282
pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>(
283283
this: &AC, rscope: &RS, ast_ty: &ast::Ty) -> ty::t {
284284

285-
fn ast_ty_to_mt<AC:AstConv, RS:RegionScope>(
286-
this: &AC, rscope: &RS, ty: &ast::Ty) -> ty::mt {
287-
288-
ty::mt {ty: ast_ty_to_ty(this, rscope, ty), mutbl: ast::MutImmutable}
289-
}
290-
291285
fn ast_mt_to_mt<AC:AstConv, RS:RegionScope>(
292286
this: &AC, rscope: &RS, mt: &ast::mt) -> ty::mt {
293287

@@ -309,8 +303,8 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>(
309303
debug!("mk_pointer(vst={:?})", vst);
310304

311305
match a_seq_ty.ty.node {
312-
ast::ty_vec(ty) => {
313-
let mut mt = ast_ty_to_mt(this, rscope, ty);
306+
ast::ty_vec(ref mt) => {
307+
let mut mt = ast_mt_to_mt(this, rscope, mt);
314308
if a_seq_ty.mutbl == ast::MutMutable {
315309
mt = ty::mt { ty: mt.ty, mutbl: a_seq_ty.mutbl };
316310
}
@@ -400,15 +394,14 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>(
400394
mk_pointer(this, rscope, mt, ty::vstore_box,
401395
|tmt| ty::mk_box(tcx, tmt))
402396
}
403-
ast::ty_uniq(ty) => {
404-
let mt = ast::mt { ty: ty, mutbl: ast::MutImmutable };
405-
mk_pointer(this, rscope, &mt, ty::vstore_uniq,
397+
ast::ty_uniq(ref mt) => {
398+
mk_pointer(this, rscope, mt, ty::vstore_uniq,
406399
|tmt| ty::mk_uniq(tcx, tmt))
407400
}
408-
ast::ty_vec(ty) => {
401+
ast::ty_vec(ref mt) => {
409402
tcx.sess.span_err(ast_ty.span, "bare `[]` is not a type");
410403
// return /something/ so they can at least get more errors
411-
ty::mk_evec(tcx, ast_ty_to_mt(this, rscope, ty), ty::vstore_uniq)
404+
ty::mk_evec(tcx, ast_mt_to_mt(this, rscope, mt), ty::vstore_uniq)
412405
}
413406
ast::ty_ptr(ref mt) => {
414407
ty::mk_ptr(tcx, ast_mt_to_mt(this, rscope, mt))
@@ -539,15 +532,15 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>(
539532
}
540533
}
541534
}
542-
ast::ty_fixed_length_vec(ty, e) => {
535+
ast::ty_fixed_length_vec(ref a_mt, e) => {
543536
match const_eval::eval_const_expr_partial(&tcx, e) {
544537
Ok(ref r) => {
545538
match *r {
546539
const_eval::const_int(i) =>
547-
ty::mk_evec(tcx, ast_ty_to_mt(this, rscope, ty),
540+
ty::mk_evec(tcx, ast_mt_to_mt(this, rscope, a_mt),
548541
ty::vstore_fixed(i as uint)),
549542
const_eval::const_uint(i) =>
550-
ty::mk_evec(tcx, ast_ty_to_mt(this, rscope, ty),
543+
ty::mk_evec(tcx, ast_mt_to_mt(this, rscope, a_mt),
551544
ty::vstore_fixed(i as uint)),
552545
_ => {
553546
tcx.sess.span_fatal(

branches/dist-snap/src/librustdoc/clean.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -621,10 +621,10 @@ impl Clean<Type> for ast::Ty {
621621
BorrowedRef {lifetime: l.clean(), mutability: m.mutbl.clean(),
622622
type_: ~m.ty.clean()},
623623
ty_box(ref m) => Managed(m.mutbl.clean(), ~m.ty.clean()),
624-
ty_uniq(ty) => Unique(~ty.clean()),
625-
ty_vec(ty) => Vector(~ty.clean()),
626-
ty_fixed_length_vec(ty, ref e) => FixedVector(~ty.clean(),
627-
e.span.to_src()),
624+
ty_uniq(ref m) => Unique(~m.ty.clean()),
625+
ty_vec(ref m) => Vector(~m.ty.clean()),
626+
ty_fixed_length_vec(ref m, ref e) => FixedVector(~m.ty.clean(),
627+
e.span.to_src()),
628628
ty_tup(ref tys) => Tuple(tys.iter().map(|x| x.clean()).collect()),
629629
ty_path(ref p, ref tpbs, id) =>
630630
resolve_type(p.clean(), tpbs.clean(), id),

branches/dist-snap/src/librustdoc/html/render.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,13 @@ impl Context {
648648
self.root_path.push_str("../");
649649
self.current.push(s);
650650

651+
info!("Recursing into {}", self.dst.display());
652+
651653
mkdir(&self.dst);
652654
let ret = f(self);
653655

656+
info!("Recursed; leaving {}", self.dst.display());
657+
654658
// Go back to where we were at
655659
self.dst = prev;
656660
let len = self.root_path.len();
@@ -674,23 +678,18 @@ impl Context {
674678
// using a rwarc makes this parallelizable in the future
675679
local_data::set(cache_key, Arc::new(cache));
676680

677-
let mut work = ~[item];
678-
while work.len() > 0 {
679-
let item = work.pop();
680-
self.item(item, |_cx, item| {
681-
work.push(item);
682-
})
683-
}
681+
self.item(item);
684682
}
685683

686684
/// Non-parellelized version of rendering an item. This will take the input
687685
/// item, render its contents, and then invoke the specified closure with
688686
/// all sub-items which need to be rendered.
689687
///
690688
/// The rendering driver uses this closure to queue up more work.
691-
fn item(&mut self, item: clean::Item, f: |&mut Context, clean::Item|) {
689+
fn item(&mut self, item: clean::Item) {
692690
fn render(w: io::File, cx: &mut Context, it: &clean::Item,
693691
pushname: bool) {
692+
info!("Rendering an item to {}", w.path().display());
694693
// A little unfortunate that this is done like this, but it sure
695694
// does make formatting *a lot* nicer.
696695
local_data::set(current_location_key, cx.current.clone());
@@ -734,7 +733,7 @@ impl Context {
734733
};
735734
this.sidebar = build_sidebar(&m);
736735
for item in m.items.move_iter() {
737-
f(this, item);
736+
this.item(item);
738737
}
739738
})
740739
}

branches/dist-snap/src/libstd/vec.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2673,9 +2673,11 @@ impl<T> DoubleEndedIterator<T> for MoveIterator<T> {
26732673
#[unsafe_destructor]
26742674
impl<T> Drop for MoveIterator<T> {
26752675
fn drop(&mut self) {
2676-
// destroy the remaining elements
2677-
for _x in *self {}
26782676
unsafe {
2677+
// destroy the remaining elements
2678+
for x in self.iter {
2679+
ptr::read_ptr(x);
2680+
}
26792681
if owns_managed::<T>() {
26802682
local_free(self.allocation as *u8 as *c_char)
26812683
} else {

branches/dist-snap/src/libsyntax/ast.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -875,9 +875,9 @@ pub enum ty_ {
875875
ty_nil,
876876
ty_bot, /* bottom type */
877877
ty_box(mt),
878-
ty_uniq(P<Ty>),
879-
ty_vec(P<Ty>),
880-
ty_fixed_length_vec(P<Ty>, @Expr),
878+
ty_uniq(mt),
879+
ty_vec(mt),
880+
ty_fixed_length_vec(mt, @Expr),
881881
ty_ptr(mt),
882882
ty_rptr(Option<Lifetime>, mt),
883883
ty_closure(@TyClosure),

branches/dist-snap/src/libsyntax/ext/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ impl AstBuilder for @ExtCtxt {
312312
ast::ty_rptr(lifetime, self.ty_mt(ty, mutbl)))
313313
}
314314
fn ty_uniq(&self, span: Span, ty: P<ast::Ty>) -> P<ast::Ty> {
315-
self.ty(span, ast::ty_uniq(ty))
315+
self.ty(span, ast::ty_uniq(self.ty_mt(ty, ast::MutImmutable)))
316316
}
317317
fn ty_box(&self, span: Span,
318318
ty: P<ast::Ty>, mutbl: ast::Mutability) -> P<ast::Ty> {

branches/dist-snap/src/libsyntax/ext/format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ impl Context {
593593
~[]
594594
), None);
595595
let ty = ast::ty_fixed_length_vec(
596-
piece_ty,
596+
self.ecx.ty_mt(piece_ty, ast::MutImmutable),
597597
self.ecx.expr_uint(self.fmtsp, self.pieces.len())
598598
);
599599
let ty = self.ecx.ty(self.fmtsp, ty);

branches/dist-snap/src/libsyntax/fold.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ pub trait ast_fold {
241241
let node = match t.node {
242242
ty_nil | ty_bot | ty_infer => t.node.clone(),
243243
ty_box(ref mt) => ty_box(fold_mt(mt, self)),
244-
ty_uniq(ty) => ty_uniq(self.fold_ty(ty)),
245-
ty_vec(ty) => ty_vec(self.fold_ty(ty)),
244+
ty_uniq(ref mt) => ty_uniq(fold_mt(mt, self)),
245+
ty_vec(ref mt) => ty_vec(fold_mt(mt, self)),
246246
ty_ptr(ref mt) => ty_ptr(fold_mt(mt, self)),
247247
ty_rptr(ref region, ref mt) => {
248248
ty_rptr(fold_opt_lifetime(region, self), fold_mt(mt, self))
@@ -272,8 +272,8 @@ pub trait ast_fold {
272272
fold_opt_bounds(bounds, self),
273273
self.new_id(id))
274274
}
275-
ty_fixed_length_vec(ty, e) => {
276-
ty_fixed_length_vec(self.fold_ty(ty), self.fold_expr(e))
275+
ty_fixed_length_vec(ref mt, e) => {
276+
ty_fixed_length_vec(fold_mt(mt, self), self.fold_expr(e))
277277
}
278278
ty_typeof(expr) => ty_typeof(self.fold_expr(expr)),
279279
};

branches/dist-snap/src/libsyntax/parse/parser.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,25 +1213,25 @@ impl Parser {
12131213
} else if *self.token == token::AT {
12141214
// MANAGED POINTER
12151215
self.bump();
1216-
self.parse_box_or_uniq_pointee(ManagedSigil)
1216+
self.parse_box_or_uniq_pointee(ManagedSigil, ty_box)
12171217
} else if *self.token == token::TILDE {
12181218
// OWNED POINTER
12191219
self.bump();
1220-
self.parse_box_or_uniq_pointee(OwnedSigil)
1220+
self.parse_box_or_uniq_pointee(OwnedSigil, ty_uniq)
12211221
} else if *self.token == token::BINOP(token::STAR) {
12221222
// STAR POINTER (bare pointer?)
12231223
self.bump();
12241224
ty_ptr(self.parse_mt())
12251225
} else if *self.token == token::LBRACKET {
12261226
// VECTOR
12271227
self.expect(&token::LBRACKET);
1228-
let t = self.parse_ty(false);
1228+
let mt = mt { ty: self.parse_ty(false), mutbl: MutImmutable };
12291229

12301230
// Parse the `, ..e` in `[ int, ..e ]`
12311231
// where `e` is a const expression
12321232
let t = match self.maybe_parse_fixed_vstore() {
1233-
None => ty_vec(t),
1234-
Some(suffix) => ty_fixed_length_vec(t, suffix)
1233+
None => ty_vec(mt),
1234+
Some(suffix) => ty_fixed_length_vec(mt, suffix)
12351235
};
12361236
self.expect(&token::RBRACKET);
12371237
t
@@ -1284,7 +1284,8 @@ impl Parser {
12841284

12851285
// parse the type following a @ or a ~
12861286
pub fn parse_box_or_uniq_pointee(&self,
1287-
sigil: ast::Sigil)
1287+
sigil: ast::Sigil,
1288+
ctor: |v: mt| -> ty_)
12881289
-> ty_ {
12891290
// ~'foo fn() or ~fn() are parsed directly as obsolete fn types:
12901291
match *self.token {
@@ -1308,9 +1309,9 @@ impl Parser {
13081309
// rather than boxed ptrs. But the special casing of str/vec is not
13091310
// reflected in the AST type.
13101311
if sigil == OwnedSigil {
1311-
ty_uniq(self.parse_ty(false))
1312+
ctor(mt { ty: self.parse_ty(false), mutbl: MutImmutable })
13121313
} else {
1313-
ty_box(self.parse_mt())
1314+
ctor(self.parse_mt())
13141315
}
13151316
}
13161317

0 commit comments

Comments
 (0)