Skip to content

Commit 74f4bad

Browse files
committed
auto merge of #7955 : thestinger/rust/snapshot, r=huonw
2 parents 3d6c0bc + f51e2ad commit 74f4bad

34 files changed

+27
-814
lines changed

src/libextra/arc.rs

-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ struct RWARCInner<T> { priv lock: RWlock, priv failed: bool, priv data: T }
305305
*
306306
* Unlike mutex_arcs, rw_arcs are safe, because they cannot be nested.
307307
*/
308-
#[mutable] // XXX remove after snap
309308
#[no_freeze]
310309
struct RWARC<T> {
311310
priv x: UnsafeAtomicRcBox<RWARCInner<T>>,

src/libextra/arena.rs

+2-24
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,7 @@ use std::sys;
4646
use std::uint;
4747
use std::vec;
4848
use std::unstable::intrinsics;
49-
use std::unstable::intrinsics::{TyDesc};
50-
51-
#[cfg(not(stage0))]
52-
use std::unstable::intrinsics::{get_tydesc};
53-
54-
#[cfg(stage0)]
55-
unsafe fn get_tydesc<T>() -> *TyDesc {
56-
intrinsics::get_tydesc::<T>() as *TyDesc
57-
}
49+
use std::unstable::intrinsics::{TyDesc, get_tydesc};
5850

5951
// The way arena uses arrays is really deeply awful. The arrays are
6052
// allocated, and have capacities reserved, but the fill for the array
@@ -65,7 +57,6 @@ struct Chunk {
6557
is_pod: bool,
6658
}
6759

68-
#[mutable] // XXX remove after snap
6960
#[no_freeze]
7061
pub struct Arena {
7162
// The head is separated out from the list as a unbenchmarked
@@ -117,19 +108,6 @@ fn round_up_to(base: uint, align: uint) -> uint {
117108
(base + (align - 1)) & !(align - 1)
118109
}
119110

120-
#[inline]
121-
#[cfg(not(stage0))]
122-
unsafe fn call_drop_glue(tydesc: *TyDesc, data: *i8) {
123-
// This function should be inlined when stage0 is gone
124-
((*tydesc).drop_glue)(data);
125-
}
126-
127-
#[inline]
128-
#[cfg(stage0)]
129-
unsafe fn call_drop_glue(tydesc: *TyDesc, data: *i8) {
130-
((*tydesc).drop_glue)(0 as **TyDesc, data);
131-
}
132-
133111
// Walk down a chunk, running the destructors for any objects stored
134112
// in it.
135113
unsafe fn destroy_chunk(chunk: &Chunk) {
@@ -149,7 +127,7 @@ unsafe fn destroy_chunk(chunk: &Chunk) {
149127
//debug!("freeing object: idx = %u, size = %u, align = %u, done = %b",
150128
// start, size, align, is_done);
151129
if is_done {
152-
call_drop_glue(tydesc, ptr::offset(buf, start) as *i8);
130+
((*tydesc).drop_glue)(ptr::offset(buf, start) as *i8);
153131
}
154132

155133
// Find where the next tydesc lives

src/libextra/dbg.rs

-6
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,9 @@
1313
#[allow(missing_doc)];
1414

1515
use std::cast::transmute;
16-
#[cfg(stage0)]
17-
use intrinsic::{get_tydesc};
18-
#[cfg(not(stage0))]
1916
use std::unstable::intrinsics::{get_tydesc};
2017

2118
pub mod rustrt {
22-
#[cfg(stage0)]
23-
use intrinsic::{TyDesc};
24-
#[cfg(not(stage0))]
2519
use std::unstable::intrinsics::{TyDesc};
2620

2721
#[abi = "cdecl"]

src/libextra/rc.rs

-2
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,7 @@ struct RcMutBox<T> {
166166
}
167167

168168
/// Mutable reference counted pointer type
169-
#[non_owned]
170169
#[no_send]
171-
#[mutable] // XXX remove after snap
172170
#[no_freeze]
173171
#[unsafe_no_drop_flag]
174172
pub struct RcMut<T> {

src/libextra/rl.rs

-3
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,7 @@ pub unsafe fn read(prompt: &str) -> Option<~str> {
6868

6969
pub type CompletionCb = @fn(~str, @fn(~str));
7070

71-
#[cfg(not(stage0))]
7271
static complete_key: local_data::Key<@CompletionCb> = &local_data::Key;
73-
#[cfg(stage0)]
74-
fn complete_key(_: @CompletionCb) {}
7572

7673
/// Bind to the main completion callback
7774
pub unsafe fn complete(cb: CompletionCb) {

src/librustc/back/link.rs

-8
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ pub mod jit {
106106
use metadata::cstore;
107107

108108
use std::cast;
109-
#[cfg(not(stage0))]
110109
use std::local_data;
111110
use std::unstable::intrinsics;
112111

@@ -204,22 +203,15 @@ pub mod jit {
204203

205204
// The stage1 compiler won't work, but that doesn't really matter. TLS
206205
// changed only very recently to allow storage of owned values.
207-
#[cfg(not(stage0))]
208206
static engine_key: local_data::Key<~Engine> = &local_data::Key;
209207

210-
#[cfg(not(stage0))]
211208
fn set_engine(engine: ~Engine) {
212209
local_data::set(engine_key, engine)
213210
}
214-
#[cfg(stage0)]
215-
fn set_engine(_: ~Engine) {}
216211

217-
#[cfg(not(stage0))]
218212
pub fn consume_engine() -> Option<~Engine> {
219213
local_data::pop(engine_key)
220214
}
221-
#[cfg(stage0)]
222-
pub fn consume_engine() -> Option<~Engine> { None }
223215
}
224216

225217
pub mod write {

src/librustc/middle/trans/base.rs

-3
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,7 @@ use syntax::abi::{X86, X86_64, Arm, Mips};
9090

9191
pub use middle::trans::context::task_llcx;
9292

93-
#[cfg(not(stage0))]
9493
static task_local_insn_key: local_data::Key<@~[&'static str]> = &local_data::Key;
95-
#[cfg(stage0)]
96-
fn task_local_insn_key(_: @~[&'static str]) {}
9794

9895
pub fn with_insn_ctxt(blk: &fn(&[&'static str])) {
9996
let opt = local_data::get(task_local_insn_key, |k| k.map(|&k| *k));

src/librustc/middle/trans/context.rs

-3
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,6 @@ impl Drop for CrateContext {
236236
}
237237
}
238238

239-
#[cfg(stage0)]
240-
fn task_local_llcx_key(_v: @ContextRef) {}
241-
#[cfg(not(stage0))]
242239
static task_local_llcx_key: local_data::Key<@ContextRef> = &local_data::Key;
243240

244241
pub fn task_llcx() -> ContextRef {

src/librustc/middle/trans/debuginfo.rs

-139
Original file line numberDiff line numberDiff line change
@@ -607,9 +607,6 @@ fn tuple_metadata(cx: &mut CrateContext,
607607
span);
608608
}
609609

610-
// The stage0 snapshot does not yet support the fixes from PR #7557, so there are two versions of
611-
// following function for now
612-
#[cfg(not(stage0))]
613610
fn enum_metadata(cx: &mut CrateContext,
614611
enum_type: ty::t,
615612
enum_def_id: ast::def_id,
@@ -772,142 +769,6 @@ fn enum_metadata(cx: &mut CrateContext,
772769
}
773770
}
774771

775-
#[cfg(stage0)]
776-
fn enum_metadata(cx: &mut CrateContext,
777-
enum_type: ty::t,
778-
enum_def_id: ast::def_id,
779-
substs: &ty::substs,
780-
span: span)
781-
-> DIType {
782-
783-
let enum_name = ty_to_str(cx.tcx, enum_type);
784-
785-
// For empty enums there is an early exit. Just describe it as an empty struct with the
786-
// appropriate type name
787-
if ty::type_is_empty(cx.tcx, enum_type) {
788-
return composite_type_metadata(cx, Type::nil(), enum_name, &[], &[], &[], span);
789-
}
790-
791-
// Prepare some data (llvm type, size, align, ...) about the discriminant. This data will be
792-
// needed in all of the following cases.
793-
let discriminant_llvm_type = Type::enum_discrim(cx);
794-
let (discriminant_size, discriminant_align) = size_and_align_of(cx, discriminant_llvm_type);
795-
796-
assert!(Type::enum_discrim(cx) == cx.int_type);
797-
let discriminant_type_metadata = type_metadata(cx, ty::mk_int(), span);
798-
799-
let variants: &[@ty::VariantInfo] = *ty::enum_variants(cx.tcx, enum_def_id);
800-
801-
let enumerators_metadata: ~[DIDescriptor] = variants
802-
.iter()
803-
.transform(|v| {
804-
let name: &str = cx.sess.str_of(v.name);
805-
let discriminant_value = v.disr_val as c_ulonglong;
806-
807-
do name.as_c_str |name| {
808-
unsafe {
809-
llvm::LLVMDIBuilderCreateEnumerator(
810-
DIB(cx),
811-
name,
812-
discriminant_value)
813-
}
814-
}
815-
})
816-
.collect();
817-
818-
let loc = span_start(cx, span);
819-
let file_metadata = file_metadata(cx, loc.file.name);
820-
821-
let discriminant_type_metadata = do enum_name.as_c_str |enum_name| {
822-
unsafe {
823-
llvm::LLVMDIBuilderCreateEnumerationType(
824-
DIB(cx),
825-
file_metadata,
826-
enum_name,
827-
file_metadata,
828-
loc.line as c_uint,
829-
bytes_to_bits(discriminant_size),
830-
bytes_to_bits(discriminant_align),
831-
create_DIArray(DIB(cx), enumerators_metadata),
832-
discriminant_type_metadata)
833-
}
834-
};
835-
836-
if ty::type_is_c_like_enum(cx.tcx, enum_type) {
837-
return discriminant_type_metadata;
838-
}
839-
840-
let is_univariant = variants.len() == 1;
841-
842-
let variants_metadata = do variants.map |&vi| {
843-
844-
let raw_types: &[ty::t] = vi.args;
845-
let arg_types = do raw_types.map |&raw_type| { ty::subst(cx.tcx, substs, raw_type) };
846-
847-
let mut arg_llvm_types = do arg_types.map |&ty| { type_of::type_of(cx, ty) };
848-
let mut arg_names = match vi.arg_names {
849-
Some(ref names) => do names.map |ident| { cx.sess.str_of(*ident).to_owned() },
850-
None => do arg_types.map |_| { ~"" }
851-
};
852-
853-
let mut arg_metadata = do arg_types.map |&ty| { type_metadata(cx, ty, span) };
854-
855-
if !is_univariant {
856-
arg_llvm_types.insert(0, discriminant_llvm_type);
857-
arg_names.insert(0, ~"");
858-
arg_metadata.insert(0, discriminant_type_metadata);
859-
}
860-
861-
let variant_llvm_type = Type::struct_(arg_llvm_types, false);
862-
let (variant_type_size, variant_type_align) = size_and_align_of(cx, variant_llvm_type);
863-
864-
let variant_type_metadata = composite_type_metadata(
865-
cx,
866-
variant_llvm_type,
867-
&"",
868-
arg_llvm_types,
869-
arg_names,
870-
arg_metadata,
871-
span);
872-
873-
do "".as_c_str |name| {
874-
unsafe {
875-
llvm::LLVMDIBuilderCreateMemberType(
876-
DIB(cx),
877-
file_metadata,
878-
name,
879-
file_metadata,
880-
loc.line as c_uint,
881-
bytes_to_bits(variant_type_size),
882-
bytes_to_bits(variant_type_align),
883-
bytes_to_bits(0),
884-
0,
885-
variant_type_metadata)
886-
}
887-
}
888-
};
889-
890-
let enum_llvm_type = type_of::type_of(cx, enum_type);
891-
let (enum_type_size, enum_type_align) = size_and_align_of(cx, enum_llvm_type);
892-
893-
return do enum_name.as_c_str |enum_name| {
894-
unsafe {
895-
llvm::LLVMDIBuilderCreateUnionType(
896-
DIB(cx),
897-
file_metadata,
898-
enum_name,
899-
file_metadata,
900-
loc.line as c_uint,
901-
bytes_to_bits(enum_type_size),
902-
bytes_to_bits(enum_type_align),
903-
0, // Flags
904-
create_DIArray(DIB(cx), variants_metadata),
905-
0) // RuntimeLang
906-
}
907-
};
908-
}
909-
910-
911772
/// Creates debug information for a composite type, that is, anything that results in a LLVM struct.
912773
///
913774
/// Examples of Rust types to use this are: structs, tuples, boxes, vecs, and enums.

src/librustpkg/tests.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,8 @@ fn test_install_invalid() {
475475

476476
// Tests above should (maybe) be converted to shell out to rustpkg, too
477477

478-
#[test] #[ignore(cfg(target_arch = "x86"))]
478+
// FIXME: #7956: temporarily disabled
479+
#[ignore(cfg(target_arch = "x86"))]
479480
fn test_install_git() {
480481
let sysroot = test_sysroot();
481482
debug!("sysroot = %s", sysroot.to_str());
@@ -566,7 +567,8 @@ fn test_package_ids_must_be_relative_path_like() {
566567
567568
}
568569
569-
#[test] #[ignore(cfg(target_arch = "x86"))]
570+
// FIXME: #7956: temporarily disabled
571+
#[ignore(cfg(target_arch = "x86"))]
570572
fn test_package_version() {
571573
let local_path = "mockgithub.com/catamorphism/test_pkg_version";
572574
let repo = init_git_repo(&Path(local_path));
@@ -678,7 +680,7 @@ fn rustpkg_install_url_2() {
678680
&temp_dir);
679681
}
680682
681-
#[test]
683+
// FIXME: #7956: temporarily disabled
682684
fn rustpkg_library_target() {
683685
let foo_repo = init_git_repo(&Path("foo"));
684686
let package_dir = foo_repo.push("foo");

src/libstd/cell.rs

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ A dynamic, mutable location.
2121
Similar to a mutable option type, but friendlier.
2222
*/
2323

24-
#[mutable] // XXX remove after snap
2524
#[no_freeze]
2625
#[deriving(Clone, DeepClone, Eq)]
2726
#[allow(missing_doc)]

src/libstd/cleanup.rs

+1-14
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,6 @@ fn debug_mem() -> bool {
7373
false
7474
}
7575

76-
#[inline]
77-
#[cfg(not(stage0))]
78-
unsafe fn call_drop_glue(tydesc: *TyDesc, data: *i8) {
79-
// This function should be inlined when stage0 is gone
80-
((*tydesc).drop_glue)(data);
81-
}
82-
83-
#[inline]
84-
#[cfg(stage0)]
85-
unsafe fn call_drop_glue(tydesc: *TyDesc, data: *i8) {
86-
((*tydesc).drop_glue)(0 as **TyDesc, data);
87-
}
88-
8976
/// Destroys all managed memory (i.e. @ boxes) held by the current task.
9077
pub unsafe fn annihilate() {
9178
use rt::local_heap::local_free;
@@ -128,7 +115,7 @@ pub unsafe fn annihilate() {
128115
if !uniq {
129116
let tydesc: *TyDesc = transmute((*box).header.type_desc);
130117
let data = transmute(&(*box).data);
131-
call_drop_glue(tydesc, data);
118+
((*tydesc).drop_glue)(data);
132119
}
133120
}
134121

0 commit comments

Comments
 (0)