Skip to content

Commit b5435f3

Browse files
committed
---
yaml --- r: 151347 b: refs/heads/try2 c: be71d80 h: refs/heads/master i: 151345: a330cba 151343: 530e8ac v: v3
1 parent 91259bb commit b5435f3

File tree

17 files changed

+229
-237
lines changed

17 files changed

+229
-237
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: df621acf5f6f5e4e5d7170963ad7ed7dfe8e2d6c
8+
refs/heads/try2: be71d809bde4bdc46df0bacceccd8ed76540fd04
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/AUTHORS.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,6 @@ Raphael Speyer <[email protected]>
362362
reedlepee <[email protected]>
363363
Reuben Morais <[email protected]>
364364
Richard Diamond <[email protected]>
365-
Richo Healey <[email protected]>
366365
Rick Waldron <[email protected]>
367366
Rob Arnold <[email protected]>
368367
Rob Hoelz <[email protected]>

branches/try2/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ message explaining why.
3333

3434
In the licensing header at the beginning of any files you change,
3535
please make sure the listed date range includes the current year. For
36-
example, if it's 2014, and you change a Rust file that was created in
36+
example, if it's 2013, and you change a Rust file that was created in
3737
2010, it should begin:
3838

3939
```
40-
// Copyright 2010-2014 The Rust Project Developers.
40+
// Copyright 2010-2013 The Rust Project Developers.
4141
```
4242

4343
For more details, please refer to

branches/try2/mk/platform.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ CFG_PATH_MUNGE_arm-unknown-linux-gnueabihf := true
330330
CFG_LDPATH_arm-unknown-linux-gnueabihf :=
331331
CFG_RUN_arm-unknown-linux-gnueabihf=$(2)
332332
CFG_RUN_TARG_arm-unknown-linux-gnueabihf=$(call CFG_RUN_arm-unknown-linux-gnueabihf,,$(2))
333-
RUSTC_FLAGS_arm-unknown-linux-gnueabihf := -C target-feature=+v6,+vfp2
333+
RUSTC_FLAGS_arm-unknown-linux-gnueabihf := -C target-feature=+v7,+vfp3
334334
RUSTC_CROSS_FLAGS_arm-unknown-linux-gnueabihf :=
335335

336336
# arm-unknown-linux-gnueabi configuration

branches/try2/src/doc/intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ fn main() {
370370
```
371371

372372
This example is starting to get more subtle,
373-
but it hints at the powerful composability of Rust's concurrent types.
373+
but it hints at the powerful compositionality of Rust's concurrent types.
374374
This time we've put our array of numbers inside a `Mutex` and then put *that* inside the `Arc`.
375375
Like immutable data,
376376
`Mutex`es are sharable,

branches/try2/src/doc/tutorial.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2992,23 +2992,21 @@ And here an example with multiple files:
29922992
~~~{.ignore}
29932993
// `a.rs` - crate root
29942994
use b::foo;
2995-
use b::c::bar;
29962995
mod b;
2997-
fn main() {
2998-
foo();
2999-
bar();
3000-
}
2996+
fn main() { foo(); }
30012997
~~~
30022998

30032999
~~~{.ignore}
3004-
// `b/mod.rs`
3000+
// `b.rs`
3001+
use b::c::bar;
30053002
pub mod c;
3006-
pub fn foo() { println!("Foo!"; }
3003+
pub fn foo() { bar(); }
30073004
~~~
30083005

3009-
~~~{.ignore}
3010-
// `b/c.rs`
3011-
pub fn bar() { println!("Bar!"); }
3006+
~~~
3007+
// `c.rs`
3008+
pub fn bar() { println!("Baz!"); }
3009+
# fn main() {}
30123010
~~~
30133011

30143012
There also exist two short forms for importing multiple names at once:

branches/try2/src/liblog/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,11 @@ impl fmt::Signed for LogLevel {
195195

196196
impl Logger for DefaultLogger {
197197
fn log(&mut self, record: &LogRecord) {
198-
match write!(&mut self.handle,
199-
"{}:{}: {}",
200-
record.level,
201-
record.module_path,
202-
record.args) {
198+
match writeln!(&mut self.handle,
199+
"{}:{}: {}",
200+
record.level,
201+
record.module_path,
202+
record.args) {
203203
Err(e) => fail!("failed to log: {}", e),
204204
Ok(()) => {}
205205
}

branches/try2/src/libnative/io/file_unix.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ pub fn open(path: &CString, fm: io::FileMode, fa: io::FileAccess)
335335

336336
pub fn mkdir(p: &CString, mode: io::FilePermission) -> IoResult<()> {
337337
super::mkerr_libc(retry(|| unsafe {
338-
libc::mkdir(p.with_ref(|p| p), mode.bits() as libc::mode_t)
338+
libc::mkdir(p.with_ref(|p| p), mode as libc::mode_t)
339339
}))
340340
}
341341

@@ -392,7 +392,7 @@ pub fn rename(old: &CString, new: &CString) -> IoResult<()> {
392392

393393
pub fn chmod(p: &CString, mode: io::FilePermission) -> IoResult<()> {
394394
super::mkerr_libc(retry(|| unsafe {
395-
libc::chmod(p.with_ref(|p| p), mode.bits() as libc::mode_t)
395+
libc::chmod(p.with_ref(|p| p), mode as libc::mode_t)
396396
}))
397397
}
398398

@@ -470,9 +470,7 @@ fn mkstat(stat: &libc::stat, path: &CString) -> io::FileStat {
470470
path: Path::new(path),
471471
size: stat.st_size as u64,
472472
kind: kind,
473-
perm: unsafe {
474-
io::FilePermission::from_bits(stat.st_mode as u32) & io::AllPermissions
475-
},
473+
perm: (stat.st_mode) as io::FilePermission & io::AllPermissions,
476474
created: mktime(stat.st_ctime as u64, stat.st_ctime_nsec as u64),
477475
modified: mktime(stat.st_mtime as u64, stat.st_mtime_nsec as u64),
478476
accessed: mktime(stat.st_atime as u64, stat.st_atime_nsec as u64),

branches/try2/src/libnative/io/file_win32.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ pub fn rename(old: &CString, new: &CString) -> IoResult<()> {
392392

393393
pub fn chmod(p: &CString, mode: io::FilePermission) -> IoResult<()> {
394394
super::mkerr_libc(as_utf16_p(p.as_str().unwrap(), |p| unsafe {
395-
libc::wchmod(p, mode.bits() as libc::c_int)
395+
libc::wchmod(p, mode as libc::c_int)
396396
}))
397397
}
398398

@@ -471,9 +471,7 @@ fn mkstat(stat: &libc::stat, path: &CString) -> io::FileStat {
471471
path: Path::new(path),
472472
size: stat.st_size as u64,
473473
kind: kind,
474-
perm: unsafe {
475-
io::FilePermission::from_bits(stat.st_mode as u32) & io::AllPermissions
476-
},
474+
perm: (stat.st_mode) as io::FilePermission & io::AllPermissions,
477475
created: stat.st_ctime as u64,
478476
modified: stat.st_mtime as u64,
479477
accessed: stat.st_atime as u64,

branches/try2/src/librustuv/file.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,7 @@ impl FsRequest {
283283
path: path,
284284
size: stat.st_size as u64,
285285
kind: kind,
286-
perm: unsafe {
287-
io::FilePermission::from_bits(stat.st_mode as u32) & io::AllPermissions
288-
},
286+
perm: (stat.st_mode as io::FilePermission) & io::AllPermissions,
289287
created: to_msec(stat.st_birthtim),
290288
modified: to_msec(stat.st_mtim),
291289
accessed: to_msec(stat.st_atim),

branches/try2/src/librustuv/uvio.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ impl IoFactory for UvIoFactory {
224224
}
225225
fn fs_mkdir(&mut self, path: &CString,
226226
perm: io::FilePermission) -> Result<(), IoError> {
227-
let r = FsRequest::mkdir(&self.loop_, path, perm.bits() as c_int);
227+
let r = FsRequest::mkdir(&self.loop_, path, perm as c_int);
228228
r.map_err(uv_error_to_io_error)
229229
}
230230
fn fs_rmdir(&mut self, path: &CString) -> Result<(), IoError> {
@@ -237,7 +237,7 @@ impl IoFactory for UvIoFactory {
237237
}
238238
fn fs_chmod(&mut self, path: &CString,
239239
perm: io::FilePermission) -> Result<(), IoError> {
240-
let r = FsRequest::chmod(&self.loop_, path, perm.bits() as c_int);
240+
let r = FsRequest::chmod(&self.loop_, path, perm as c_int);
241241
r.map_err(uv_error_to_io_error)
242242
}
243243
fn fs_readdir(&mut self, path: &CString, flags: c_int)

branches/try2/src/libstd/bitflags.rs

Lines changed: 25 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,14 @@
1717
//! # Example
1818
//!
1919
//! ~~~rust
20-
//! bitflags!(
21-
//! flags Flags: u32 {
22-
//! static FlagA = 0x00000001,
23-
//! static FlagB = 0x00000010,
24-
//! static FlagC = 0x00000100,
25-
//! static FlagABC = FlagA.bits
26-
//! | FlagB.bits
27-
//! | FlagC.bits
28-
//! }
29-
//! )
20+
//! bitflags!(Flags: u32 {
21+
//! FlagA = 0x00000001,
22+
//! FlagB = 0x00000010,
23+
//! FlagC = 0x00000100,
24+
//! FlagABC = FlagA.bits
25+
//! | FlagB.bits
26+
//! | FlagC.bits
27+
//! })
3028
//!
3129
//! fn main() {
3230
//! let e1 = FlagA | FlagC;
@@ -42,12 +40,10 @@
4240
//! ~~~rust
4341
//! use std::fmt;
4442
//!
45-
//! bitflags!(
46-
//! flags Flags: u32 {
47-
//! static FlagA = 0x00000001,
48-
//! static FlagB = 0x00000010
49-
//! }
50-
//! )
43+
//! bitflags!(Flags: u32 {
44+
//! FlagA = 0x00000001,
45+
//! FlagB = 0x00000010
46+
//! })
5147
//!
5248
//! impl Flags {
5349
//! pub fn clear(&mut self) {
@@ -70,16 +66,10 @@
7066
//! }
7167
//! ~~~
7268
//!
73-
//! # Attributes
74-
//!
75-
//! Attributes can be attached to the generated `struct` by placing them
76-
//! before the `flags` keyword.
77-
//!
7869
//! # Derived traits
7970
//!
80-
//! The `Eq` and `Clone` traits are automatically derived for the `struct` using
81-
//! the `deriving` attribute. Additional traits can be derived by providing an
82-
//! explicit `deriving` attribute on `flags`.
71+
//! The `Eq`, `TotalEq`, and `Clone` traits are automatically derived for the
72+
//! `struct` using the `deriving` attribute.
8373
//!
8474
//! # Operators
8575
//!
@@ -101,20 +91,17 @@
10191
//! - `insert`: inserts the specified flags in-place
10292
//! - `remove`: removes the specified flags in-place
10393
104-
#![macro_escape]
105-
10694
#[macro_export]
10795
macro_rules! bitflags(
108-
($(#[$attr:meta])* flags $BitFlags:ident: $T:ty {
109-
$($(#[$Flag_attr:meta])* static $Flag:ident = $value:expr),+
96+
($BitFlags:ident: $T:ty {
97+
$($Flag:ident = $value:expr),+
11098
}) => (
11199
#[deriving(Eq, TotalEq, Clone)]
112-
$(#[$attr])*
113100
pub struct $BitFlags {
114101
bits: $T,
115102
}
116103

117-
$($(#[$Flag_attr])* pub static $Flag: $BitFlags = $BitFlags { bits: $value };)+
104+
$(pub static $Flag: $BitFlags = $BitFlags { bits: $value };)+
118105

119106
impl $BitFlags {
120107
/// Returns an empty set of flags.
@@ -127,12 +114,6 @@ macro_rules! bitflags(
127114
self.bits
128115
}
129116

130-
/// Convert from underlying bit representation. Unsafe because the
131-
/// bits are not guaranteed to represent valid flags.
132-
pub unsafe fn from_bits(bits: $T) -> $BitFlags {
133-
$BitFlags { bits: bits }
134-
}
135-
136117
/// Returns `true` if no flags are currently stored.
137118
pub fn is_empty(&self) -> bool {
138119
*self == $BitFlags::empty()
@@ -189,16 +170,14 @@ macro_rules! bitflags(
189170
mod tests {
190171
use ops::{BitOr, BitAnd, Sub};
191172

192-
bitflags!(
193-
flags Flags: u32 {
194-
static FlagA = 0x00000001,
195-
static FlagB = 0x00000010,
196-
static FlagC = 0x00000100,
197-
static FlagABC = FlagA.bits
198-
| FlagB.bits
199-
| FlagC.bits
200-
}
201-
)
173+
bitflags!(Flags: u32 {
174+
FlagA = 0x00000001,
175+
FlagB = 0x00000010,
176+
FlagC = 0x00000100,
177+
FlagABC = FlagA.bits
178+
| FlagB.bits
179+
| FlagC.bits
180+
})
202181

203182
#[test]
204183
fn test_bits(){

branches/try2/src/libstd/io/fs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ mod test {
11191119
check!(File::create(&input));
11201120
check!(chmod(&input, io::UserRead));
11211121
check!(copy(&input, &out));
1122-
assert!(!check!(out.stat()).perm.intersects(io::UserWrite));
1122+
assert!(check!(out.stat()).perm & io::UserWrite == 0);
11231123

11241124
check!(chmod(&input, io::UserFile));
11251125
check!(chmod(&out, io::UserFile));
@@ -1193,9 +1193,9 @@ mod test {
11931193
let file = tmpdir.join("in.txt");
11941194

11951195
check!(File::create(&file));
1196-
assert!(check!(stat(&file)).perm.contains(io::UserWrite));
1196+
assert!(check!(stat(&file)).perm & io::UserWrite == io::UserWrite);
11971197
check!(chmod(&file, io::UserRead));
1198-
assert!(!check!(stat(&file)).perm.contains(io::UserWrite));
1198+
assert!(check!(stat(&file)).perm & io::UserWrite == 0);
11991199

12001200
match chmod(&tmpdir.join("foo"), io::UserRWX) {
12011201
Ok(..) => fail!("wanted a failure"),

0 commit comments

Comments
 (0)