Skip to content

Commit 668e030

Browse files
committed
---
yaml --- r: 44844 b: refs/heads/master c: b7e7297 h: refs/heads/master v: v3
1 parent 2b9876a commit 668e030

Some content is hidden

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

64 files changed

+364
-356
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 6b6d15ac206e599509ebc40c39270877bf77c000
2+
refs/heads/master: b7e72974dc09b050b07f7acb30dd70b0a65f4110
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
55
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3

trunk/src/libcore/comm.rs

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

11+
// Transitional -- needs snapshot
12+
#[allow(structural_records)];
13+
1114
use either::{Either, Left, Right};
1215
use kinds::Owned;
1316
use option;

trunk/src/libcore/core.rc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,10 @@ pub const debug : u32 = 4_u32;
227227

228228
// The runtime interface used by the compiler
229229
#[cfg(notest)] pub mod rt;
230+
// The runtime and compiler interface to fmt!
231+
#[cfg(stage0)]
232+
#[path = "private/extfmt.rs"]
233+
pub mod extfmt;
230234
// Private APIs
231235
pub mod private;
232236

trunk/src/libcore/io.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ pub fn FILE_reader(f: *libc::FILE, cleanup: bool) -> @Reader {
504504

505505
pub fn stdin() -> @Reader {
506506
unsafe {
507-
rustrt::rust_get_stdin() as @Reader
507+
@rustrt::rust_get_stdin() as @Reader
508508
}
509509
}
510510

@@ -642,11 +642,11 @@ impl Writer for *libc::FILE {
642642
}
643643
}
644644

645-
pub fn FILE_writer(f: *libc::FILE, cleanup: bool) -> Writer {
645+
pub fn FILE_writer(f: *libc::FILE, cleanup: bool) -> @Writer {
646646
if cleanup {
647-
Wrapper { base: f, cleanup: FILERes(f) } as Writer
647+
@Wrapper { base: f, cleanup: FILERes(f) } as @Writer
648648
} else {
649-
f as Writer
649+
@f as @Writer
650650
}
651651
}
652652

@@ -702,11 +702,11 @@ pub fn FdRes(fd: fd_t) -> FdRes {
702702
}
703703
}
704704

705-
pub fn fd_writer(fd: fd_t, cleanup: bool) -> Writer {
705+
pub fn fd_writer(fd: fd_t, cleanup: bool) -> @Writer {
706706
if cleanup {
707-
Wrapper { base: fd, cleanup: FdRes(fd) } as Writer
707+
@Wrapper { base: fd, cleanup: FdRes(fd) } as @Writer
708708
} else {
709-
fd as Writer
709+
@fd as @Writer
710710
}
711711
}
712712

trunk/src/libcore/pipes.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ bounded and unbounded protocols allows for less code duplication.
8282
8383
*/
8484

85+
#[allow(structural_records)]; // Macros -- needs another snapshot
86+
8587
use cmp::Eq;
8688
use cast::{forget, reinterpret_cast, transmute};
8789
use cell::Cell;

trunk/src/libcore/private/finally.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,33 @@ do || {
2626
use ops::Drop;
2727
use task::{spawn, failing};
2828

29+
#[cfg(stage0)]
30+
pub trait Finally<T> {
31+
fn finally(&self, +dtor: &fn()) -> T;
32+
}
33+
34+
#[cfg(stage1)]
35+
#[cfg(stage2)]
36+
#[cfg(stage3)]
2937
pub trait Finally<T> {
3038
fn finally(&self, dtor: &fn()) -> T;
3139
}
3240

41+
#[cfg(stage0)]
42+
impl<T> Finally<T> for &fn() -> T {
43+
// FIXME #4518: Should not require a mode here
44+
fn finally(&self, +dtor: &fn()) -> T {
45+
let _d = Finallyalizer {
46+
dtor: dtor
47+
};
48+
49+
(*self)()
50+
}
51+
}
52+
53+
#[cfg(stage1)]
54+
#[cfg(stage2)]
55+
#[cfg(stage3)]
3356
impl<T> Finally<T> for &fn() -> T {
3457
fn finally(&self, dtor: &fn()) -> T {
3558
let _d = Finallyalizer {

trunk/src/libcore/rand.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,8 @@ pub fn Rng() -> Rng {
412412
* all other generators constructed with the same seed. The seed may be any
413413
* length.
414414
*/
415-
pub fn seeded_rng(seed: &[u8]) -> Rng {
416-
seeded_randres(seed) as Rng
415+
pub fn seeded_rng(seed: &[u8]) -> @Rng {
416+
@seeded_randres(seed) as @Rng
417417
}
418418

419419
fn seeded_randres(seed: &[u8]) -> @RandRes {
@@ -449,8 +449,8 @@ pub pure fn xorshift() -> Rng {
449449
seeded_xorshift(123456789u32, 362436069u32, 521288629u32, 88675123u32)
450450
}
451451

452-
pub pure fn seeded_xorshift(x: u32, y: u32, z: u32, w: u32) -> Rng {
453-
XorShiftState { x: x, y: y, z: z, w: w } as Rng
452+
pub pure fn seeded_xorshift(x: u32, y: u32, z: u32, w: u32) -> @Rng {
453+
@XorShiftState { x: x, y: y, z: z, w: w } as @Rng
454454
}
455455

456456

@@ -472,10 +472,10 @@ pub fn task_rng() -> Rng {
472472
unsafe {
473473
let rng = seeded_randres(seed());
474474
task::local_data::local_data_set(tls_rng_state, rng);
475-
rng as Rng
475+
@rng as @Rng
476476
}
477477
}
478-
Some(rng) => rng as Rng
478+
Some(rng) => @rng as @Rng
479479
}
480480
}
481481

trunk/src/libcore/repr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ pub impl ReprVisitor {
201201
unsafe {
202202
let mut u = ReprVisitor(ptr, self.writer);
203203
let v = reflect::MovePtrAdaptor(u);
204-
visit_tydesc(inner, (v) as @TyVisitor);
204+
visit_tydesc(inner, @v as @TyVisitor);
205205
true
206206
}
207207
}
@@ -570,7 +570,7 @@ pub fn write_repr<T>(writer: @Writer, object: &T) {
570570
let tydesc = intrinsic::get_tydesc::<T>();
571571
let mut u = ReprVisitor(ptr, writer);
572572
let v = reflect::MovePtrAdaptor(u);
573-
visit_tydesc(tydesc, (v) as @TyVisitor)
573+
visit_tydesc(tydesc, @v as @TyVisitor)
574574
}
575575
}
576576

trunk/src/libcore/run.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ pub fn start_program(prog: &str, args: &[~str]) -> Program {
288288
finished: false,
289289
};
290290

291-
ProgRes(repr) as Program
291+
@ProgRes(repr) as @Program
292292
}
293293

294294
fn read_all(rd: io::Reader) -> ~str {

trunk/src/libcore/stackwalk.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
#[doc(hidden)]; // FIXME #3538
1212

13+
#[legacy_modes]; // tjc: remove after snapshot
14+
#[allow(deprecated_mode)];
15+
1316
use cast::reinterpret_cast;
1417
use ptr::offset;
1518
use sys::size_of;

trunk/src/libcore/task/local_data_priv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ pub unsafe fn local_set<T:Durable>(
155155
// does not have a reference associated with it, so it may become invalid
156156
// when the box is destroyed.
157157
let data_ptr = cast::reinterpret_cast(&data);
158-
let data_box = data as LocalData;
158+
let data_box = @data as @LocalData;
159159
// Construct new entry to store in the map.
160160
let new_entry = Some((keyval, data_ptr, data_box));
161161
// Find a place to put it.

trunk/src/librustc/metadata/common.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,8 @@ pub enum astencode_tag { // Reserves 0x50 -- 0x6f
132132
tag_table_method_map = 0x60,
133133
tag_table_vtable_map = 0x61,
134134
tag_table_adjustments = 0x62,
135-
tag_table_legacy_boxed_trait = 0x63,
136-
tag_table_moves_map = 0x64,
137-
tag_table_capture_map = 0x65
135+
tag_table_moves_map = 0x63,
136+
tag_table_capture_map = 0x64
138137
}
139138

140139
pub const tag_item_trait_method_sort: uint = 0x70;

trunk/src/librustc/metadata/filesearch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ pub fn mk_filesearch(maybe_sysroot: Option<Path>,
7171

7272
let sysroot = get_sysroot(maybe_sysroot);
7373
debug!("using sysroot = %s", sysroot.to_str());
74-
FileSearchImpl {
74+
@FileSearchImpl {
7575
sysroot: sysroot,
7676
addl_lib_search_paths: addl_lib_search_paths,
7777
target_triple: str::from_slice(target_triple)
78-
} as FileSearch
78+
} as @FileSearch
7979
}
8080

8181
pub fn search<T:Copy>(filesearch: FileSearch, pick: pick<T>) -> Option<T> {

trunk/src/librustc/middle/astencode.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -966,12 +966,6 @@ fn encode_side_tables_for_id(ecx: @e::EncodeContext,
966966
}
967967
}
968968
969-
do option::iter(&tcx.legacy_boxed_traits.find(&id)) |_x| {
970-
do ebml_w.tag(c::tag_table_legacy_boxed_trait) {
971-
ebml_w.id(id);
972-
}
973-
}
974-
975969
for maps.moves_map.find(&id).each |_| {
976970
do ebml_w.tag(c::tag_table_moves_map) {
977971
ebml_w.id(id);
@@ -1121,8 +1115,6 @@ fn decode_side_tables(xcx: @ExtendedDecodeContext,
11211115
11221116
if tag == (c::tag_table_mutbl as uint) {
11231117
dcx.maps.mutbl_map.insert(id, ());
1124-
} else if tag == (c::tag_table_legacy_boxed_trait as uint) {
1125-
dcx.tcx.legacy_boxed_traits.insert(id, ());
11261118
} else if tag == (c::tag_table_moves_map as uint) {
11271119
dcx.maps.moves_map.insert(id, ());
11281120
} else {
@@ -1230,7 +1222,7 @@ impl fake_ext_ctxt for fake_session {
12301222
12311223
#[cfg(test)]
12321224
fn mk_ctxt() -> fake_ext_ctxt {
1233-
parse::new_parse_sess(None) as fake_ext_ctxt
1225+
@parse::new_parse_sess(None) as fake_ext_ctxt
12341226
}
12351227
12361228
#[cfg(test)]

trunk/src/librustc/middle/trans/cabi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ impl ABIInfo for LLVM_ABIInfo {
209209
}
210210
}
211211

212-
pub fn llvm_abi_info() -> ABIInfo {
213-
return LLVM_ABIInfo as ABIInfo;
212+
pub fn llvm_abi_info() -> @ABIInfo {
213+
return @LLVM_ABIInfo as @ABIInfo;
214214
}
215215

216216

trunk/src/librustc/middle/trans/cabi_arm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,6 @@ impl ABIInfo for ARM_ABIInfo {
159159
}
160160
}
161161

162-
pub fn abi_info() -> ABIInfo {
163-
return ARM_ABIInfo as ABIInfo;
162+
pub fn abi_info() -> @ABIInfo {
163+
return @ARM_ABIInfo as @ABIInfo;
164164
}

trunk/src/librustc/middle/trans/cabi_x86_64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,5 +408,5 @@ impl ABIInfo for X86_64_ABIInfo {
408408
}
409409

410410
pub fn x86_64_abi_info() -> ABIInfo {
411-
return X86_64_ABIInfo as ABIInfo;
411+
return @X86_64_ABIInfo as @ABIInfo;
412412
}

trunk/src/librustc/middle/trans/common.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,10 @@ impl get_node_info for ast::blk {
553553
}
554554
}
555555

556-
impl get_node_info for Option<@ast::expr> {
556+
// XXX: Work around a trait parsing bug. remove after snapshot
557+
pub type optional_boxed_ast_expr = Option<@ast::expr>;
558+
559+
impl get_node_info for optional_boxed_ast_expr {
557560
fn info(&self) -> Option<NodeInfo> {
558561
self.chain_ref(|s| s.info())
559562
}

trunk/src/librustc/middle/trans/meth.rs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -870,26 +870,11 @@ pub fn trans_trait_cast(bcx: block,
870870
match vstore {
871871
ty::vstore_slice(*) | ty::vstore_box => {
872872
let mut llboxdest = GEPi(bcx, lldest, [0u, 1u]);
873-
if bcx.tcx().legacy_boxed_traits.contains_key(&id) {
874-
// Allocate an @ box and store the value into it
875-
let MallocResult {bcx: new_bcx, box: llbox, body: body} =
876-
malloc_boxed(bcx, v_ty);
877-
bcx = new_bcx;
878-
add_clean_free(bcx, llbox, heap_managed);
879-
bcx = expr::trans_into(bcx, val, SaveIn(body));
880-
revoke_clean(bcx, llbox);
881-
882-
// Store the @ box into the pair
883-
Store(bcx, llbox, PointerCast(bcx,
884-
llboxdest,
885-
T_ptr(val_ty(llbox))));
886-
} else {
887-
// Just store the pointer into the pair.
888-
llboxdest = PointerCast(bcx,
889-
llboxdest,
890-
T_ptr(type_of(bcx.ccx(), v_ty)));
891-
bcx = expr::trans_into(bcx, val, SaveIn(llboxdest));
892-
}
873+
// Just store the pointer into the pair.
874+
llboxdest = PointerCast(bcx,
875+
llboxdest,
876+
T_ptr(type_of(bcx.ccx(), v_ty)));
877+
bcx = expr::trans_into(bcx, val, SaveIn(llboxdest));
893878
}
894879
ty::vstore_uniq => {
895880
// Translate the uniquely-owned value into the second element of

trunk/src/librustc/middle/ty.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ struct ctxt_ {
269269
adjustments: HashMap<ast::node_id, @AutoAdjustment>,
270270
normalized_cache: HashMap<t, t>,
271271
lang_items: middle::lang_items::LanguageItems,
272-
legacy_boxed_traits: HashMap<node_id, ()>,
273272
// A mapping from an implementation ID to the method info and trait
274273
// method ID of the provided (a.k.a. default) methods in the traits that
275274
// that implementation implements.
@@ -831,7 +830,6 @@ pub fn mk_ctxt(s: session::Session,
831830
adjustments: HashMap(),
832831
normalized_cache: new_ty_hash(),
833832
lang_items: lang_items,
834-
legacy_boxed_traits: HashMap(),
835833
provided_methods: HashMap(),
836834
provided_method_sources: HashMap(),
837835
supertraits: HashMap(),

0 commit comments

Comments
 (0)