Skip to content

Commit 1a1f687

Browse files
committed
---
yaml --- r: 83527 b: refs/heads/try c: d7e8f4c h: refs/heads/master i: 83525: d4ddbba 83523: 8a6efc4 83519: 549ba0e v: v3
1 parent 74b5fc9 commit 1a1f687

File tree

99 files changed

+322
-548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+322
-548
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: e699d914cd869ff51eaab37d0ace5e5b077e3355
5+
refs/heads/try: d7e8f4cb03e577169f78d57b74dc17877e1c96d3
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/mk/clean.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ clean-misc:
5454
$(Q)rm -Rf rust-stage0-*.tar.bz2 $(PKG_NAME)-*.tar.gz dist
5555
$(Q)rm -Rf $(foreach ext, \
5656
html aux cp fn ky log pdf pg toc tp vr cps, \
57-
$(wildcard doc/*.$(ext)))
58-
$(Q)find doc/std doc/extra -mindepth 1 | xargs rm -Rf
57+
$(wildcard doc/*.$(ext) \
58+
doc/*/*.$(ext) \
59+
doc/*/*/*.$(ext)))
5960
$(Q)rm -Rf doc/version.md
6061
$(Q)rm -Rf $(foreach sub, index styles files search javascript, \
6162
$(wildcard doc/*/$(sub)))

branches/try/src/libextra/base64.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl<'self> ToBase64 for &'self [u8] {
6868
*
6969
* fn main () {
7070
* let str = [52,32].to_base64(standard);
71-
* println!("{}", str);
71+
* printfln!("%s", str);
7272
* }
7373
* ```
7474
*/
@@ -177,11 +177,11 @@ impl<'self> FromBase64 for &'self str {
177177
*
178178
* fn main () {
179179
* let hello_str = "Hello, World".to_base64(standard);
180-
* println!("{}", hello_str);
180+
* printfln!("%s", hello_str);
181181
* let bytes = hello_str.from_base64();
182-
* println!("{:?}", bytes);
182+
* printfln!("%?", bytes);
183183
* let result_str = str::from_utf8(bytes);
184-
* println!("{}", result_str);
184+
* printfln!("%s", result_str);
185185
* }
186186
* ```
187187
*/

branches/try/src/libextra/future.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* # fn make_a_sandwich() {};
2020
* let mut delayed_fib = extra::future::spawn (|| fib(5000) );
2121
* make_a_sandwich();
22-
* println!("fib(5000) = {}", delayed_fib.get())
22+
* printfln!("fib(5000) = %?", delayed_fib.get())
2323
* ```
2424
*/
2525

branches/try/src/libextra/getopts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
//! }
4444
//!
4545
//! fn print_usage(program: &str, _opts: &[Opt]) {
46-
//! println!("Usage: {} [options]", program);
46+
//! printfln!("Usage: %s [options]", program);
4747
//! println("-o\t\tOutput");
4848
//! println("-h --help\tUsage");
4949
//! }

branches/try/src/libextra/hex.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl<'self> ToHex for &'self [u8] {
3333
*
3434
* fn main () {
3535
* let str = [52,32].to_hex();
36-
* println!("{}", str);
36+
* printfln!("%s", str);
3737
* }
3838
* ```
3939
*/
@@ -77,11 +77,11 @@ impl<'self> FromHex for &'self str {
7777
*
7878
* fn main () {
7979
* let hello_str = "Hello, World".to_hex();
80-
* println!("{}", hello_str);
80+
* printfln!("%s", hello_str);
8181
* let bytes = hello_str.from_hex().unwrap();
82-
* println!("{:?}", bytes);
82+
* printfln!("%?", bytes);
8383
* let result_str = str::from_utf8(bytes);
84-
* println!("{}", result_str);
84+
* printfln!("%s", result_str);
8585
* }
8686
* ```
8787
*/

branches/try/src/libextra/task_pool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,6 @@ fn test_task_pool() {
103103
};
104104
let mut pool = TaskPool::new(4, Some(SingleThreaded), f);
105105
do 8.times {
106-
pool.execute(|i| println!("Hello from thread {}!", *i));
106+
pool.execute(|i| printfln!("Hello from thread %u!", *i));
107107
}
108108
}

branches/try/src/librust/rust.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,13 @@ fn cmd_help(args: &[~str]) -> ValidUsage {
136136
match find_cmd(command_string) {
137137
Some(command) => {
138138
match command.action {
139-
CallMain(prog, _) => println!(
140-
"The {} command is an alias for the {} program.",
139+
CallMain(prog, _) => printfln!(
140+
"The %s command is an alias for the %s program.",
141141
command.cmd, prog),
142142
_ => ()
143143
}
144144
match command.usage_full {
145-
UsgStr(msg) => println!("{}\n", msg),
145+
UsgStr(msg) => printfln!("%s\n", msg),
146146
UsgCall(f) => f(),
147147
}
148148
Valid(0)
@@ -215,7 +215,7 @@ fn usage() {
215215

216216
for command in COMMANDS.iter() {
217217
let padding = " ".repeat(INDENT - command.cmd.len());
218-
println!(" {}{}{}", command.cmd, padding, command.usage_line);
218+
printfln!(" %s%s%s", command.cmd, padding, command.usage_line);
219219
}
220220

221221
io::print(

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,17 +1822,17 @@ pub fn encode_metadata(parms: EncodeParams, crate: &Crate) -> ~[u8] {
18221822
}
18231823

18241824
io::println("metadata stats:");
1825-
println!(" inline bytes: {}", ecx.stats.inline_bytes);
1826-
println!(" attribute bytes: {}", ecx.stats.attr_bytes);
1827-
println!(" dep bytes: {}", ecx.stats.dep_bytes);
1828-
println!(" lang item bytes: {}", ecx.stats.lang_item_bytes);
1829-
println!(" link args bytes: {}", ecx.stats.link_args_bytes);
1830-
println!(" impl bytes: {}", ecx.stats.impl_bytes);
1831-
println!(" misc bytes: {}", ecx.stats.misc_bytes);
1832-
println!(" item bytes: {}", ecx.stats.item_bytes);
1833-
println!(" index bytes: {}", ecx.stats.index_bytes);
1834-
println!(" zero bytes: {}", ecx.stats.zero_bytes);
1835-
println!(" total bytes: {}", ecx.stats.total_bytes);
1825+
printfln!(" inline bytes: %u", ecx.stats.inline_bytes);
1826+
printfln!(" attribute bytes: %u", ecx.stats.attr_bytes);
1827+
printfln!(" dep bytes: %u", ecx.stats.dep_bytes);
1828+
printfln!(" lang item bytes: %u", ecx.stats.lang_item_bytes);
1829+
printfln!(" link args bytes: %u", ecx.stats.link_args_bytes);
1830+
printfln!(" impl bytes: %u", ecx.stats.impl_bytes);
1831+
printfln!(" misc bytes: %u", ecx.stats.misc_bytes);
1832+
printfln!(" item bytes: %u", ecx.stats.item_bytes);
1833+
printfln!(" index bytes: %u", ecx.stats.index_bytes);
1834+
printfln!(" zero bytes: %u", ecx.stats.zero_bytes);
1835+
printfln!(" total bytes: %u", ecx.stats.total_bytes);
18361836
}
18371837

18381838
// Pad this, since something (LLVM, presumably) is cutting off the

branches/try/src/librustc/middle/borrowck/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,16 @@ pub fn check_crate(
100100

101101
if tcx.sess.borrowck_stats() {
102102
io::println("--- borrowck stats ---");
103-
println!("paths requiring guarantees: {}",
104-
bccx.stats.guaranteed_paths);
105-
println!("paths requiring loans : {}",
106-
make_stat(bccx, bccx.stats.loaned_paths_same));
107-
println!("paths requiring imm loans : {}",
108-
make_stat(bccx, bccx.stats.loaned_paths_imm));
109-
println!("stable paths : {}",
110-
make_stat(bccx, bccx.stats.stable_paths));
111-
println!("paths requiring purity : {}",
112-
make_stat(bccx, bccx.stats.req_pure_paths));
103+
printfln!("paths requiring guarantees: %u",
104+
bccx.stats.guaranteed_paths);
105+
printfln!("paths requiring loans : %s",
106+
make_stat(bccx, bccx.stats.loaned_paths_same));
107+
printfln!("paths requiring imm loans : %s",
108+
make_stat(bccx, bccx.stats.loaned_paths_imm));
109+
printfln!("stable paths : %s",
110+
make_stat(bccx, bccx.stats.stable_paths));
111+
printfln!("paths requiring purity : %s",
112+
make_stat(bccx, bccx.stats.req_pure_paths));
113113
}
114114

115115
return (bccx.root_map, bccx.write_guard_map);

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

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl Drop for _InsnCtxt {
121121
}
122122

123123
pub fn push_ctxt(s: &'static str) -> _InsnCtxt {
124-
debug2!("new InsnCtxt: {}", s);
124+
debug!("new InsnCtxt: %s", s);
125125
do local_data::modify(task_local_insn_key) |c| {
126126
do c.map_move |ctx| {
127127
let mut ctx = (*ctx).clone();
@@ -2544,10 +2544,6 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef {
25442544
llvm::LLVMAddGlobal(ccx.llmod, llty, buf)
25452545
};
25462546

2547-
if !*ccx.sess.building_library {
2548-
lib::llvm::SetLinkage(g, lib::llvm::InternalLinkage);
2549-
}
2550-
25512547
// Apply the `unnamed_addr` attribute if
25522548
// requested
25532549
if attr::contains_name(i.attrs,
@@ -3062,18 +3058,31 @@ pub fn write_metadata(cx: &mut CrateContext, crate: &ast::Crate) {
30623058
}
30633059
}
30643060

3065-
// Writes the current ABI version into the crate.
3066-
pub fn write_abi_version(ccx: &mut CrateContext) {
3061+
fn mk_global(ccx: &CrateContext,
3062+
name: &str,
3063+
llval: ValueRef,
3064+
internal: bool)
3065+
-> ValueRef {
30673066
unsafe {
3068-
let llval = C_uint(ccx, abi::abi_version);
3069-
let llglobal = do "rust_abi_version".with_c_str |buf| {
3067+
let llglobal = do name.with_c_str |buf| {
30703068
llvm::LLVMAddGlobal(ccx.llmod, val_ty(llval).to_ref(), buf)
30713069
};
30723070
llvm::LLVMSetInitializer(llglobal, llval);
30733071
llvm::LLVMSetGlobalConstant(llglobal, True);
3072+
3073+
if internal {
3074+
lib::llvm::SetLinkage(llglobal, lib::llvm::InternalLinkage);
3075+
}
3076+
3077+
return llglobal;
30743078
}
30753079
}
30763080

3081+
// Writes the current ABI version into the crate.
3082+
pub fn write_abi_version(ccx: &mut CrateContext) {
3083+
mk_global(ccx, "rust_abi_version", C_uint(ccx, abi::abi_version), false);
3084+
}
3085+
30773086
pub fn trans_crate(sess: session::Session,
30783087
crate: &ast::Crate,
30793088
analysis: &CrateAnalysis,
@@ -3147,30 +3156,30 @@ pub fn trans_crate(sess: session::Session,
31473156
write_metadata(ccx, crate);
31483157
if ccx.sess.trans_stats() {
31493158
io::println("--- trans stats ---");
3150-
println!("n_static_tydescs: {}", ccx.stats.n_static_tydescs);
3151-
println!("n_glues_created: {}", ccx.stats.n_glues_created);
3152-
println!("n_null_glues: {}", ccx.stats.n_null_glues);
3153-
println!("n_real_glues: {}", ccx.stats.n_real_glues);
3154-
3155-
println!("n_fns: {}", ccx.stats.n_fns);
3156-
println!("n_monos: {}", ccx.stats.n_monos);
3157-
println!("n_inlines: {}", ccx.stats.n_inlines);
3158-
println!("n_closures: {}", ccx.stats.n_closures);
3159+
printfln!("n_static_tydescs: %u", ccx.stats.n_static_tydescs);
3160+
printfln!("n_glues_created: %u", ccx.stats.n_glues_created);
3161+
printfln!("n_null_glues: %u", ccx.stats.n_null_glues);
3162+
printfln!("n_real_glues: %u", ccx.stats.n_real_glues);
3163+
3164+
printfln!("n_fns: %u", ccx.stats.n_fns);
3165+
printfln!("n_monos: %u", ccx.stats.n_monos);
3166+
printfln!("n_inlines: %u", ccx.stats.n_inlines);
3167+
printfln!("n_closures: %u", ccx.stats.n_closures);
31593168
io::println("fn stats:");
31603169
do sort::quick_sort(ccx.stats.fn_stats) |&(_, _, insns_a), &(_, _, insns_b)| {
31613170
insns_a > insns_b
31623171
}
31633172
for tuple in ccx.stats.fn_stats.iter() {
31643173
match *tuple {
31653174
(ref name, ms, insns) => {
3166-
println!("{} insns, {} ms, {}", insns, ms, *name);
3175+
printfln!("%u insns, %u ms, %s", insns, ms, *name);
31673176
}
31683177
}
31693178
}
31703179
}
31713180
if ccx.sess.count_llvm_insns() {
31723181
for (k, v) in ccx.stats.llvm_insns.iter() {
3173-
println!("{:7u} {}", *v, *k);
3182+
printfln!("%-7u %s", *v, *k);
31743183
}
31753184
}
31763185

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,8 @@ pub fn declare_tydesc(ccx: &mut CrateContext, t: ty::t) -> @mut tydesc_info {
646646
let llty = type_of(ccx, t);
647647

648648
if ccx.sess.count_type_sizes() {
649-
println!("{}\t{}", llsize_of_real(ccx, llty),
650-
ppaux::ty_to_str(ccx.tcx, t));
649+
printfln!("%u\t%s", llsize_of_real(ccx, llty),
650+
ppaux::ty_to_str(ccx.tcx, t));
651651
}
652652

653653
let has_header = match ty::get(t).sty {

branches/try/src/librustc/rustc.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,13 @@ pub fn version(argv0: &str) {
130130
Some(vers) => vers,
131131
None => "unknown version"
132132
};
133-
println!("{} {}", argv0, vers);
134-
println!("host: {}", host_triple());
133+
printfln!("%s %s", argv0, vers);
134+
printfln!("host: %s", host_triple());
135135
}
136136

137137
pub fn usage(argv0: &str) {
138138
let message = fmt!("Usage: %s [OPTIONS] INPUT", argv0);
139-
println!("{}\n\
139+
printfln!("%s\n\
140140
Additional help:
141141
-W help Print 'lint' options and default settings
142142
-Z help Print internal options for debugging rustc\n",
@@ -167,16 +167,16 @@ Available lint options:
167167
str::from_utf8(vec::from_elem(max - s.len(), ' ' as u8)) + s
168168
}
169169
println("\nAvailable lint checks:\n");
170-
println!(" {} {:7.7s} {}",
171-
padded(max_key, "name"), "default", "meaning");
172-
println!(" {} {:7.7s} {}\n",
173-
padded(max_key, "----"), "-------", "-------");
170+
printfln!(" %s %7.7s %s",
171+
padded(max_key, "name"), "default", "meaning");
172+
printfln!(" %s %7.7s %s\n",
173+
padded(max_key, "----"), "-------", "-------");
174174
for (spec, name) in lint_dict.move_iter() {
175175
let name = name.replace("_", "-");
176-
println!(" {} {:7.7s} {}",
177-
padded(max_key, name),
178-
lint::level_to_str(spec.default),
179-
spec.desc);
176+
printfln!(" %s %7.7s %s",
177+
padded(max_key, name),
178+
lint::level_to_str(spec.default),
179+
spec.desc);
180180
}
181181
io::println("");
182182
}
@@ -187,7 +187,7 @@ pub fn describe_debug_flags() {
187187
for tuple in r.iter() {
188188
match *tuple {
189189
(ref name, ref desc, _) => {
190-
println!(" -Z {:>20s} -- {}", *name, *desc);
190+
printfln!(" -Z %-20s -- %s", *name, *desc);
191191
}
192192
}
193193
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub fn time<T>(do_it: bool, what: ~str, thunk: &fn() -> T) -> T {
2222
let start = extra::time::precise_time_s();
2323
let rv = thunk();
2424
let end = extra::time::precise_time_s();
25-
println!("time: {:3.3f} s\t{}", end - start, what);
25+
printfln!("time: %3.3f s\t%s", end - start, what);
2626
rv
2727
}
2828

0 commit comments

Comments
 (0)