Skip to content

Commit 9284179

Browse files
committed
libstd: Switch off legacy modes in both core and std.
1 parent b787a26 commit 9284179

File tree

24 files changed

+108
-97
lines changed

24 files changed

+108
-97
lines changed

src/cargo/cargo.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ fn is_uuid(id: ~str) -> bool {
144144
if vec::len(parts) == 5u {
145145
let mut correct = 0u;
146146
for vec::eachi(parts) |i, part| {
147-
fn is_hex_digit(ch: char) -> bool {
147+
fn is_hex_digit(+ch: char) -> bool {
148148
('0' <= ch && ch <= '9') ||
149149
('a' <= ch && ch <= 'f') ||
150150
('A' <= ch && ch <= 'F')
@@ -402,7 +402,7 @@ fn need_dir(s: &Path) {
402402
}
403403

404404
fn valid_pkg_name(s: &str) -> bool {
405-
fn is_valid_digit(c: char) -> bool {
405+
fn is_valid_digit(+c: char) -> bool {
406406
('0' <= c && c <= '9') ||
407407
('a' <= c && c <= 'z') ||
408408
('A' <= c && c <= 'Z') ||

src/fuzzer/fuzzer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ fn under(n: uint, it: fn(uint)) {
221221
while i < n { it(i); i += 1u; }
222222
}
223223

224-
fn as_str(f: fn@(io::Writer)) -> ~str {
224+
fn as_str(f: fn@(+x: io::Writer)) -> ~str {
225225
io::with_str_writer(f)
226226
}
227227

src/libcore/cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#[abi = "rust-intrinsic"]
44
extern mod rusti {
55
fn forget<T>(-x: T);
6-
fn reinterpret_cast<T, U>(e: T) -> U;
6+
fn reinterpret_cast<T, U>(&&e: T) -> U;
77
}
88

99
/// Casts the value at `src` to U. The two types must have the same length.

src/libcore/comm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ will once again be the preferred module for intertask communication.
3333
*/
3434

3535
// NB: transitionary, de-mode-ing.
36-
#[forbid(deprecated_mode)];
36+
#[warn(deprecated_mode)];
3737
#[forbid(deprecated_pattern)];
3838

3939
use either::Either;
@@ -166,7 +166,7 @@ fn as_raw_port<T: Send, U>(ch: comm::Chan<T>, f: fn(*rust_port) -> U) -> U {
166166
* Constructs a channel. The channel is bound to the port used to
167167
* construct it.
168168
*/
169-
pub fn Chan<T: Send>(p: Port<T>) -> Chan<T> {
169+
pub fn Chan<T: Send>(&&p: Port<T>) -> Chan<T> {
170170
Chan_(rustrt::get_port_id((**p).po))
171171
}
172172

src/libcore/core.rc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ Implicitly, all crates behave as if they included the following prologue:
3636
// Don't link to core. We are core.
3737
#[no_core];
3838

39-
#[legacy_modes];
4039
#[legacy_exports];
4140

4241
#[warn(deprecated_mode)];

src/libcore/os.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ extern mod rustrt {
3535
fn rust_getcwd() -> ~str;
3636
fn rust_path_is_dir(path: *libc::c_char) -> c_int;
3737
fn rust_path_exists(path: *libc::c_char) -> c_int;
38-
fn rust_list_files(path: ~str) -> ~[~str];
38+
fn rust_list_files2(&&path: ~str) -> ~[~str];
3939
fn rust_process_wait(handle: c_int) -> c_int;
4040
fn last_os_error() -> ~str;
4141
fn rust_set_exit_status(code: libc::intptr_t);
@@ -582,7 +582,7 @@ pub fn list_dir(p: &Path) -> ~[~str] {
582582
#[cfg(windows)]
583583
fn star(p: &Path) -> Path { p.push("*") }
584584

585-
do rustrt::rust_list_files(star(p).to_str()).filter |filename| {
585+
do rustrt::rust_list_files2(star(p).to_str()).filter |filename| {
586586
*filename != ~"." && *filename != ~".."
587587
}
588588
}

src/libcore/ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ extern mod libc_ {
2121

2222
#[abi = "rust-intrinsic"]
2323
extern mod rusti {
24-
fn addr_of<T>(val: T) -> *T;
24+
fn addr_of<T>(&&val: T) -> *T;
2525
}
2626

2727
/// Get an unsafe pointer to a value

src/libcore/rand.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ enum rctx {}
1111
extern mod rustrt {
1212
fn rand_seed() -> ~[u8];
1313
fn rand_new() -> *rctx;
14-
fn rand_new_seeded(seed: ~[u8]) -> *rctx;
14+
fn rand_new_seeded2(&&seed: ~[u8]) -> *rctx;
1515
fn rand_next(c: *rctx) -> u32;
1616
fn rand_free(c: *rctx);
1717
}
@@ -276,7 +276,7 @@ pub fn Rng() -> Rng {
276276
* length.
277277
*/
278278
pub fn seeded_rng(seed: &~[u8]) -> Rng {
279-
@RandRes(rustrt::rand_new_seeded(*seed)) as Rng
279+
@RandRes(rustrt::rand_new_seeded2(*seed)) as Rng
280280
}
281281

282282
type XorShiftState = {

src/libcore/stackwalk.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#[doc(hidden)]; // FIXME #3538
22

33
// NB: transitionary, de-mode-ing.
4-
#[forbid(deprecated_mode)];
4+
// XXX: Can't do this because frame_address needs a deprecated mode.
5+
//#[forbid(deprecated_mode)];
56
#[forbid(deprecated_pattern)];
67

78
use cast::reinterpret_cast;
@@ -74,7 +75,7 @@ fn breakpoint() {
7475
rustrt::rust_dbg_breakpoint()
7576
}
7677

77-
fn frame_address(f: fn(*u8)) {
78+
fn frame_address(f: fn(++x: *u8)) {
7879
rusti::frame_address(f)
7980
}
8081

@@ -86,5 +87,5 @@ extern mod rustrt {
8687
#[abi = "rust-intrinsic"]
8788
extern mod rusti {
8889
#[legacy_exports];
89-
fn frame_address(f: fn(*u8));
90+
fn frame_address(f: fn(++x: *u8));
9091
}

src/libstd/ebml.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,11 +588,11 @@ impl EbmlDeserializer: serialization::Deserializer {
588588

589589
#[test]
590590
fn test_option_int() {
591-
fn serialize_1<S: serialization::Serializer>(s: S, v: int) {
591+
fn serialize_1<S: serialization::Serializer>(&&s: S, v: int) {
592592
s.emit_i64(v as i64);
593593
}
594594

595-
fn serialize_0<S: serialization::Serializer>(s: S, v: Option<int>) {
595+
fn serialize_0<S: serialization::Serializer>(&&s: S, v: Option<int>) {
596596
do s.emit_enum(~"core::option::t") {
597597
match v {
598598
None => s.emit_enum_variant(
@@ -606,11 +606,11 @@ fn test_option_int() {
606606
}
607607
}
608608

609-
fn deserialize_1<S: serialization::Deserializer>(s: S) -> int {
609+
fn deserialize_1<S: serialization::Deserializer>(&&s: S) -> int {
610610
s.read_i64() as int
611611
}
612612

613-
fn deserialize_0<S: serialization::Deserializer>(s: S) -> Option<int> {
613+
fn deserialize_0<S: serialization::Deserializer>(&&s: S) -> Option<int> {
614614
do s.read_enum(~"core::option::t") {
615615
do s.read_enum_variant |i| {
616616
match i {

0 commit comments

Comments
 (0)