Skip to content

Commit 23f00f9

Browse files
committed
---
yaml --- r: 80639 b: refs/heads/auto c: 9e8fb4a h: refs/heads/master i: 80637: e51959f 80635: 4d978a9 80631: b295d8d 80623: 14cedb3 80607: 7817f3c 80575: fb5dcc2 80511: acde26f 80383: 52863ff v: v3
1 parent c7c4b73 commit 23f00f9

File tree

12 files changed

+38
-97
lines changed

12 files changed

+38
-97
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 9adcbac30dd229490b0eb3f794fa0cd89e5f457b
16+
refs/heads/auto: 9e8fb4ad61cfe97413eb92d764aa6aeeb23d5afa
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libextra/workcache.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ impl Database {
198198
}
199199
}
200200

201-
// FIXME #4330: use &mut self here
202201
#[unsafe_destructor]
203202
impl Drop for Database {
204203
fn drop(&mut self) {

branches/auto/src/librustc/middle/trans/base.rs

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2559,7 +2559,10 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef {
25592559
// LLVM type is not fully determined by the Rust type.
25602560
let (v, inlineable) = consts::const_expr(ccx, expr);
25612561
ccx.const_values.insert(id, v);
2562-
let mut inlineable = inlineable;
2562+
if !inlineable {
2563+
debug!("%s not inlined", sym);
2564+
ccx.non_inlineable_statics.insert(id);
2565+
}
25632566
exprt = true;
25642567

25652568
unsafe {
@@ -2575,30 +2578,8 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef {
25752578
lib::llvm::SetUnnamedAddr(g, true);
25762579
lib::llvm::SetLinkage(g,
25772580
lib::llvm::InternalLinkage);
2578-
2579-
// This is a curious case where we must make
2580-
// all of these statics inlineable. If a
2581-
// global is tagged as
2582-
// address_insignificant, then LLVM won't
2583-
// coalesce globals unless they have an
2584-
// internal linkage type. This means that
2585-
// external crates cannot use this global.
2586-
// This is a problem for things like inner
2587-
// statics in generic functions, because the
2588-
// function will be inlined into another
2589-
// crate and then attempt to link to the
2590-
// static in the original crate, only to
2591-
// find that it's not there. On the other
2592-
// side of inlininig, the crates knows to
2593-
// not declare this static as
2594-
// available_externally (because it isn't)
2595-
inlineable = true;
25962581
}
25972582

2598-
if !inlineable {
2599-
debug!("%s not inlined", sym);
2600-
ccx.non_inlineable_statics.insert(id);
2601-
}
26022583
ccx.item_symbols.insert(i.id, sym);
26032584
g
26042585
}

branches/auto/src/librustc/middle/trans/inline.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use std::vec;
2121
use syntax::ast;
2222
use syntax::ast_map::path_name;
2323
use syntax::ast_util::local_def;
24-
use syntax::attr;
2524

2625
pub fn maybe_instantiate_inline(ccx: @mut CrateContext, fn_id: ast::DefId)
2726
-> ast::DefId {
@@ -69,12 +68,7 @@ pub fn maybe_instantiate_inline(ccx: @mut CrateContext, fn_id: ast::DefId)
6968
match item.node {
7069
ast::item_static(*) => {
7170
let g = get_item_val(ccx, item.id);
72-
// see the comment in get_item_val() as to why this check is
73-
// performed here.
74-
if !attr::contains_name(item.attrs,
75-
"address_insignificant") {
76-
SetLinkage(g, AvailableExternallyLinkage);
77-
}
71+
SetLinkage(g, AvailableExternallyLinkage);
7872
}
7973
_ => {}
8074
}

branches/auto/src/librustpkg/rustpkg.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ pub trait CtxMethods {
189189
fn test(&self);
190190
fn uninstall(&self, _id: &str, _vers: Option<~str>);
191191
fn unprefer(&self, _id: &str, _vers: Option<~str>);
192+
fn init(&self);
192193
}
193194

194195
impl CtxMethods for BuildContext {
@@ -319,6 +320,13 @@ impl CtxMethods for BuildContext {
319320
"test" => {
320321
self.test();
321322
}
323+
"init" => {
324+
if args.len() != 0 {
325+
return usage::init();
326+
} else {
327+
self.init();
328+
}
329+
}
322330
"uninstall" => {
323331
if args.len() < 1 {
324332
return usage::uninstall();
@@ -540,6 +548,13 @@ impl CtxMethods for BuildContext {
540548
fail!("test not yet implemented");
541549
}
542550

551+
fn init(&self) {
552+
os::mkdir_recursive(&Path("src"), U_RWX);
553+
os::mkdir_recursive(&Path("lib"), U_RWX);
554+
os::mkdir_recursive(&Path("bin"), U_RWX);
555+
os::mkdir_recursive(&Path("build"), U_RWX);
556+
}
557+
543558
fn uninstall(&self, _id: &str, _vers: Option<~str>) {
544559
fail!("uninstall not yet implemented");
545560
}
@@ -688,6 +703,7 @@ pub fn main_args(args: &[~str]) {
688703
~"list" => usage::list(),
689704
~"prefer" => usage::prefer(),
690705
~"test" => usage::test(),
706+
~"init" => usage::init(),
691707
~"uninstall" => usage::uninstall(),
692708
~"unprefer" => usage::unprefer(),
693709
_ => usage::general()

branches/auto/src/librustpkg/usage.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,10 @@ and exit code will be redirected.
148148
Options:
149149
-c, --cfg Pass a cfg flag to the package script");
150150
}
151+
152+
pub fn init() {
153+
io::println("rustpkg init name
154+
155+
This makes a new workspace for working on a project named name.
156+
");
157+
}

branches/auto/src/librustpkg/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use workcache_support::{digest_file_with_date, digest_only_date};
3333
// you could update the match in rustpkg.rc but forget to update this list. I think
3434
// that should be fixed.
3535
static COMMANDS: &'static [&'static str] =
36-
&["build", "clean", "do", "info", "install", "list", "prefer", "test", "uninstall",
36+
&["build", "clean", "do", "info", "init", "install", "list", "prefer", "test", "uninstall",
3737
"unprefer"];
3838

3939

branches/auto/src/libstd/rt/rc.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,14 @@ impl<T> Drop for RC<T> {
7878
assert!(self.refcount() > 0);
7979

8080
unsafe {
81-
// FIXME(#4330) Need self by value to get mutability.
82-
let this: &mut RC<T> = cast::transmute_mut(self);
83-
84-
match *this.get_mut_state() {
81+
match *self.get_mut_state() {
8582
(ref mut count, _) => {
8683
*count = *count - 1
8784
}
8885
}
8986

90-
if this.refcount() == 0 {
91-
let _: ~(uint, T) = cast::transmute(this.p);
87+
if self.refcount() == 0 {
88+
let _: ~(uint, T) = cast::transmute(self.p);
9289
}
9390
}
9491
}

branches/auto/src/libstd/rt/uv/uvio.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,7 @@ impl UvEventLoop {
188188

189189
impl Drop for UvEventLoop {
190190
fn drop(&mut self) {
191-
// XXX: Need mutable finalizer
192-
let this = unsafe {
193-
transmute::<&UvEventLoop, &mut UvEventLoop>(self)
194-
};
195-
this.uvio.uv_loop().close();
191+
self.uvio.uv_loop().close();
196192
}
197193
}
198194

@@ -648,9 +644,7 @@ impl UvTcpListener {
648644

649645
impl Drop for UvTcpListener {
650646
fn drop(&mut self) {
651-
// XXX need mutable finalizer
652-
let self_ = unsafe { transmute::<&UvTcpListener, &mut UvTcpListener>(self) };
653-
do self_.home_for_io_with_sched |self_, scheduler| {
647+
do self.home_for_io_with_sched |self_, scheduler| {
654648
do scheduler.deschedule_running_task_and_then |_, task| {
655649
let task = Cell::new(task);
656650
do self_.watcher.as_stream().close {
@@ -763,9 +757,7 @@ impl HomingIO for UvTcpStream {
763757

764758
impl Drop for UvTcpStream {
765759
fn drop(&mut self) {
766-
// XXX need mutable finalizer
767-
let this = unsafe { transmute::<&UvTcpStream, &mut UvTcpStream>(self) };
768-
do this.home_for_io_with_sched |self_, scheduler| {
760+
do self.home_for_io_with_sched |self_, scheduler| {
769761
do scheduler.deschedule_running_task_and_then |_, task| {
770762
let task_cell = Cell::new(task);
771763
do self_.watcher.as_stream().close {
@@ -922,9 +914,7 @@ impl HomingIO for UvUdpSocket {
922914

923915
impl Drop for UvUdpSocket {
924916
fn drop(&mut self) {
925-
// XXX need mutable finalizer
926-
let this = unsafe { transmute::<&UvUdpSocket, &mut UvUdpSocket>(self) };
927-
do this.home_for_io_with_sched |self_, scheduler| {
917+
do self.home_for_io_with_sched |self_, scheduler| {
928918
do scheduler.deschedule_running_task_and_then |_, task| {
929919
let task_cell = Cell::new(task);
930920
do self_.watcher.close {

branches/auto/src/libstd/unstable/atomics.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,7 @@ impl<T> AtomicOption<T> {
339339
#[unsafe_destructor]
340340
impl<T> Drop for AtomicOption<T> {
341341
fn drop(&mut self) {
342-
// This will ensure that the contained data is
343-
// destroyed, unless it's null.
344-
unsafe {
345-
// FIXME(#4330) Need self by value to get mutability.
346-
let this : &mut AtomicOption<T> = cast::transmute(self);
347-
let _ = this.take(SeqCst);
348-
}
342+
let _ = self.take(SeqCst);
349343
}
350344
}
351345

branches/auto/src/test/auxiliary/xcrate_address_insignificant.rs

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

branches/auto/src/test/run-pass/xcrate-address-insignificant.rs

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

0 commit comments

Comments
 (0)