Skip to content

Commit dc4762b

Browse files
committed
---
yaml --- r: 139390 b: refs/heads/try2 c: 91cb668 h: refs/heads/master v: v3
1 parent 6a19b31 commit dc4762b

File tree

103 files changed

+984
-1713
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+984
-1713
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: d31053277aa8ced6778334d49de150b1393073eb
8+
refs/heads/try2: 91cb6687a8869fa14aef8d978fb13e330c711cd3
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/RELEASES.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ Version 0.6 (March 2013)
6262
* Pattern matching over vectors improved and expanded
6363
* Typechecking of closure types has been overhauled to
6464
improve inference and eliminate unsoundness
65-
* Macros leave scope at the end of modules, unless that module is
66-
tagged with #[macro_escape]
6765

6866
* Libraries
6967
* Added big integers to `std::bigint`

branches/try2/configure

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ case $CFG_OSTYPE in
308308
esac
309309

310310

311+
if [ -z "$CFG_CPUTYPE" ]
312+
then
311313
case $CFG_CPUTYPE in
312314

313315
i386 | i486 | i686 | i786 | x86)
@@ -325,6 +327,7 @@ case $CFG_CPUTYPE in
325327
*)
326328
err "unknown CPU type: $CFG_CPUTYPE"
327329
esac
330+
fi
328331

329332
# Detect 64 bit linux systems with 32 bit userland and force 32 bit compilation
330333
if [ $CFG_OSTYPE = unknown-linux-gnu -a $CFG_CPUTYPE = x86_64 ]
@@ -572,7 +575,7 @@ fi
572575
CFG_PREFIX=${CFG_PREFIX%/}
573576
CFG_HOST_TRIPLES="$(echo $CFG_HOST_TRIPLES | tr ',' ' ')"
574577
CFG_TARGET_TRIPLES="$(echo $CFG_TARGET_TRIPLES | tr ',' ' ')"
575-
CFG_SUPPORTED_TARGET_TRIPLES="$(grep ^CC_*=* $CFG_SRC_DIR/mk/platform.mk | sed -e 's/^CC_//' -e 's/\([^=]*\).*/\1/' | xargs)"
578+
CFG_SUPPORTED_TARGET_TRIPLES="$(grep ^CC_*=* $CFG_SRC_DIR/mk/platform.mk | sed 's,^[^_]*_,,' | sed 's/\([^=]*\).*/\1/' | xargs)"
576579

577580
# copy host-triples to target-triples so that hosts are a subset of targets
578581
V_TEMP=""

branches/try2/src/libcore/cmp.rs

Lines changed: 22 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -45,62 +45,31 @@ pub trait TotalOrd {
4545
fn cmp(&self, other: &Self) -> Ordering;
4646
}
4747

48-
#[inline(always)]
49-
fn icmp<T: Ord>(a: &T, b: &T) -> Ordering {
50-
if *a < *b { Less }
51-
else if *a > *b { Greater }
52-
else { Equal }
53-
}
54-
55-
impl TotalOrd for u8 {
56-
#[inline(always)]
57-
fn cmp(&self, other: &u8) -> Ordering { icmp(self, other) }
58-
}
59-
60-
impl TotalOrd for u16 {
61-
#[inline(always)]
62-
fn cmp(&self, other: &u16) -> Ordering { icmp(self, other) }
63-
}
64-
65-
impl TotalOrd for u32 {
66-
#[inline(always)]
67-
fn cmp(&self, other: &u32) -> Ordering { icmp(self, other) }
68-
}
69-
70-
impl TotalOrd for u64 {
71-
#[inline(always)]
72-
fn cmp(&self, other: &u64) -> Ordering { icmp(self, other) }
73-
}
74-
75-
impl TotalOrd for i8 {
76-
#[inline(always)]
77-
fn cmp(&self, other: &i8) -> Ordering { icmp(self, other) }
78-
}
79-
80-
impl TotalOrd for i16 {
81-
#[inline(always)]
82-
fn cmp(&self, other: &i16) -> Ordering { icmp(self, other) }
83-
}
84-
85-
impl TotalOrd for i32 {
86-
#[inline(always)]
87-
fn cmp(&self, other: &i32) -> Ordering { icmp(self, other) }
88-
}
48+
macro_rules! totalord_impl(
49+
($t:ty) => {
50+
impl TotalOrd for $t {
51+
#[inline(always)]
52+
fn cmp(&self, other: &$t) -> Ordering {
53+
if *self < *other { Less }
54+
else if *self > *other { Greater }
55+
else { Equal }
56+
}
57+
}
58+
}
59+
)
8960

90-
impl TotalOrd for i64 {
91-
#[inline(always)]
92-
fn cmp(&self, other: &i64) -> Ordering { icmp(self, other) }
93-
}
61+
totalord_impl!(u8)
62+
totalord_impl!(u16)
63+
totalord_impl!(u32)
64+
totalord_impl!(u64)
9465

95-
impl TotalOrd for int {
96-
#[inline(always)]
97-
fn cmp(&self, other: &int) -> Ordering { icmp(self, other) }
98-
}
66+
totalord_impl!(i8)
67+
totalord_impl!(i16)
68+
totalord_impl!(i32)
69+
totalord_impl!(i64)
9970

100-
impl TotalOrd for uint {
101-
#[inline(always)]
102-
fn cmp(&self, other: &uint) -> Ordering { icmp(self, other) }
103-
}
71+
totalord_impl!(int)
72+
totalord_impl!(uint)
10473

10574
/**
10675
* Trait for values that can be compared for a sort-order.

branches/try2/src/libcore/hashmap.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! An unordered map and set type implemented as hash tables
12-
//!
13-
//! The tables use a keyed hash with new random keys generated for each container, so the ordering
14-
//! of a set of keys in a hash table is randomized.
11+
//! Sendable hash maps.
1512
1613
/// Open addressing with linear probing.
1714
pub mod linear {

branches/try2/src/libcore/ops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Traits for the built-in operators
11+
// Core operators
1212

1313
#[lang="drop"]
1414
pub trait Drop {
@@ -77,5 +77,5 @@ pub trait Shr<RHS,Result> {
7777

7878
#[lang="index"]
7979
pub trait Index<Index,Result> {
80-
fn index(&self, index: &Index) -> Result;
80+
fn index(&self, index: Index) -> Result;
8181
}

branches/try2/src/libcore/rt/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ fn initialize_call_frame(regs: &mut Registers, fptr: *c_void, arg: *c_void, sp:
126126
type Registers = [uint, ..22];
127127

128128
#[cfg(target_arch = "x86_64")]
129-
fn new_regs() -> ~Registers { ~([0, .. 22]) }
129+
fn new_regs() -> ~Registers { ~[0, .. 22] }
130130

131131
#[cfg(target_arch = "x86_64")]
132132
fn initialize_call_frame(regs: &mut Registers, fptr: *c_void, arg: *c_void, sp: *mut uint) {

branches/try2/src/librustc/metadata/decoder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ fn get_self_ty(item: ebml::Doc) -> ast::self_ty_ {
630630
let self_ty_kind = string[0];
631631
match self_ty_kind as char {
632632
's' => { return ast::sty_static; }
633+
'r' => { return ast::sty_by_ref; }
633634
'v' => { return ast::sty_value; }
634635
'@' => { return ast::sty_box(get_mutability(string[1])); }
635636
'~' => { return ast::sty_uniq(get_mutability(string[1])); }

branches/try2/src/librustc/metadata/encoder.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,9 @@ fn encode_self_type(ebml_w: writer::Encoder, self_type: ast::self_ty_) {
410410
sty_static => {
411411
ebml_w.writer.write(&[ 's' as u8 ]);
412412
}
413+
sty_by_ref => {
414+
ebml_w.writer.write(&[ 'r' as u8 ]);
415+
}
413416
sty_value => {
414417
ebml_w.writer.write(&[ 'v' as u8 ]);
415418
}

branches/try2/src/librustc/metadata/tydecode.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use core::vec;
2424
use syntax::ast;
2525
use syntax::ast::*;
2626
use syntax::codemap::{respan, dummy_sp};
27-
use syntax::opt_vec;
2827

2928
// Compact string representation for ty::t values. API ty_str &
3029
// parse_from_str. Extra parameters are for converting to/from def_ids in the
@@ -480,9 +479,7 @@ fn parse_sig(st: @mut PState, conv: conv_did) -> ty::FnSig {
480479
}
481480
st.pos += 1u; // eat the ']'
482481
let ret_ty = parse_ty(st, conv);
483-
ty::FnSig {bound_lifetime_names: opt_vec::Empty, // FIXME(#4846)
484-
inputs: inputs,
485-
output: ret_ty}
482+
ty::FnSig {inputs: inputs, output: ret_ty}
486483
}
487484
488485
// Rust metadata parsing

branches/try2/src/librustc/middle/astencode.rs

Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ fn simplify_ast(ii: ast::inlined_item) -> ast::inlined_item {
342342
}
343343
344344
fn decode_ast(par_doc: ebml::Doc) -> ast::inlined_item {
345-
let chi_doc = par_doc.get(c::tag_tree as uint);
345+
let chi_doc = par_doc[c::tag_tree as uint];
346346
let d = &reader::Decoder(chi_doc);
347347
Decodable::decode(d)
348348
}
@@ -681,7 +681,6 @@ impl vtable_decoder_helpers for reader::Decoder {
681681
@self.read_to_vec(|| self.read_vtable_origin(xcx) )
682682
}
683683
684-
#[cfg(stage0)]
685684
fn read_vtable_origin(&self, xcx: @ExtendedDecodeContext)
686685
-> typeck::vtable_origin {
687686
do self.read_enum(~"vtable_origin") {
@@ -716,44 +715,6 @@ impl vtable_decoder_helpers for reader::Decoder {
716715
}
717716
}
718717
}
719-
720-
#[cfg(stage1)]
721-
#[cfg(stage2)]
722-
#[cfg(stage3)]
723-
fn read_vtable_origin(&self, xcx: @ExtendedDecodeContext)
724-
-> typeck::vtable_origin {
725-
do self.read_enum("vtable_origin") {
726-
do self.read_enum_variant(["vtable_static", "vtable_param"]) |i| {
727-
match i {
728-
0 => {
729-
typeck::vtable_static(
730-
do self.read_enum_variant_arg(0u) {
731-
self.read_def_id(xcx)
732-
},
733-
do self.read_enum_variant_arg(1u) {
734-
self.read_tys(xcx)
735-
},
736-
do self.read_enum_variant_arg(2u) {
737-
self.read_vtable_res(xcx)
738-
}
739-
)
740-
}
741-
1 => {
742-
typeck::vtable_param(
743-
do self.read_enum_variant_arg(0u) {
744-
self.read_uint()
745-
},
746-
do self.read_enum_variant_arg(1u) {
747-
self.read_uint()
748-
}
749-
)
750-
}
751-
// hard to avoid - user input
752-
_ => fail!(~"bad enum variant")
753-
}
754-
}
755-
}
756-
}
757718
}
758719
759720
// ______________________________________________________________________
@@ -1128,9 +1089,9 @@ impl ebml_decoder_decoder_helpers for reader::Decoder {
11281089
fn decode_side_tables(xcx: @ExtendedDecodeContext,
11291090
ast_doc: ebml::Doc) {
11301091
let dcx = xcx.dcx;
1131-
let tbl_doc = ast_doc.get(c::tag_table as uint);
1092+
let tbl_doc = ast_doc[c::tag_table as uint];
11321093
for reader::docs(tbl_doc) |tag, entry_doc| {
1133-
let id0 = entry_doc.get(c::tag_table_id as uint).as_int();
1094+
let id0 = entry_doc[c::tag_table_id as uint].as_int();
11341095
let id = xcx.tr_id(id0);
11351096
11361097
debug!(">> Side table document with tag 0x%x \
@@ -1142,7 +1103,7 @@ fn decode_side_tables(xcx: @ExtendedDecodeContext,
11421103
} else if tag == (c::tag_table_moves_map as uint) {
11431104
dcx.maps.moves_map.insert(id);
11441105
} else {
1145-
let val_doc = entry_doc.get(c::tag_table_val as uint);
1106+
let val_doc = entry_doc[c::tag_table_val as uint];
11461107
let val_dsr = &reader::Decoder(val_doc);
11471108
if tag == (c::tag_table_def as uint) {
11481109
let def = decode_def(xcx, val_doc);
@@ -1211,7 +1172,7 @@ fn encode_item_ast(ebml_w: writer::Encoder, item: @ast::item) {
12111172
12121173
#[cfg(test)]
12131174
fn decode_item_ast(par_doc: ebml::Doc) -> @ast::item {
1214-
let chi_doc = par_doc.get(c::tag_tree as uint);
1175+
let chi_doc = par_doc[c::tag_tree as uint];
12151176
let d = &reader::Decoder(chi_doc);
12161177
@Decodable::decode(d)
12171178
}

branches/try2/src/librustc/middle/borrowck/gather_loans.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,21 @@ fn req_loans_in_expr(ex: @ast::expr,
180180
}
181181
}
182182

183+
match self.bccx.method_map.find(&ex.id) {
184+
Some(ref method_map_entry) => {
185+
match (*method_map_entry).explicit_self {
186+
ast::sty_by_ref => {
187+
let rcvr_cmt = self.bccx.cat_expr(rcvr);
188+
self.guarantee_valid(rcvr_cmt, m_imm, scope_r);
189+
}
190+
_ => {} // Nothing to do.
191+
}
192+
}
193+
None => {
194+
self.tcx().sess.span_bug(ex.span, ~"no method map entry");
195+
}
196+
}
197+
183198
visit::visit_expr(ex, self, vt);
184199
}
185200

branches/try2/src/librustc/middle/check_const.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ pub fn check_expr(sess: Session,
156156
expr_paren(e) => { check_expr(sess, def_map, method_map,
157157
tcx, e, is_const, v); }
158158
expr_vstore(_, expr_vstore_slice) |
159+
expr_vstore(_, expr_vstore_fixed(_)) |
159160
expr_vec(_, m_imm) |
160161
expr_addr_of(m_imm, _) |
161162
expr_field(*) |

branches/try2/src/librustc/middle/const_eval.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ pub fn classify(e: @expr,
110110

111111
ast::expr_vstore(e, vstore) => {
112112
match vstore {
113+
ast::expr_vstore_fixed(_) |
113114
ast::expr_vstore_slice => classify(e, tcx),
114115
ast::expr_vstore_uniq |
115116
ast::expr_vstore_box |

0 commit comments

Comments
 (0)