Skip to content

Commit 6f6c724

Browse files
committed
---
yaml --- r: 23335 b: refs/heads/master c: aa3df17 h: refs/heads/master i: 23333: d2b64bb 23331: e5550aa 23327: da382bd v: v3
1 parent 2471a1a commit 6f6c724

File tree

4 files changed

+36
-42
lines changed

4 files changed

+36
-42
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: 77ef394d72bf2d60117635fe6198878269e5bfc9
2+
refs/heads/master: aa3df1744515addf2dc58d45e6f082c10a279629
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/src/libcore/os.rs

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
* to write OS-ignorant code by default.
1717
*/
1818

19-
#[forbid(deprecated_mode)];
20-
#[forbid(deprecated_pattern)];
21-
2219
import libc::{c_char, c_void, c_int, c_uint, size_t, ssize_t,
2320
mode_t, pid_t, FILE};
2421
import libc::{close, fclose};
@@ -56,7 +53,7 @@ extern mod rustrt {
5653

5754
const tmpbuf_sz : uint = 1000u;
5855

59-
fn as_c_charp<T>(+s: ~str, f: fn(*c_char) -> T) -> T {
56+
fn as_c_charp<T>(s: ~str, f: fn(*c_char) -> T) -> T {
6057
str::as_c_str(s, |b| f(b as *c_char))
6158
}
6259

@@ -106,19 +103,19 @@ mod win32 {
106103
return res;
107104
}
108105

109-
fn as_utf16_p<T>(+s: ~str, f: fn(*u16) -> T) -> T {
106+
fn as_utf16_p<T>(s: ~str, f: fn(*u16) -> T) -> T {
110107
let mut t = str::to_utf16(s);
111108
// Null terminate before passing on.
112109
t += ~[0u16];
113110
vec::as_buf(t, |buf, _len| f(buf))
114111
}
115112
}
116113

117-
fn getenv(+n: ~str) -> option<~str> {
114+
fn getenv(n: ~str) -> option<~str> {
118115
global_env::getenv(n)
119116
}
120117

121-
fn setenv(+n: ~str, +v: ~str) {
118+
fn setenv(n: ~str, v: ~str) {
122119
global_env::setenv(n, v)
123120
}
124121

@@ -143,14 +140,14 @@ mod global_env {
143140
MsgEnv(comm::Chan<~[(~str,~str)]>)
144141
}
145142

146-
fn getenv(+n: ~str) -> option<~str> {
143+
fn getenv(n: ~str) -> option<~str> {
147144
let env_ch = get_global_env_chan();
148145
let po = comm::port();
149146
comm::send(env_ch, MsgGetEnv(n, comm::chan(po)));
150147
comm::recv(po)
151148
}
152149

153-
fn setenv(+n: ~str, +v: ~str) {
150+
fn setenv(n: ~str, v: ~str) {
154151
let env_ch = get_global_env_chan();
155152
let po = comm::port();
156153
comm::send(env_ch, MsgSetEnv(n, v, comm::chan(po)));
@@ -212,7 +209,7 @@ mod global_env {
212209
}
213210

214211
#[cfg(unix)]
215-
fn getenv(+n: ~str) -> option<~str> {
212+
fn getenv(n: ~str) -> option<~str> {
216213
unsafe {
217214
let s = str::as_c_str(n, libc::getenv);
218215
return if unsafe::reinterpret_cast(s) == 0 {
@@ -225,7 +222,7 @@ mod global_env {
225222
}
226223

227224
#[cfg(windows)]
228-
fn getenv(+n: ~str) -> option<~str> {
225+
fn getenv(n: ~str) -> option<~str> {
229226
import libc::types::os::arch::extra::*;
230227
import libc::funcs::extra::kernel32::*;
231228
import win32::*;
@@ -238,7 +235,7 @@ mod global_env {
238235

239236

240237
#[cfg(unix)]
241-
fn setenv(+n: ~str, +v: ~str) {
238+
fn setenv(n: ~str, v: ~str) {
242239

243240
// FIXME: remove this when export globs work properly. #1238
244241
import libc::funcs::posix01::unistd::setenv;
@@ -251,7 +248,7 @@ mod global_env {
251248

252249

253250
#[cfg(windows)]
254-
fn setenv(+n: ~str, +v: ~str) {
251+
fn setenv(n: ~str, v: ~str) {
255252
// FIXME: remove imports when export globs work properly. #1238
256253
import libc::funcs::extra::kernel32::*;
257254
import win32::*;
@@ -361,7 +358,7 @@ fn pipe() -> {in: c_int, out: c_int} {
361358
}
362359

363360

364-
fn dll_filename(+base: ~str) -> ~str {
361+
fn dll_filename(base: ~str) -> ~str {
365362
return pre() + base + dll_suffix();
366363

367364
#[cfg(unix)]
@@ -468,11 +465,11 @@ fn homedir() -> option<Path> {
468465
}
469466

470467
/// Recursively walk a directory structure
471-
fn walk_dir(+p: Path, f: fn(Path) -> bool) {
468+
fn walk_dir(p: Path, f: fn(Path) -> bool) {
472469

473470
walk_dir_(p, f);
474471

475-
fn walk_dir_(+p: Path, f: fn(Path) -> bool) -> bool {
472+
fn walk_dir_(p: Path, f: fn(Path) -> bool) -> bool {
476473
let mut keepgoing = true;
477474
do list_dir(p).each |q| {
478475
let path = path::connect(p, q);
@@ -497,14 +494,14 @@ fn walk_dir(+p: Path, f: fn(Path) -> bool) {
497494
}
498495

499496
/// Indicates whether a path represents a directory
500-
fn path_is_dir(+p: Path) -> bool {
497+
fn path_is_dir(p: Path) -> bool {
501498
do str::as_c_str(p) |buf| {
502499
rustrt::rust_path_is_dir(buf) != 0 as c_int
503500
}
504501
}
505502

506503
/// Indicates whether a path exists
507-
fn path_exists(+p: Path) -> bool {
504+
fn path_exists(p: Path) -> bool {
508505
do str::as_c_str(p) |buf| {
509506
rustrt::rust_path_exists(buf) != 0 as c_int
510507
}
@@ -522,7 +519,7 @@ fn path_exists(+p: Path) -> bool {
522519
// NB: this is here rather than in path because it is a form of environment
523520
// querying; what it does depends on the process working directory, not just
524521
// the input paths.
525-
fn make_absolute(+p: Path) -> Path {
522+
fn make_absolute(p: Path) -> Path {
526523
if path::path_is_absolute(p) {
527524
p
528525
} else {
@@ -532,11 +529,11 @@ fn make_absolute(+p: Path) -> Path {
532529

533530

534531
/// Creates a directory at the specified path
535-
fn make_dir(+p: Path, mode: c_int) -> bool {
532+
fn make_dir(p: Path, mode: c_int) -> bool {
536533
return mkdir(p, mode);
537534

538535
#[cfg(windows)]
539-
fn mkdir(+p: Path, _mode: c_int) -> bool {
536+
fn mkdir(p: Path, _mode: c_int) -> bool {
540537
// FIXME: remove imports when export globs work properly. #1238
541538
import libc::types::os::arch::extra::*;
542539
import libc::funcs::extra::kernel32::*;
@@ -549,21 +546,21 @@ fn make_dir(+p: Path, mode: c_int) -> bool {
549546
}
550547

551548
#[cfg(unix)]
552-
fn mkdir(+p: Path, mode: c_int) -> bool {
549+
fn mkdir(p: Path, mode: c_int) -> bool {
553550
do as_c_charp(p) |c| {
554551
libc::mkdir(c, mode as mode_t) == (0 as c_int)
555552
}
556553
}
557554
}
558555

559556
/// Lists the contents of a directory
560-
fn list_dir(+p: Path) -> ~[~str] {
557+
fn list_dir(p: Path) -> ~[~str] {
561558

562559
#[cfg(unix)]
563-
fn star(+p: ~str) -> ~str { p }
560+
fn star(p: ~str) -> ~str { p }
564561

565562
#[cfg(windows)]
566-
fn star(+p: ~str) -> ~str {
563+
fn star(p: ~str) -> ~str {
567564
let pl = str::len(p);
568565
if pl == 0u || (p[pl - 1u] as char != path::consts::path_sep
569566
|| p[pl - 1u] as char != path::consts::alt_path_sep) {
@@ -583,7 +580,7 @@ fn list_dir(+p: Path) -> ~[~str] {
583580
*
584581
* This version prepends each entry with the directory.
585582
*/
586-
fn list_dir_path(+p: Path) -> ~[~str] {
583+
fn list_dir_path(p: Path) -> ~[~str] {
587584
let mut p = p;
588585
let pl = str::len(p);
589586
if pl == 0u || (p[pl - 1u] as char != path::consts::path_sep
@@ -594,11 +591,11 @@ fn list_dir_path(+p: Path) -> ~[~str] {
594591
}
595592
596593
/// Removes a directory at the specified path
597-
fn remove_dir(+p: Path) -> bool {
594+
fn remove_dir(p: Path) -> bool {
598595
return rmdir(p);
599596
600597
#[cfg(windows)]
601-
fn rmdir(+p: Path) -> bool {
598+
fn rmdir(p: Path) -> bool {
602599
// FIXME: remove imports when export globs work properly. #1238
603600
import libc::funcs::extra::kernel32::*;
604601
import libc::types::os::arch::extra::*;
@@ -609,18 +606,18 @@ fn remove_dir(+p: Path) -> bool {
609606
}
610607
611608
#[cfg(unix)]
612-
fn rmdir(+p: Path) -> bool {
609+
fn rmdir(p: Path) -> bool {
613610
return do as_c_charp(p) |buf| {
614611
libc::rmdir(buf) == (0 as c_int)
615612
};
616613
}
617614
}
618615
619-
fn change_dir(+p: Path) -> bool {
616+
fn change_dir(p: Path) -> bool {
620617
return chdir(p);
621618
622619
#[cfg(windows)]
623-
fn chdir(+p: Path) -> bool {
620+
fn chdir(p: Path) -> bool {
624621
// FIXME: remove imports when export globs work properly. #1238
625622
import libc::funcs::extra::kernel32::*;
626623
import libc::types::os::arch::extra::*;
@@ -631,19 +628,19 @@ fn change_dir(+p: Path) -> bool {
631628
}
632629
633630
#[cfg(unix)]
634-
fn chdir(+p: Path) -> bool {
631+
fn chdir(p: Path) -> bool {
635632
return do as_c_charp(p) |buf| {
636633
libc::chdir(buf) == (0 as c_int)
637634
};
638635
}
639636
}
640637
641638
/// Copies a file from one location to another
642-
fn copy_file(+from: Path, +to: Path) -> bool {
639+
fn copy_file(from: Path, to: Path) -> bool {
643640
return do_copy_file(from, to);
644641
645642
#[cfg(windows)]
646-
fn do_copy_file(+from: Path, +to: Path) -> bool {
643+
fn do_copy_file(from: Path, to: Path) -> bool {
647644
// FIXME: remove imports when export globs work properly. #1238
648645
import libc::funcs::extra::kernel32::*;
649646
import libc::types::os::arch::extra::*;
@@ -656,7 +653,7 @@ fn copy_file(+from: Path, +to: Path) -> bool {
656653
}
657654
658655
#[cfg(unix)]
659-
fn do_copy_file(+from: Path, +to: Path) -> bool {
656+
fn do_copy_file(from: Path, to: Path) -> bool {
660657
let istream = do as_c_charp(from) |fromp| {
661658
do as_c_charp(~"rb") |modebuf| {
662659
libc::fopen(fromp, modebuf)
@@ -702,11 +699,11 @@ fn copy_file(+from: Path, +to: Path) -> bool {
702699
}
703700
704701
/// Deletes an existing file
705-
fn remove_file(+p: Path) -> bool {
702+
fn remove_file(p: Path) -> bool {
706703
return unlink(p);
707704
708705
#[cfg(windows)]
709-
fn unlink(+p: Path) -> bool {
706+
fn unlink(p: Path) -> bool {
710707
// FIXME (similar to Issue #2006): remove imports when export globs
711708
// work properly.
712709
import libc::funcs::extra::kernel32::*;
@@ -718,7 +715,7 @@ fn remove_file(+p: Path) -> bool {
718715
}
719716
720717
#[cfg(unix)]
721-
fn unlink(+p: Path) -> bool {
718+
fn unlink(p: Path) -> bool {
722719
return do as_c_charp(p) |buf| {
723720
libc::unlink(buf) == (0 as c_int)
724721
};

trunk/src/rustc/middle/typeck/check/alt.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,6 @@ fn check_pat(pcx: pat_ctxt, pat: @ast::pat, expected: ty::t) {
283283
for fields.each |field| {
284284
match field_map.find(field.ident) {
285285
some(index) => {
286-
tcx.sess.span_err(pat.span, ~"Pattern-matching structs \
287-
is not allowed (#3215) until the next snapshot.");
288286
let class_field = class_fields[index];
289287
let field_type = ty::lookup_field_type(tcx,
290288
class_id,

trunk/src/test/run-pass/struct-pattern-matching.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// xfail-test
21
struct Foo {
32
x: int;
43
y: int;

0 commit comments

Comments
 (0)