Skip to content

Commit 852619d

Browse files
committed
Remove ++ mode from the compiler (it is parsed as + mode)
and obsolete `-` mode altogether (it *was* parsed as `+` mode).
1 parent efc7f82 commit 852619d

Some content is hidden

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

57 files changed

+89
-144
lines changed

src/libcore/cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub mod rusti {
1212
#[abi = "rust-intrinsic"]
1313
#[link_name = "rusti"]
1414
pub extern {
15-
fn forget<T>(-x: T);
15+
fn forget<T>(+x: T);
1616
fn reinterpret_cast<T, U>(&&e: T) -> U;
1717
}
1818
}

src/libcore/unstable/intrinsics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ pub extern {
3434

3535
pub fn size_of<T>() -> uint;
3636

37-
pub fn move_val<T>(dst: &mut T, -src: T);
38-
pub fn move_val_init<T>(dst: &mut T, -src: T);
37+
pub fn move_val<T>(dst: &mut T, +src: T);
38+
pub fn move_val_init<T>(dst: &mut T, +src: T);
3939

4040
pub fn min_align_of<T>() -> uint;
4141
pub fn pref_align_of<T>() -> uint;

src/librustc/back/link.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ pub fn build_link_meta(sess: Session, c: &ast::crate, output: &Path,
486486

487487
// This calculates CMH as defined above
488488
fn crate_meta_extras_hash(symbol_hasher: &hash::State,
489-
-cmh_items: ~[@ast::meta_item],
489+
+cmh_items: ~[@ast::meta_item],
490490
dep_hashes: ~[~str]) -> @str {
491491
fn len_and_str(s: &str) -> ~str {
492492
fmt!("%u_%s", s.len(), s)
@@ -535,7 +535,7 @@ pub fn build_link_meta(sess: Session, c: &ast::crate, output: &Path,
535535
name, default));
536536
}
537537

538-
fn crate_meta_name(sess: Session, output: &Path, -opt_name: Option<@str>)
538+
fn crate_meta_name(sess: Session, output: &Path, +opt_name: Option<@str>)
539539
-> @str {
540540
return match opt_name {
541541
Some(v) => v,

src/librustc/driver/driver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ pub fn pretty_print_input(sess: Session, +cfg: ast::crate_cfg, input: input,
440440
}
441441
}
442442
443-
pub fn get_os(triple: ~str) -> Option<session::os> {
443+
pub fn get_os(triple: &str) -> Option<session::os> {
444444
if str::contains(triple, ~"win32") ||
445445
str::contains(triple, ~"mingw32") {
446446
Some(session::os_win32)
@@ -455,7 +455,7 @@ pub fn get_os(triple: ~str) -> Option<session::os> {
455455
} else { None }
456456
}
457457

458-
pub fn get_arch(triple: ~str) -> Option<session::arch> {
458+
pub fn get_arch(triple: &str) -> Option<session::arch> {
459459
if str::contains(triple, ~"i386") ||
460460
str::contains(triple, ~"i486") ||
461461
str::contains(triple, ~"i586") ||

src/librustc/metadata/creader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ fn metas_with_ident(ident: @~str, +metas: ~[@ast::meta_item])
222222
metas_with(ident, @~"name", metas)
223223
}
224224

225-
fn existing_match(e: @mut Env, metas: ~[@ast::meta_item], hash: @~str)
225+
fn existing_match(e: @mut Env, metas: &[@ast::meta_item], hash: @~str)
226226
-> Option<int> {
227227
for e.crate_cache.each |c| {
228228
if loader::metadata_matches(*c.metas, metas)

src/librustc/metadata/decoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ pub fn maybe_get_item_ast(intr: @ident_interner, cdata: cmd, tcx: ty::ctxt,
560560
let item_path = item_path(intr, item_doc);
561561
vec::from_slice(item_path.init())
562562
};
563-
match decode_inlined_item(cdata, tcx, path, item_doc) {
563+
match decode_inlined_item(cdata, tcx, copy path, item_doc) {
564564
Some(ref ii) => csearch::found((/*bad*/copy *ii)),
565565
None => {
566566
match item_parent_item(item_doc) {

src/librustc/metadata/loader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ fn crate_matches(crate_data: @~[u8],
176176
metadata_matches(linkage_metas, metas)
177177
}
178178
179-
pub fn metadata_matches(extern_metas: ~[@ast::meta_item],
179+
pub fn metadata_matches(extern_metas: &[@ast::meta_item],
180180
local_metas: &[@ast::meta_item]) -> bool {
181181
182182
debug!("matching %u metadata requirements against %u items",

src/librustc/metadata/tydecode.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,6 @@ fn parse_mode(st: @mut PState) -> ast::mode {
427427
let m = ast::expl(match next(st) {
428428
'+' => ast::by_copy,
429429
'=' => ast::by_ref,
430-
'#' => ast::by_val,
431430
_ => fail!(~"bad mode")
432431
});
433432
return m;

src/librustc/metadata/tyencode.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ pub fn enc_mode(w: io::Writer, cx: @ctxt, m: mode) {
342342
match ty::resolved_mode(cx.tcx, m) {
343343
by_copy => w.write_char('+'),
344344
by_ref => w.write_char('='),
345-
by_val => w.write_char('#')
346345
}
347346
}
348347

src/librustc/middle/astencode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ pub fn encode_inlined_item(ecx: @e::EncodeContext,
105105
pub fn decode_inlined_item(cdata: @cstore::crate_metadata,
106106
tcx: ty::ctxt,
107107
maps: Maps,
108-
path: ast_map::path,
108+
+path: ast_map::path,
109109
par_doc: ebml::Doc)
110110
-> Option<ast::inlined_item> {
111111
let dcx = @DecodeContext {

0 commit comments

Comments
 (0)