Skip to content

Commit 8c72d05

Browse files
committed
---
yaml --- r: 96765 b: refs/heads/dist-snap c: b870ce7 h: refs/heads/master i: 96763: 9abccbb v: v3
1 parent 66fac68 commit 8c72d05

File tree

13 files changed

+129
-105
lines changed

13 files changed

+129
-105
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: 8b5a317d48eb26c3af875a409e4a16587aec7544
9+
refs/heads/dist-snap: b870ce7a9fe1368462c3ba8b62a1f85c9e5444ce
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/foo#1.0"; // a full package ID for rustpkg
793+
extern mod foo = "some/where/rust-foo#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: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,12 @@ 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+
285291
fn ast_mt_to_mt<AC:AstConv, RS:RegionScope>(
286292
this: &AC, rscope: &RS, mt: &ast::mt) -> ty::mt {
287293

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

305311
match a_seq_ty.ty.node {
306-
ast::ty_vec(ref mt) => {
307-
let mut mt = ast_mt_to_mt(this, rscope, mt);
312+
ast::ty_vec(ty) => {
313+
let mut mt = ast_ty_to_mt(this, rscope, ty);
308314
if a_seq_ty.mutbl == ast::MutMutable {
309315
mt = ty::mt { ty: mt.ty, mutbl: a_seq_ty.mutbl };
310316
}
@@ -394,14 +400,15 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>(
394400
mk_pointer(this, rscope, mt, ty::vstore_box,
395401
|tmt| ty::mk_box(tcx, tmt))
396402
}
397-
ast::ty_uniq(ref mt) => {
398-
mk_pointer(this, rscope, mt, ty::vstore_uniq,
403+
ast::ty_uniq(ty) => {
404+
let mt = ast::mt { ty: ty, mutbl: ast::MutImmutable };
405+
mk_pointer(this, rscope, &mt, ty::vstore_uniq,
399406
|tmt| ty::mk_uniq(tcx, tmt))
400407
}
401-
ast::ty_vec(ref mt) => {
408+
ast::ty_vec(ty) => {
402409
tcx.sess.span_err(ast_ty.span, "bare `[]` is not a type");
403410
// return /something/ so they can at least get more errors
404-
ty::mk_evec(tcx, ast_mt_to_mt(this, rscope, mt), ty::vstore_uniq)
411+
ty::mk_evec(tcx, ast_ty_to_mt(this, rscope, ty), ty::vstore_uniq)
405412
}
406413
ast::ty_ptr(ref mt) => {
407414
ty::mk_ptr(tcx, ast_mt_to_mt(this, rscope, mt))
@@ -532,15 +539,15 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:RegionScope>(
532539
}
533540
}
534541
}
535-
ast::ty_fixed_length_vec(ref a_mt, e) => {
542+
ast::ty_fixed_length_vec(ty, e) => {
536543
match const_eval::eval_const_expr_partial(&tcx, e) {
537544
Ok(ref r) => {
538545
match *r {
539546
const_eval::const_int(i) =>
540-
ty::mk_evec(tcx, ast_mt_to_mt(this, rscope, a_mt),
547+
ty::mk_evec(tcx, ast_ty_to_mt(this, rscope, ty),
541548
ty::vstore_fixed(i as uint)),
542549
const_eval::const_uint(i) =>
543-
ty::mk_evec(tcx, ast_mt_to_mt(this, rscope, a_mt),
550+
ty::mk_evec(tcx, ast_ty_to_mt(this, rscope, ty),
544551
ty::vstore_fixed(i as uint)),
545552
_ => {
546553
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(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()),
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()),
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/libstd/vec.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2673,11 +2673,9 @@ 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 {}
26762678
unsafe {
2677-
// destroy the remaining elements
2678-
for x in self.iter {
2679-
ptr::read_ptr(x);
2680-
}
26812679
if owns_managed::<T>() {
26822680
local_free(self.allocation as *u8 as *c_char)
26832681
} 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(mt),
879-
ty_vec(mt),
880-
ty_fixed_length_vec(mt, @Expr),
878+
ty_uniq(P<Ty>),
879+
ty_vec(P<Ty>),
880+
ty_fixed_length_vec(P<Ty>, @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(self.ty_mt(ty, ast::MutImmutable)))
315+
self.ty(span, ast::ty_uniq(ty))
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-
self.ecx.ty_mt(piece_ty, ast::MutImmutable),
596+
piece_ty,
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(ref mt) => ty_uniq(fold_mt(mt, self)),
245-
ty_vec(ref mt) => ty_vec(fold_mt(mt, self)),
244+
ty_uniq(ty) => ty_uniq(self.fold_ty(ty)),
245+
ty_vec(ty) => ty_vec(self.fold_ty(ty)),
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(ref mt, e) => {
276-
ty_fixed_length_vec(fold_mt(mt, self), self.fold_expr(e))
275+
ty_fixed_length_vec(ty, e) => {
276+
ty_fixed_length_vec(self.fold_ty(ty), 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: 8 additions & 9 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, ty_box)
1216+
self.parse_box_or_uniq_pointee(ManagedSigil)
12171217
} else if *self.token == token::TILDE {
12181218
// OWNED POINTER
12191219
self.bump();
1220-
self.parse_box_or_uniq_pointee(OwnedSigil, ty_uniq)
1220+
self.parse_box_or_uniq_pointee(OwnedSigil)
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 mt = mt { ty: self.parse_ty(false), mutbl: MutImmutable };
1228+
let t = self.parse_ty(false);
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(mt),
1234-
Some(suffix) => ty_fixed_length_vec(mt, suffix)
1233+
None => ty_vec(t),
1234+
Some(suffix) => ty_fixed_length_vec(t, suffix)
12351235
};
12361236
self.expect(&token::RBRACKET);
12371237
t
@@ -1284,8 +1284,7 @@ impl Parser {
12841284

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

0 commit comments

Comments
 (0)