Skip to content

Commit ddf7a45

Browse files
committed
---
yaml --- r: 47349 b: refs/heads/try c: d66a3dd h: refs/heads/master i: 47347: f86f983 v: v3
1 parent a9005e9 commit ddf7a45

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

+357
-364
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: 3bbcac322669cff3abde5be937cc4ec3860f3985
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
5-
refs/heads/try: b7e72974dc09b050b07f7acb30dd70b0a65f4110
5+
refs/heads/try: d66a3dd0ec5982f964e540c758276d59af178960
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libcore/comm.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
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-
1411
use either::{Either, Left, Right};
1512
use kinds::Owned;
1613
use option;

branches/try/src/libcore/core.rc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,6 @@ 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;
234230
// Private APIs
235231
pub mod private;
236232

branches/try/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

branches/try/src/libcore/pipes.rs

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

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

branches/try/src/libcore/private/finally.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,10 @@ 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)]
3729
pub trait Finally<T> {
3830
fn finally(&self, dtor: &fn()) -> T;
3931
}
4032

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)]
5633
impl<T> Finally<T> for &fn() -> T {
5734
fn finally(&self, dtor: &fn()) -> T {
5835
let _d = Finallyalizer {

branches/try/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

branches/try/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

branches/try/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 {

branches/try/src/libcore/stackwalk.rs

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

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

13-
#[legacy_modes]; // tjc: remove after snapshot
14-
#[allow(deprecated_mode)];
15-
1613
use cast::reinterpret_cast;
1714
use ptr::offset;
1815
use sys::size_of;

branches/try/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.

branches/try/src/librustc/metadata/common.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ 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_moves_map = 0x63,
136-
tag_table_capture_map = 0x64
135+
tag_table_legacy_boxed_trait = 0x63,
136+
tag_table_moves_map = 0x64,
137+
tag_table_capture_map = 0x65
137138
}
138139

139140
pub const tag_item_trait_method_sort: uint = 0x70;

branches/try/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> {

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,12 @@ 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+
969975
for maps.moves_map.find(&id).each |_| {
970976
do ebml_w.tag(c::tag_table_moves_map) {
971977
ebml_w.id(id);
@@ -1115,6 +1121,8 @@ fn decode_side_tables(xcx: @ExtendedDecodeContext,
11151121
11161122
if tag == (c::tag_table_mutbl as uint) {
11171123
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, ());
11181126
} else if tag == (c::tag_table_moves_map as uint) {
11191127
dcx.maps.moves_map.insert(id, ());
11201128
} else {
@@ -1222,7 +1230,7 @@ impl fake_ext_ctxt for fake_session {
12221230
12231231
#[cfg(test)]
12241232
fn mk_ctxt() -> fake_ext_ctxt {
1225-
@parse::new_parse_sess(None) as fake_ext_ctxt
1233+
parse::new_parse_sess(None) as fake_ext_ctxt
12261234
}
12271235
12281236
#[cfg(test)]

branches/try/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

branches/try/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
}

branches/try/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
}

branches/try/src/librustc/middle/trans/common.rs

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

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 {
556+
impl get_node_info for Option<@ast::expr> {
560557
fn info(&self) -> Option<NodeInfo> {
561558
self.chain_ref(|s| s.info())
562559
}

branches/try/src/librustc/middle/trans/meth.rs

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -870,11 +870,26 @@ 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-
// 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));
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+
}
878893
}
879894
ty::vstore_uniq => {
880895
// Translate the uniquely-owned value into the second element of

branches/try/src/librustc/middle/ty.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ 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, ()>,
272273
// A mapping from an implementation ID to the method info and trait
273274
// method ID of the provided (a.k.a. default) methods in the traits that
274275
// that implementation implements.
@@ -830,6 +831,7 @@ pub fn mk_ctxt(s: session::Session,
830831
adjustments: HashMap(),
831832
normalized_cache: new_ty_hash(),
832833
lang_items: lang_items,
834+
legacy_boxed_traits: HashMap(),
833835
provided_methods: HashMap(),
834836
provided_method_sources: HashMap(),
835837
supertraits: HashMap(),

0 commit comments

Comments
 (0)