Skip to content

Commit 166b9cf

Browse files
committed
---
yaml --- r: 63661 b: refs/heads/snap-stage3 c: 42b44b2 h: refs/heads/master i: 63659: c52460e v: v3
1 parent 6a53877 commit 166b9cf

File tree

18 files changed

+35
-128
lines changed

18 files changed

+35
-128
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: d161e630d8378e9705987e0b746d8dbf0da48842
4+
refs/heads/snap-stage3: 42b44b21b11ded0a7dbbe196b1c9d338ef33b614
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/Makefile.in

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,29 +239,29 @@ $(foreach target,$(CFG_TARGET_TRIPLES),\
239239
# Standard library variables
240240
######################################################################
241241

242-
STDLIB_CRATE := $(S)src/libstd/core.rc
242+
STDLIB_CRATE := $(S)src/libstd/std.rs
243243
STDLIB_INPUTS := $(wildcard $(addprefix $(S)src/libstd/, \
244-
core.rc *.rs */*.rs */*/*rs */*/*/*rs))
244+
*.rs */*.rs */*/*rs */*/*/*rs))
245245

246246
######################################################################
247247
# Extra library variables
248248
######################################################################
249249

250-
EXTRALIB_CRATE := $(S)src/libextra/std.rc
250+
EXTRALIB_CRATE := $(S)src/libextra/extra.rs
251251
EXTRALIB_INPUTS := $(wildcard $(addprefix $(S)src/libextra/, \
252-
std.rc *.rs */*.rs))
252+
*.rs */*.rs))
253253

254254
######################################################################
255255
# rustc crate variables
256256
######################################################################
257257

258-
COMPILER_CRATE := $(S)src/librustc/rustc.rc
258+
COMPILER_CRATE := $(S)src/librustc/rustc.rs
259259
COMPILER_INPUTS := $(wildcard $(addprefix $(S)src/librustc/, \
260-
rustc.rc *.rs */*.rs */*/*.rs */*/*/*.rs))
260+
*.rs */*.rs */*/*.rs */*/*/*.rs))
261261

262-
LIBSYNTAX_CRATE := $(S)src/libsyntax/syntax.rc
262+
LIBSYNTAX_CRATE := $(S)src/libsyntax/syntax.rs
263263
LIBSYNTAX_INPUTS := $(wildcard $(addprefix $(S)src/libsyntax/, \
264-
syntax.rc *.rs */*.rs */*/*.rs))
264+
*.rs */*.rs */*/*.rs))
265265

266266
DRIVER_CRATE := $(S)src/driver/driver.rs
267267

branches/snap-stage3/mk/tools.mk

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@
1212
# and host architectures
1313

1414
# The test runner that runs the cfail/rfail/rpass and bxench tests
15-
COMPILETEST_CRATE := $(S)src/compiletest/compiletest.rc
16-
COMPILETEST_INPUTS := $(wildcard $(S)src/compiletest/*rs)
15+
COMPILETEST_CRATE := $(S)src/compiletest/compiletest.rs
16+
COMPILETEST_INPUTS := $(wildcard $(S)src/compiletest/*.rs)
1717

1818
# Rustpkg, the package manager and build system
19-
RUSTPKG_LIB := $(S)src/librustpkg/rustpkg.rc
20-
RUSTPKG_INPUTS := $(wildcard $(S)src/librustpkg/*rs)
19+
RUSTPKG_LIB := $(S)src/librustpkg/rustpkg.rs
20+
RUSTPKG_INPUTS := $(wildcard $(S)src/librustpkg/*.rs)
2121

2222
# Rustdoc, the documentation tool
23-
RUSTDOC_LIB := $(S)src/librustdoc/rustdoc.rc
23+
RUSTDOC_LIB := $(S)src/librustdoc/rustdoc.rs
2424
RUSTDOC_INPUTS := $(wildcard $(S)src/librustdoc/*.rs)
2525

2626
# Rusti, the JIT REPL
27-
RUSTI_LIB := $(S)src/librusti/rusti.rc
27+
RUSTI_LIB := $(S)src/librusti/rusti.rs
2828
RUSTI_INPUTS := $(wildcard $(S)src/librusti/*.rs)
2929

3030
# Rust, the convenience tool
31-
RUST_LIB := $(S)src/librust/rust.rc
31+
RUST_LIB := $(S)src/librust/rust.rs
3232
RUST_INPUTS := $(wildcard $(S)src/librust/*.rs)
3333

3434
# FIXME: These are only built for the host arch. Eventually we'll

branches/snap-stage3/src/libextra/rc.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,10 @@ impl<T> Rc<T> {
7070
impl<T> Drop for Rc<T> {
7171
fn finalize(&self) {
7272
unsafe {
73-
if self.ptr.is_not_null() {
74-
(*self.ptr).count -= 1;
75-
if (*self.ptr).count == 0 {
76-
ptr::replace_ptr(self.ptr, intrinsics::uninit());
77-
free(self.ptr as *c_void)
78-
}
73+
(*self.ptr).count -= 1;
74+
if (*self.ptr).count == 0 {
75+
ptr::replace_ptr(self.ptr, intrinsics::uninit());
76+
free(self.ptr as *c_void)
7977
}
8078
}
8179
}
@@ -222,12 +220,10 @@ impl<T> RcMut<T> {
222220
impl<T> Drop for RcMut<T> {
223221
fn finalize(&self) {
224222
unsafe {
225-
if self.ptr.is_not_null() {
226-
(*self.ptr).count -= 1;
227-
if (*self.ptr).count == 0 {
228-
ptr::replace_ptr(self.ptr, uninit());
229-
free(self.ptr as *c_void)
230-
}
223+
(*self.ptr).count -= 1;
224+
if (*self.ptr).count == 0 {
225+
ptr::replace_ptr(self.ptr, uninit());
226+
free(self.ptr as *c_void)
231227
}
232228
}
233229
}

branches/snap-stage3/src/librustc/middle/trans/adt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ fn represent_type_uncached(cx: &mut CrateContext, t: ty::t) -> Repr {
135135
ty::lookup_field_type(cx.tcx, def_id, field.id, substs)
136136
};
137137
let packed = ty::lookup_packed(cx.tcx, def_id);
138-
let dtor = ty::ty_dtor(cx.tcx, def_id).has_drop_flag();
138+
let dtor = ty::ty_dtor(cx.tcx, def_id).is_present();
139139
let ftys =
140140
if dtor { ftys + [ty::mk_bool()] } else { ftys };
141141
return Univariant(mk_struct(cx, ftys, packed), dtor)

branches/snap-stage3/src/librustc/middle/trans/glue.rs

Lines changed: 8 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,13 @@ pub fn make_free_glue(bcx: block, v: ValueRef, t: ty::t) {
404404
build_return(bcx);
405405
}
406406

407-
pub fn trans_struct_drop_flag(bcx: block, t: ty::t, v0: ValueRef, dtor_did: ast::def_id,
408-
class_did: ast::def_id, substs: &ty::substs) -> block {
407+
pub fn trans_struct_drop(bcx: block,
408+
t: ty::t,
409+
v0: ValueRef,
410+
dtor_did: ast::def_id,
411+
class_did: ast::def_id,
412+
substs: &ty::substs)
413+
-> block {
409414
let repr = adt::represent_type(bcx.ccx(), t);
410415
let drop_flag = adt::trans_drop_flag_ptr(bcx, repr, v0);
411416
do with_cond(bcx, IsNotNull(bcx, Load(bcx, drop_flag))) |cx| {
@@ -447,43 +452,6 @@ pub fn trans_struct_drop_flag(bcx: block, t: ty::t, v0: ValueRef, dtor_did: ast:
447452
}
448453
}
449454

450-
pub fn trans_struct_drop(mut bcx: block, t: ty::t, v0: ValueRef, dtor_did: ast::def_id,
451-
class_did: ast::def_id, substs: &ty::substs) -> block {
452-
let repr = adt::represent_type(bcx.ccx(), t);
453-
454-
// Find and call the actual destructor
455-
let dtor_addr = get_res_dtor(bcx.ccx(), dtor_did,
456-
class_did, /*bad*/copy substs.tps);
457-
458-
// The second argument is the "self" argument for drop
459-
let params = unsafe {
460-
let ty = Type::from_ref(llvm::LLVMTypeOf(dtor_addr));
461-
ty.element_type().func_params()
462-
};
463-
464-
// Class dtors have no explicit args, so the params should
465-
// just consist of the environment (self)
466-
assert_eq!(params.len(), 1);
467-
468-
// Take a reference to the class (because it's using the Drop trait),
469-
// do so now.
470-
let llval = alloca(bcx, val_ty(v0));
471-
Store(bcx, v0, llval);
472-
473-
let self_arg = PointerCast(bcx, llval, params[0]);
474-
let args = ~[self_arg];
475-
476-
Call(bcx, dtor_addr, args);
477-
478-
// Drop the fields
479-
let field_tys = ty::struct_fields(bcx.tcx(), class_did, substs);
480-
for field_tys.iter().enumerate().advance |(i, fld)| {
481-
let llfld_a = adt::trans_field_ptr(bcx, repr, v0, 0, i);
482-
bcx = drop_ty(bcx, llfld_a, fld.mt.ty);
483-
}
484-
485-
bcx
486-
}
487455

488456
pub fn make_drop_glue(bcx: block, v0: ValueRef, t: ty::t) {
489457
// NB: v0 is an *alias* of type t here, not a direct value.
@@ -504,10 +472,7 @@ pub fn make_drop_glue(bcx: block, v0: ValueRef, t: ty::t) {
504472
ty::ty_struct(did, ref substs) => {
505473
let tcx = bcx.tcx();
506474
match ty::ty_dtor(tcx, did) {
507-
ty::TraitDtor(dtor, true) => {
508-
trans_struct_drop_flag(bcx, t, v0, dtor, did, substs)
509-
}
510-
ty::TraitDtor(dtor, false) => {
475+
ty::TraitDtor(dtor) => {
511476
trans_struct_drop(bcx, t, v0, dtor, did, substs)
512477
}
513478
ty::NoDtor => {
@@ -627,23 +592,6 @@ pub fn make_take_glue(bcx: block, v: ValueRef, t: ty::t) {
627592
ty::ty_opaque_closure_ptr(ck) => {
628593
closure::make_opaque_cbox_take_glue(bcx, ck, v)
629594
}
630-
ty::ty_struct(did, ref substs) => {
631-
let tcx = bcx.tcx();
632-
let bcx = iter_structural_ty(bcx, v, t, take_ty);
633-
634-
match ty::ty_dtor(tcx, did) {
635-
ty::TraitDtor(dtor, false) => {
636-
// Zero out the struct
637-
unsafe {
638-
let ty = Type::from_ref(llvm::LLVMTypeOf(v));
639-
memzero(bcx, v, ty);
640-
}
641-
642-
}
643-
_ => { }
644-
}
645-
bcx
646-
}
647595
_ if ty::type_is_structural(t) => {
648596
iter_structural_ty(bcx, v, t, take_ty)
649597
}

branches/snap-stage3/src/librustc/middle/ty.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3852,7 +3852,7 @@ pub fn item_path_str(cx: ctxt, id: ast::def_id) -> ~str {
38523852

38533853
pub enum DtorKind {
38543854
NoDtor,
3855-
TraitDtor(def_id, bool)
3855+
TraitDtor(def_id)
38563856
}
38573857

38583858
impl DtorKind {
@@ -3866,24 +3866,13 @@ impl DtorKind {
38663866
pub fn is_present(&const self) -> bool {
38673867
!self.is_not_present()
38683868
}
3869-
3870-
pub fn has_drop_flag(&self) -> bool {
3871-
match self {
3872-
&NoDtor => false,
3873-
&TraitDtor(_, flag) => flag
3874-
}
3875-
}
38763869
}
38773870

38783871
/* If struct_id names a struct with a dtor, return Some(the dtor's id).
38793872
Otherwise return none. */
38803873
pub fn ty_dtor(cx: ctxt, struct_id: def_id) -> DtorKind {
38813874
match cx.destructor_for_type.find(&struct_id) {
3882-
Some(&method_def_id) => {
3883-
let flag = !has_attr(cx, struct_id, "no_drop_flag");
3884-
3885-
TraitDtor(method_def_id, flag)
3886-
}
3875+
Some(&method_def_id) => TraitDtor(method_def_id),
38873876
None => NoDtor,
38883877
}
38893878
}

branches/snap-stage3/src/libstd/unstable/atomics.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ pub struct AtomicPtr<T> {
6262
/**
6363
* An owned atomic pointer. Ensures that only a single reference to the data is held at any time.
6464
*/
65-
#[no_drop_flag]
6665
pub struct AtomicOption<T> {
6766
priv p: *mut c_void
6867
}

branches/snap-stage3/src/test/run-pass/attr-no-drop-flag-size.rs

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)