Skip to content

Commit a51b18b

Browse files
committed
---
yaml --- r: 83196 b: refs/heads/try c: 34ac5b0 h: refs/heads/master v: v3
1 parent 7d5d52b commit a51b18b

File tree

23 files changed

+267
-1546
lines changed

23 files changed

+267
-1546
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: 0e4d1fc8cae42e15e00f71d9f439b01bb25a86ae
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
5-
refs/heads/try: 460021bdf2106ee76daf7d81ec7e50e972e26901
5+
refs/heads/try: 34ac5b05f695b21f286f85d2391d116b8ad7a4d5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libextra/workcache.rs

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

201+
// FIXME #4330: use &mut self here
201202
#[unsafe_destructor]
202203
impl Drop for Database {
203204
fn drop(&mut self) {

branches/try/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/try/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/try/src/librustc/rustc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ pub fn version(argv0: &str) {
134134

135135
pub fn usage(argv0: &str) {
136136
let message = fmt!("Usage: %s [OPTIONS] INPUT", argv0);
137-
printfln!("%s\
137+
printfln!("%s\n\
138138
Additional help:
139139
-W help Print 'lint' options and default settings
140140
-Z help Print internal options for debugging rustc\n",

branches/try/src/librustpkg/rustpkg.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ 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);
193192
}
194193

195194
impl CtxMethods for BuildContext {
@@ -320,13 +319,6 @@ impl CtxMethods for BuildContext {
320319
"test" => {
321320
self.test();
322321
}
323-
"init" => {
324-
if args.len() != 0 {
325-
return usage::init();
326-
} else {
327-
self.init();
328-
}
329-
}
330322
"uninstall" => {
331323
if args.len() < 1 {
332324
return usage::uninstall();
@@ -548,13 +540,6 @@ impl CtxMethods for BuildContext {
548540
fail!("test not yet implemented");
549541
}
550542

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-
558543
fn uninstall(&self, _id: &str, _vers: Option<~str>) {
559544
fail!("uninstall not yet implemented");
560545
}
@@ -703,7 +688,6 @@ pub fn main_args(args: &[~str]) {
703688
~"list" => usage::list(),
704689
~"prefer" => usage::prefer(),
705690
~"test" => usage::test(),
706-
~"init" => usage::init(),
707691
~"uninstall" => usage::uninstall(),
708692
~"unprefer" => usage::unprefer(),
709693
_ => usage::general()

branches/try/src/librustpkg/tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,6 @@ fn no_rebuilding() {
939939
}
940940
941941
#[test]
942-
#[ignore]
943942
fn no_rebuilding_dep() {
944943
let p_id = PkgId::new("foo");
945944
let dep_id = PkgId::new("bar");

branches/try/src/librustpkg/usage.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,3 @@ 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/try/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", "init", "install", "list", "prefer", "test", "uninstall",
36+
&["build", "clean", "do", "info", "install", "list", "prefer", "test", "uninstall",
3737
"unprefer"];
3838

3939

branches/try/src/libstd/os.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,16 @@ pub fn env() -> ~[(~str,~str)] {
196196
if (ch as uint == 0) {
197197
fail!("os::env() failure getting env string from OS: %s", os::last_os_error());
198198
}
199-
let result = str::raw::from_c_multistring(ch as *libc::c_char, None);
199+
let mut curr_ptr: uint = ch as uint;
200+
let mut result = ~[];
201+
while(*(curr_ptr as *libc::c_char) != 0 as libc::c_char) {
202+
let env_pair = str::raw::from_c_str(
203+
curr_ptr as *libc::c_char);
204+
result.push(env_pair);
205+
curr_ptr +=
206+
libc::strlen(curr_ptr as *libc::c_char) as uint
207+
+ 1;
208+
}
200209
FreeEnvironmentStringsA(ch);
201210
result
202211
}

0 commit comments

Comments
 (0)