Skip to content

Commit dc1910f

Browse files
author
Brian J. Burg
committed
---
yaml --- r: 35061 b: refs/heads/master c: 37ed7fc h: refs/heads/master i: 35059: b6a1e3d v: v3
1 parent abedf9c commit dc1910f

File tree

31 files changed

+192
-223
lines changed

31 files changed

+192
-223
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 15a5d2ccbf2de7ac0bb4894a6885791fa1f23521
2+
refs/heads/master: 37ed7fcaae1477cd85985886b5f8a4514bf98d0e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024

trunk/src/libcore/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub pure fn get_ref<T>(opt: &r/Option<T>) -> &r/T {
8787

8888
pub pure fn expect<T>(opt: Option<T>, reason: ~str) -> T {
8989
/*!
90-
* Gets the value out of an option without copying, printing a
90+
* Gets the value out of an option without copying, printing a
9191
* specified message on failure.
9292
*
9393
* # Failure

trunk/src/libcore/result.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ pub pure fn to_either<T: Copy, U: Copy>(res: &Result<U, T>)
103103
* ok(parse_bytes(buf))
104104
* }
105105
*/
106-
pub fn chain<T, U: Copy, V: Copy>(res: Result<T, V>, op: fn(t: T)
106+
pub fn chain<T, U, V>(res: Result<T, V>, op: fn(t: T)
107107
-> Result<U, V>) -> Result<U, V> {
108108
match move res {
109109
Ok(move t) => op(move t),
110-
Err(move e) => Err(e)
110+
Err(move e) => Err(move e)
111111
}
112112
}
113113

@@ -119,13 +119,13 @@ pub fn chain<T, U: Copy, V: Copy>(res: Result<T, V>, op: fn(t: T)
119119
* immediately returned. This function can be used to pass through a
120120
* successful result while handling an error.
121121
*/
122-
pub fn chain_err<T: Copy, U: Copy, V: Copy>(
122+
pub fn chain_err<T, U, V>(
123123
res: Result<T, V>,
124124
op: fn(t: V) -> Result<T, U>)
125125
-> Result<T, U> {
126126
match move res {
127-
Ok(move t) => Ok(t),
128-
Err(move v) => op(v)
127+
Ok(move t) => Ok(move t),
128+
Err(move v) => op(move v)
129129
}
130130
}
131131

trunk/src/libfuzzer/fuzzer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ fn as_str(f: fn@(+x: io::Writer)) -> ~str {
225225
io::with_str_writer(f)
226226
}
227227

228-
fn check_variants_of_ast(crate: ast::crate, codemap: @codemap::CodeMap,
228+
fn check_variants_of_ast(crate: ast::crate, codemap: codemap::CodeMap,
229229
filename: &Path, cx: context) {
230230
let stolen = steal(crate, cx.mode);
231231
let extra_exprs = vec::filter(common_exprs(),
@@ -239,7 +239,7 @@ fn check_variants_of_ast(crate: ast::crate, codemap: @codemap::CodeMap,
239239

240240
fn check_variants_T<T: Copy>(
241241
crate: ast::crate,
242-
codemap: @codemap::CodeMap,
242+
codemap: codemap::CodeMap,
243243
filename: &Path,
244244
thing_label: ~str,
245245
things: ~[T],

trunk/src/librustc/driver/driver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ fn build_session_options(binary: ~str,
574574

575575
fn build_session(sopts: @session::options,
576576
demitter: diagnostic::emitter) -> Session {
577-
let codemap = @codemap::new_codemap();
577+
let codemap = codemap::new_codemap();
578578
let diagnostic_handler =
579579
diagnostic::mk_handler(Some(demitter));
580580
let span_diagnostic_handler =
@@ -583,7 +583,7 @@ fn build_session(sopts: @session::options,
583583
}
584584

585585
fn build_session_(sopts: @session::options,
586-
cm: @codemap::CodeMap,
586+
cm: codemap::CodeMap,
587587
demitter: diagnostic::emitter,
588588
span_diagnostic_handler: diagnostic::span_handler)
589589
-> Session {

trunk/src/librustc/driver/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ type Session_ = {targ_cfg: @config,
131131
opts: @options,
132132
cstore: metadata::cstore::CStore,
133133
parse_sess: parse_sess,
134-
codemap: @codemap::CodeMap,
134+
codemap: codemap::CodeMap,
135135
// For a library crate, this is always none
136136
mut main_fn: Option<(node_id, codemap::span)>,
137137
span_diagnostic: diagnostic::span_handler,

trunk/src/librustc/metadata/csearch.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,7 @@ fn get_type_param_count(cstore: cstore::CStore, def: ast::def_id) -> uint {
6363
fn each_path(cstore: cstore::CStore, cnum: ast::crate_num,
6464
f: fn(decoder::path_entry) -> bool) {
6565
let crate_data = cstore::get_crate_data(cstore, cnum);
66-
let get_crate_data: decoder::GetCrateDataCb = |cnum| {
67-
cstore::get_crate_data(cstore, cnum)
68-
};
69-
decoder::each_path(cstore.intr, crate_data, get_crate_data, f);
66+
decoder::each_path(cstore.intr, crate_data, f);
7067
}
7168

7269
fn get_item_path(tcx: ty::ctxt, def: ast::def_id) -> ast_map::path {

trunk/src/librustc/metadata/cstore.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,7 @@ fn get_crate_vers(cstore: CStore, cnum: ast::crate_num) -> ~str {
9898
fn set_crate_data(cstore: CStore, cnum: ast::crate_num,
9999
data: crate_metadata) {
100100
p(cstore).metas.insert(cnum, data);
101-
let get_crate_data: decoder::GetCrateDataCb = |cnum| {
102-
cstore::get_crate_data(cstore, cnum)
103-
};
104-
for vec::each(decoder::get_crate_module_paths(cstore.intr, data,
105-
get_crate_data)) |dp| {
101+
for vec::each(decoder::get_crate_module_paths(cstore.intr, data)) |dp| {
106102
let (did, path) = *dp;
107103
let d = {crate: cnum, node: did.node};
108104
p(cstore).mod_path_map.insert(d, @path);

trunk/src/librustc/metadata/decoder.rs

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export item_type; // sketchy
6060
export maybe_get_item_ast;
6161
export decode_inlined_item;
6262
export method_info, _impl;
63-
export GetCrateDataCb;
6463

6564
// Used internally by astencode:
6665
export translate_def_id;
@@ -89,8 +88,6 @@ fn lookup_hash(d: ebml::Doc, eq_fn: fn(x:&[u8]) -> bool, hash: uint) ->
8988
None
9089
}
9190

92-
pub type GetCrateDataCb = &fn(ast::crate_num) -> cmd;
93-
9491
fn maybe_find_item(item_id: int, items: ebml::Doc) -> Option<ebml::Doc> {
9592
fn eq_item(bytes: &[u8], item_id: int) -> bool {
9693
return io::u64_from_be_bytes(vec::view(bytes, 0u, 4u), 0u, 4u) as int
@@ -480,9 +477,7 @@ fn path_entry(path_string: ~str, def_like: def_like) -> path_entry {
480477
}
481478

482479
/// Iterates over all the paths in the given crate.
483-
fn each_path(intr: @ident_interner, cdata: cmd,
484-
get_crate_data: GetCrateDataCb,
485-
f: fn(path_entry) -> bool) {
480+
fn each_path(intr: @ident_interner, cdata: cmd, f: fn(path_entry) -> bool) {
486481
let root = ebml::Doc(cdata.data);
487482
let items = ebml::get_doc(root, tag_items);
488483
let items_data = ebml::get_doc(items, tag_items_data);
@@ -531,17 +526,8 @@ fn each_path(intr: @ident_interner, cdata: cmd,
531526
reexport_path = path + ~"::" + reexport_name;
532527
}
533528

534-
// This reexport may be in yet another crate
535-
let other_crates_items = if def_id.crate == cdata.cnum {
536-
items
537-
} else {
538-
let crate_data = get_crate_data(def_id.crate);
539-
let root = ebml::Doc(crate_data.data);
540-
ebml::get_doc(root, tag_items)
541-
};
542-
543529
// Get the item.
544-
match maybe_find_item(def_id.node, other_crates_items) {
530+
match maybe_find_item(def_id.node, items) {
545531
None => {}
546532
Some(item_doc) => {
547533
// Construct the def for this item.
@@ -1093,10 +1079,9 @@ fn get_crate_vers(data: @~[u8]) -> ~str {
10931079
};
10941080
}
10951081

1096-
fn iter_crate_items(intr: @ident_interner, cdata: cmd,
1097-
get_crate_data: GetCrateDataCb,
1098-
proc: fn(~str, ast::def_id)) {
1099-
for each_path(intr, cdata, get_crate_data) |path_entry| {
1082+
fn iter_crate_items(intr: @ident_interner,
1083+
cdata: cmd, proc: fn(~str, ast::def_id)) {
1084+
for each_path(intr, cdata) |path_entry| {
11001085
match path_entry.def_like {
11011086
dl_impl(*) | dl_field => {}
11021087
dl_def(def) => {
@@ -1106,8 +1091,7 @@ fn iter_crate_items(intr: @ident_interner, cdata: cmd,
11061091
}
11071092
}
11081093

1109-
fn get_crate_module_paths(intr: @ident_interner, cdata: cmd,
1110-
get_crate_data: GetCrateDataCb)
1094+
fn get_crate_module_paths(intr: @ident_interner, cdata: cmd)
11111095
-> ~[(ast::def_id, ~str)] {
11121096
fn mod_of_path(p: ~str) -> ~str {
11131097
str::connect(vec::init(str::split_str(p, ~"::")), ~"::")
@@ -1117,7 +1101,7 @@ fn get_crate_module_paths(intr: @ident_interner, cdata: cmd,
11171101
// fowarded path due to renamed import or reexport
11181102
let mut res = ~[];
11191103
let mods = map::HashMap();
1120-
do iter_crate_items(intr, cdata, get_crate_data) |path, did| {
1104+
do iter_crate_items(intr, cdata) |path, did| {
11211105
let m = mod_of_path(path);
11221106
if str::is_not_empty(m) {
11231107
// if m has a sub-item, it must be a module

trunk/src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2436,10 +2436,7 @@ fn gather_local_rtcalls(ccx: @crate_ctxt, crate: @ast::crate) {
24362436

24372437
fn gather_external_rtcalls(ccx: @crate_ctxt) {
24382438
do cstore::iter_crate_data(ccx.sess.cstore) |_cnum, cmeta| {
2439-
let get_crate_data: decoder::GetCrateDataCb = |cnum| {
2440-
cstore::get_crate_data(ccx.sess.cstore, cnum)
2441-
};
2442-
do decoder::each_path(ccx.sess.intr(), cmeta, get_crate_data) |path| {
2439+
do decoder::each_path(ccx.sess.intr(), cmeta) |path| {
24432440
let pathname = path.path_string;
24442441
match path.def_like {
24452442
decoder::dl_def(d) => {

trunk/src/librustc/middle/trans/debuginfo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ fn create_file(cx: @crate_ctxt, full_path: ~str) -> @metadata<file_md> {
229229
return mdval;
230230
}
231231

232-
fn line_from_span(cm: @codemap::CodeMap, sp: span) -> uint {
232+
fn line_from_span(cm: codemap::CodeMap, sp: span) -> uint {
233233
codemap::lookup_char_pos(cm, sp.lo).line
234234
}
235235

trunk/src/librustc/rustc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ fn monitor(+f: fn~(diagnostic::emitter)) {
193193
194194
// The 'diagnostics emitter'. Every error, warning, etc. should
195195
// go through this function.
196-
let demitter = fn@(cmsp: Option<(@codemap::CodeMap, codemap::span)>,
196+
let demitter = fn@(cmsp: Option<(codemap::CodeMap, codemap::span)>,
197197
msg: &str, lvl: diagnostic::level) {
198198
if lvl == diagnostic::fatal {
199199
comm::send(ch, fatal);

trunk/src/librustdoc/astsrv.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ fn build_ctxt(sess: Session,
120120

121121
fn build_session() -> Session {
122122
let sopts: @options = basic_options();
123-
let codemap = @codemap::new_codemap();
123+
let codemap = codemap::new_codemap();
124124
let error_handlers = build_error_handlers(codemap);
125125
let {emitter, span_handler} = error_handlers;
126126

@@ -137,7 +137,7 @@ type ErrorHandlers = {
137137
// Build a custom error handler that will allow us to ignore non-fatal
138138
// errors
139139
fn build_error_handlers(
140-
codemap: @codemap::CodeMap
140+
codemap: codemap::CodeMap
141141
) -> ErrorHandlers {
142142

143143
type DiagnosticHandler = {
@@ -156,13 +156,13 @@ fn build_error_handlers(
156156
fn note(msg: &str) { self.inner.note(msg) }
157157
fn bug(msg: &str) -> ! { self.inner.bug(msg) }
158158
fn unimpl(msg: &str) -> ! { self.inner.unimpl(msg) }
159-
fn emit(cmsp: Option<(@codemap::CodeMap, codemap::span)>,
159+
fn emit(cmsp: Option<(codemap::CodeMap, codemap::span)>,
160160
msg: &str, lvl: diagnostic::level) {
161161
self.inner.emit(cmsp, msg, lvl)
162162
}
163163
}
164164

165-
let emitter = fn@(cmsp: Option<(@codemap::CodeMap, codemap::span)>,
165+
let emitter = fn@(cmsp: Option<(codemap::CodeMap, codemap::span)>,
166166
msg: &str, lvl: diagnostic::level) {
167167
diagnostic::emit(cmsp, msg, lvl);
168168
};

trunk/src/libstd/net_tcp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,7 @@ mod test {
15861586
// client
15871587
log(debug, ~"server started, firing up client..");
15881588
let server_addr = ip::v4::parse_addr(server_ip);
1589-
let conn_result = connect(move server_addr, server_port, hl_loop);
1589+
let conn_result = connect(server_addr, server_port, hl_loop);
15901590
if result::is_err(&conn_result) {
15911591
assert false;
15921592
}

trunk/src/libsyntax/ast_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pure fn dummy_spanned<T>(+t: T) -> spanned<T> {
1515

1616
/* assuming that we're not in macro expansion */
1717
pure fn mk_sp(lo: uint, hi: uint) -> span {
18-
span {lo: lo, hi: hi, expn_info: None}
18+
{lo: lo, hi: hi, expn_info: None}
1919
}
2020

2121
// make this a const, once the compiler supports it

0 commit comments

Comments
 (0)