Skip to content

Commit a5e0992

Browse files
committed
---
yaml --- r: 50045 b: refs/heads/auto c: 3fac7cc h: refs/heads/master i: 50043: ca79b17 v: v3
1 parent dfb1885 commit a5e0992

Some content is hidden

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

71 files changed

+660
-937
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: f3c879fdd8aad67cf4f6edd3aacb0189c284c920
17+
refs/heads/auto: 3fac7cce8fb3fb50328e2c2051532361d7d25aaf
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167

branches/auto/src/compiletest/runtest.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,19 +208,18 @@ actual:\n\
208208
testfile: &Path, src: ~str) -> ProcRes {
209209
compose_and_run_compiler(
210210
config, props, testfile,
211-
make_typecheck_args(config, props, testfile),
211+
make_typecheck_args(config, testfile),
212212
Some(src))
213213
}
214214

215-
fn make_typecheck_args(config: config, props: TestProps, testfile: &Path) -> ProcArgs {
215+
fn make_typecheck_args(config: config, testfile: &Path) -> ProcArgs {
216216
let prog = config.rustc_path;
217217
let mut args = ~[~"-",
218218
~"--no-trans", ~"--lib",
219219
~"-L", config.build_base.to_str(),
220220
~"-L",
221221
aux_output_dir_name(config, testfile).to_str()];
222222
args += split_maybe_args(config.rustcflags);
223-
args += split_maybe_args(props.compile_flags);
224223
return ProcArgs {prog: prog.to_str(), args: args};
225224
}
226225
}

branches/auto/src/libcore/libc.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,8 +1221,9 @@ pub mod funcs {
12211221
#[nolink]
12221222
#[abi = "cdecl"]
12231223
pub mod fcntl {
1224-
use libc::types::os::arch::c95::{c_int, c_char};
12251224
pub extern {
1225+
use libc::types::os::arch::c95::{c_int, c_char};
1226+
12261227
#[link_name = "_open"]
12271228
unsafe fn open(path: *c_char, oflag: c_int, mode: c_int)
12281229
-> c_int;
@@ -1561,11 +1562,11 @@ pub mod funcs {
15611562
#[cfg(target_os = "macos")]
15621563
#[cfg(target_os = "freebsd")]
15631564
pub mod bsd44 {
1564-
use libc::types::common::c95::{c_void};
1565-
use libc::types::os::arch::c95::{c_char, c_int, c_uint, size_t};
1566-
15671565
#[abi = "cdecl"]
15681566
pub extern {
1567+
use libc::types::common::c95::{c_void};
1568+
use libc::types::os::arch::c95::{c_char, c_int, c_uint, size_t};
1569+
15691570
unsafe fn sysctl(name: *c_int, namelen: c_uint,
15701571
oldp: *mut c_void, oldlenp: *mut size_t,
15711572
newp: *c_void, newlen: size_t) -> c_int;

branches/auto/src/libcore/rt/env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ pub fn get() -> &Environment {
4444

4545
extern {
4646
fn rust_get_rt_env() -> &Environment;
47-
}
47+
}

branches/auto/src/libcore/rt/sched.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ enum CleanupJob {
7070

7171
pub impl Scheduler {
7272

73-
static pub fn new(event_loop: ~EventLoopObject) -> Scheduler {
73+
static fn new(event_loop: ~EventLoopObject) -> Scheduler {
7474
Scheduler {
7575
event_loop: event_loop,
7676
task_queue: WorkQueue::new(),
@@ -296,7 +296,7 @@ pub struct Task {
296296
}
297297

298298
impl Task {
299-
static pub fn new(stack_pool: &mut StackPool, start: ~fn()) -> Task {
299+
static fn new(stack_pool: &mut StackPool, start: ~fn()) -> Task {
300300
// XXX: Putting main into a ~ so it's a thin pointer and can
301301
// be passed to the spawn function. Another unfortunate
302302
// allocation

branches/auto/src/libcore/rt/stack.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ pub impl StackSegment {
3737
pub struct StackPool(());
3838

3939
impl StackPool {
40-
static pub fn new() -> StackPool { StackPool(()) }
40+
41+
static fn new() -> StackPool { StackPool(()) }
4142

4243
fn take_segment(&self, min_size: uint) -> StackSegment {
4344
StackSegment::new(min_size)

branches/auto/src/libcore/rt/thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct Thread {
2020
}
2121

2222
impl Thread {
23-
static pub fn start(main: ~fn()) -> Thread {
23+
static fn start(main: ~fn()) -> Thread {
2424
fn substart(main: &fn()) -> *raw_thread {
2525
unsafe { rust_raw_thread_start(&main) }
2626
}

branches/auto/src/libcore/task/rt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub type rust_task = libc::c_void;
3030
#[allow(non_camel_case_types)] // runtime type
3131
pub type rust_closure = libc::c_void;
3232

33-
pub extern {
33+
extern {
3434
#[rust_stack]
3535
fn rust_task_yield(task: *rust_task) -> bool;
3636

branches/auto/src/librustc/back/link.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,7 @@ pub mod write {
190190
let opts = sess.opts;
191191
if sess.time_llvm_passes() { llvm::LLVMRustEnableTimePasses(); }
192192
let mut pm = mk_pass_manager();
193-
let td = mk_target_data(
194-
/*bad*/copy sess.targ_cfg.target_strs.data_layout);
193+
let td = mk_target_data(sess.targ_cfg.target_strs.data_layout);
195194
llvm::LLVMAddTargetData(td.lltd, pm.llpm);
196195
// FIXME (#2812): run the linter here also, once there are llvm-c
197196
// bindings for it.
@@ -834,8 +833,9 @@ pub fn link_binary(sess: Session,
834833
// to be found at compile time so it is still entirely up to outside
835834
// forces to make sure that library can be found at runtime.
836835

837-
let addl_paths = /*bad*/copy sess.opts.addl_lib_search_paths;
838-
for addl_paths.each |path| { cc_args.push(~"-L" + path.to_str()); }
836+
for sess.opts.addl_lib_search_paths.each |path| {
837+
cc_args.push(~"-L" + path.to_str());
838+
}
839839

840840
// The names of the extern libraries
841841
let used_libs = cstore::get_used_libraries(cstore);

branches/auto/src/librustc/back/rpath.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ pub fn get_rpath_flags(sess: session::Session, out_filename: &Path)
4545
// where rustrt is and we know every rust program needs it
4646
let libs = vec::append_one(libs, get_sysroot_absolute_rt_lib(sess));
4747

48-
let target_triple = /*bad*/copy sess.opts.target_triple;
49-
let rpaths = get_rpaths(os, &sysroot, output, libs, target_triple);
48+
let rpaths = get_rpaths(os, &sysroot, output, libs,
49+
sess.opts.target_triple);
5050
rpaths_to_flags(rpaths)
5151
}
5252

@@ -140,8 +140,8 @@ pub fn get_relative_to(abs1: &Path, abs2: &Path) -> Path {
140140
let abs2 = abs2.normalize();
141141
debug!("finding relative path from %s to %s",
142142
abs1.to_str(), abs2.to_str());
143-
let split1 = /*bad*/copy abs1.components;
144-
let split2 = /*bad*/copy abs2.components;
143+
let split1: &[~str] = abs1.components;
144+
let split2: &[~str] = abs2.components;
145145
let len1 = vec::len(split1);
146146
let len2 = vec::len(split2);
147147
fail_unless!(len1 > 0);

branches/auto/src/librustc/driver/driver.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,12 @@ pub fn build_configuration(sess: Session, +argv0: ~str, input: input) ->
132132
}
133133

134134
// Convert strings provided as --cfg [cfgspec] into a crate_cfg
135-
fn parse_cfgspecs(cfgspecs: ~[~str],
135+
fn parse_cfgspecs(+cfgspecs: ~[~str],
136136
demitter: diagnostic::Emitter) -> ast::crate_cfg {
137-
let mut meta = ~[];
138-
for cfgspecs.each |s| {
137+
do vec::map_consume(cfgspecs) |s| {
139138
let sess = parse::new_parse_sess(Some(demitter));
140-
let m = parse::parse_meta_from_source_str(~"cfgspec", @/*bad*/ copy *s, ~[], sess);
141-
meta.push(m)
139+
parse::parse_meta_from_source_str(~"cfgspec", @s, ~[], sess)
142140
}
143-
return meta;
144141
}
145142

146143
pub enum input {
@@ -566,9 +563,9 @@ pub fn build_session_options(+binary: ~str,
566563
let debug_map = session::debugging_opts_map();
567564
for debug_flags.each |debug_flag| {
568565
let mut this_bit = 0u;
569-
for debug_map.each |pair| {
570-
let (name, _, bit) = /*bad*/copy *pair;
571-
if name == *debug_flag { this_bit = bit; break; }
566+
for debug_map.each |tuple| {
567+
let (name, bit) = match *tuple { (ref a, _, b) => (a, b) };
568+
if name == debug_flag { this_bit = bit; break; }
572569
}
573570
if this_bit == 0u {
574571
early_error(demitter, fmt!("unknown debug flag: %s", *debug_flag))
@@ -633,7 +630,7 @@ pub fn build_session_options(+binary: ~str,
633630
let target =
634631
match target_opt {
635632
None => host_triple(),
636-
Some(ref s) => (/*bad*/copy *s)
633+
Some(s) => s
637634
};
638635
639636
let addl_lib_search_paths =

branches/auto/src/librustc/front/config.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -185,19 +185,18 @@ pub fn metas_in_cfg(cfg: ast::crate_cfg,
185185
// Pull the inner meta_items from the #[cfg(meta_item, ...)] attributes,
186186
// so we can match against them. This is the list of configurations for
187187
// which the item is valid
188-
let cfg_metas = vec::filter_map(cfg_metas, |i| attr::get_meta_item_list(i));
189-
190-
if cfg_metas.all(|c| c.is_empty()) { return true; }
191-
192-
cfg_metas.any(|cfg_meta| {
193-
cfg_meta.all(|cfg_mi| {
194-
match cfg_mi.node {
195-
ast::meta_list(s, ref it) if *s == ~"not"
196-
=> it.all(|mi| !attr::contains(cfg, *mi)),
197-
_ => attr::contains(cfg, *cfg_mi)
198-
}
199-
})
200-
})
188+
let cfg_metas =
189+
vec::concat(
190+
vec::filter_map(cfg_metas, |i| attr::get_meta_item_list(i)));
191+
192+
let has_cfg_metas = vec::len(cfg_metas) > 0u;
193+
if !has_cfg_metas { return true; }
194+
195+
for cfg_metas.each |cfg_mi| {
196+
if attr::contains(cfg, *cfg_mi) { return true; }
197+
}
198+
199+
return false;
201200
}
202201

203202

branches/auto/src/librustc/lib/llvm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,7 @@ pub struct TargetData {
16471647
dtor: @target_data_res
16481648
}
16491649

1650-
pub fn mk_target_data(string_rep: ~str) -> TargetData {
1650+
pub fn mk_target_data(string_rep: &str) -> TargetData {
16511651
let lltd =
16521652
str::as_c_str(string_rep, |buf| unsafe {
16531653
llvm::LLVMCreateTargetData(buf)

branches/auto/src/librustc/metadata/creader.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ fn visit_crate(e: @mut Env, c: ast::crate) {
142142
}
143143

144144
fn visit_view_item(e: @mut Env, i: @ast::view_item) {
145-
match /*bad*/copy i.node {
146-
ast::view_item_extern_mod(ident, meta_items, id) => {
145+
match i.node {
146+
ast::view_item_extern_mod(ident, /*bad*/copy meta_items, id) => {
147147
debug!("resolving extern mod stmt. ident: %?, meta: %?",
148148
ident, meta_items);
149149
let cnum = resolve_crate(e, ident, meta_items, @~"", i.span);
@@ -154,8 +154,8 @@ fn visit_view_item(e: @mut Env, i: @ast::view_item) {
154154
}
155155

156156
fn visit_item(e: @mut Env, i: @ast::item) {
157-
match /*bad*/copy i.node {
158-
ast::item_foreign_mod(fm) => {
157+
match i.node {
158+
ast::item_foreign_mod(ref fm) => {
159159
match attr::foreign_abi(i.attrs) {
160160
either::Right(abi) => {
161161
if abi != ast::foreign_abi_cdecl &&

branches/auto/src/librustc/metadata/decoder.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ fn item_family(item: ebml::Doc) -> Family {
146146

147147
fn item_visibility(item: ebml::Doc) -> ast::visibility {
148148
let visibility = reader::get_doc(item, tag_items_data_item_visibility);
149-
debug!("item visibility for %?", item_family(item));
150149
match reader::doc_as_u8(visibility) as char {
151150
'y' => ast::public,
152151
'n' => ast::private,

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

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ fn encode_info_for_item(ecx: @EncodeContext, ebml_w: writer::Encoder,
645645
debug!("encoding info for item at %s",
646646
ecx.tcx.sess.codemap.span_to_str(item.span));
647647
648-
match /*bad*/copy item.node {
648+
match item.node {
649649
item_const(_, _) => {
650650
add_to_index();
651651
ebml_w.start_tag(tag_items_data_item);
@@ -896,7 +896,6 @@ fn encode_info_for_item(ecx: @EncodeContext, ebml_w: writer::Encoder,
896896
encode_family(ebml_w, purity_fn_family(mty.fty.purity));
897897
encode_self_type(ebml_w, mty.self_ty);
898898
encode_method_sort(ebml_w, 'r');
899-
encode_visibility(ebml_w, ast::public);
900899
ebml_w.end_tag();
901900
}
902901
provided(m) => {
@@ -912,7 +911,6 @@ fn encode_info_for_item(ecx: @EncodeContext, ebml_w: writer::Encoder,
912911
encode_family(ebml_w, purity_fn_family(mty.fty.purity));
913912
encode_self_type(ebml_w, mty.self_ty);
914913
encode_method_sort(ebml_w, 'p');
915-
encode_visibility(ebml_w, m.vis);
916914
ebml_w.end_tag();
917915
}
918916
}
@@ -947,11 +945,6 @@ fn encode_info_for_item(ecx: @EncodeContext, ebml_w: writer::Encoder,
947945
let mut m_path = vec::append(~[], path); // :-(
948946
m_path += [ast_map::path_name(item.ident)];
949947
encode_path(ecx, ebml_w, m_path, ast_map::path_name(ty_m.ident));
950-
951-
// For now, use the item visibility until trait methods can have
952-
// real visibility in the AST.
953-
encode_visibility(ebml_w, item.vis);
954-
955948
ebml_w.end_tag();
956949
}
957950
@@ -1040,7 +1033,7 @@ fn encode_info_for_items(ecx: @EncodeContext, ebml_w: writer::Encoder,
10401033
|ni, cx, v| {
10411034
visit::visit_foreign_item(ni, cx, v);
10421035
match ecx.tcx.items.get(&ni.id) {
1043-
ast_map::node_foreign_item(_, abi, _, pt) => {
1036+
ast_map::node_foreign_item(_, abi, pt) => {
10441037
encode_info_for_foreign_item(ecx, ebml_w, ni,
10451038
index, /*bad*/copy *pt,
10461039
abi);
@@ -1196,10 +1189,10 @@ fn synthesize_crate_attrs(ecx: @EncodeContext,
11961189
if *attr::get_attr_name(attr) != ~"link" {
11971190
/*bad*/copy *attr
11981191
} else {
1199-
match /*bad*/copy attr.node.value.node {
1200-
meta_list(_, l) => {
1192+
match attr.node.value.node {
1193+
meta_list(_, ref l) => {
12011194
found_link_attr = true;;
1202-
synthesize_link_attr(ecx, l)
1195+
synthesize_link_attr(ecx, /*bad*/copy *l)
12031196
}
12041197
_ => /*bad*/copy *attr
12051198
}

branches/auto/src/librustc/middle/astencode.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -639,14 +639,14 @@ fn encode_vtable_origin(ecx: @e::EncodeContext,
639639
ebml_w: writer::Encoder,
640640
vtable_origin: typeck::vtable_origin) {
641641
do ebml_w.emit_enum(~"vtable_origin") {
642-
match /*bad*/copy vtable_origin {
643-
typeck::vtable_static(def_id, tys, vtable_res) => {
642+
match vtable_origin {
643+
typeck::vtable_static(def_id, ref tys, vtable_res) => {
644644
do ebml_w.emit_enum_variant(~"vtable_static", 0u, 3u) {
645645
do ebml_w.emit_enum_variant_arg(0u) {
646646
ebml_w.emit_def_id(def_id)
647647
}
648648
do ebml_w.emit_enum_variant_arg(1u) {
649-
ebml_w.emit_tys(ecx, /*bad*/copy tys);
649+
ebml_w.emit_tys(ecx, /*bad*/copy *tys);
650650
}
651651
do ebml_w.emit_enum_variant_arg(2u) {
652652
encode_vtable_res(ecx, ebml_w, vtable_res);

branches/auto/src/librustc/middle/borrowck/gather_loans.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ fn req_loans_in_expr(ex: @ast::expr,
139139
}
140140

141141
// Special checks for various kinds of expressions:
142-
match /*bad*/copy ex.node {
142+
match ex.node {
143143
ast::expr_addr_of(mutbl, base) => {
144144
let base_cmt = self.bccx.cat_expr(base);
145145

@@ -150,10 +150,10 @@ fn req_loans_in_expr(ex: @ast::expr,
150150
visit::visit_expr(ex, self, vt);
151151
}
152152

153-
ast::expr_call(f, args, _) => {
153+
ast::expr_call(f, ref args, _) => {
154154
let arg_tys = ty::ty_fn_args(ty::expr_ty(self.tcx(), f));
155155
let scope_r = ty::re_scope(ex.id);
156-
for vec::each2(args, arg_tys) |arg, arg_ty| {
156+
for vec::each2(*args, arg_tys) |arg, arg_ty| {
157157
match ty::resolved_mode(self.tcx(), arg_ty.mode) {
158158
ast::by_ref => {
159159
let arg_cmt = self.bccx.cat_expr(*arg);
@@ -165,11 +165,11 @@ fn req_loans_in_expr(ex: @ast::expr,
165165
visit::visit_expr(ex, self, vt);
166166
}
167167

168-
ast::expr_method_call(rcvr, _, _, args, _) => {
168+
ast::expr_method_call(rcvr, _, _, ref args, _) => {
169169
let arg_tys = ty::ty_fn_args(ty::node_id_to_type(self.tcx(),
170170
ex.callee_id));
171171
let scope_r = ty::re_scope(ex.id);
172-
for vec::each2(args, arg_tys) |arg, arg_ty| {
172+
for vec::each2(*args, arg_tys) |arg, arg_ty| {
173173
match ty::resolved_mode(self.tcx(), arg_ty.mode) {
174174
ast::by_ref => {
175175
let arg_cmt = self.bccx.cat_expr(*arg);

0 commit comments

Comments
 (0)