Skip to content

Commit 672d5a6

Browse files
committed
---
yaml --- r: 192356 b: refs/heads/auto c: d6054e4 h: refs/heads/master v: v3
1 parent b499e96 commit 672d5a6

File tree

122 files changed

+910
-614
lines changed

Some content is hidden

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

122 files changed

+910
-614
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 92294e7aedf26c1b276b4a721e18b7a43217848d
13+
refs/heads/auto: d6054e47719a3dbc554c3119310334fe4b18c482
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/man/rustc.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ full debug info with variable and type information.
242242
\fBopt\-level\fR=\fIVAL\fR
243243
Optimize with possible levels 0\[en]3
244244

245-
.SH ENVIRONMENT VARIABLES
245+
.SH ENVIRONMENT
246246

247247
Some of these affect the output of the compiler, while others affect programs
248248
which link to the standard library.

branches/auto/src/compiletest/procsrv.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010

1111
#![allow(deprecated)] // for old path, for dynamic_lib
1212

13-
use std::process::{ExitStatus, Command, Child, Output, Stdio};
14-
use std::io::prelude::*;
1513
use std::dynamic_lib::DynamicLibrary;
14+
use std::io::prelude::*;
15+
use std::old_path::Path;
16+
use std::process::{ExitStatus, Command, Child, Output, Stdio};
1617

1718
fn add_target_env(cmd: &mut Command, lib_path: &str, aux_path: Option<&str>) {
1819
// Need to be sure to put both the lib_path and the aux path in the dylib

branches/auto/src/doc/reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,7 +1982,7 @@ the namespace hierarchy as it normally would.
19821982
## Attributes
19831983

19841984
```{.ebnf .gram}
1985-
attribute : "#!" ? '[' meta_item ']' ;
1985+
attribute : '#' '!' ? '[' meta_item ']' ;
19861986
meta_item : ident [ '=' literal
19871987
| '(' meta_seq ')' ] ? ;
19881988
meta_seq : meta_item [ ',' meta_seq ] ? ;
@@ -3158,7 +3158,7 @@ ten_times(|j| println!("hello, {}", j));
31583158
### While loops
31593159

31603160
```{.ebnf .gram}
3161-
while_expr : "while" no_struct_literal_expr '{' block '}' ;
3161+
while_expr : [ lifetime ':' ] "while" no_struct_literal_expr '{' block '}' ;
31623162
```
31633163

31643164
A `while` loop begins by evaluating the boolean loop conditional expression.
@@ -3223,7 +3223,7 @@ A `continue` expression is only permitted in the body of a loop.
32233223
### For expressions
32243224

32253225
```{.ebnf .gram}
3226-
for_expr : "for" pat "in" no_struct_literal_expr '{' block '}' ;
3226+
for_expr : [ lifetime ':' ] "for" pat "in" no_struct_literal_expr '{' block '}' ;
32273227
```
32283228

32293229
A `for` expression is a syntactic construct for looping over elements provided

branches/auto/src/doc/trpl/SUMMARY.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Summary
22

3-
* [I: The Basics](basic.md)
3+
* [The Basics](basic.md)
44
* [Installing Rust](installing-rust.md)
55
* [Hello, world!](hello-world.md)
66
* [Hello, Cargo!](hello-cargo.md)
@@ -14,7 +14,7 @@
1414
* [Strings](strings.md)
1515
* [Arrays, Vectors, and Slices](arrays-vectors-and-slices.md)
1616
* [Standard Input](standard-input.md)
17-
* [II: Intermediate Rust](intermediate.md)
17+
* [Intermediate Rust](intermediate.md)
1818
* [Crates and Modules](crates-and-modules.md)
1919
* [Testing](testing.md)
2020
* [Pointers](pointers.md)
@@ -31,7 +31,7 @@
3131
* [Concurrency](concurrency.md)
3232
* [Error Handling](error-handling.md)
3333
* [Documentation](documentation.md)
34-
* [III: Advanced Topics](advanced.md)
34+
* [Advanced Topics](advanced.md)
3535
* [FFI](ffi.md)
3636
* [Unsafe Code](unsafe.md)
3737
* [Advanced Macros](advanced-macros.md)

branches/auto/src/libcollections/btree/map.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use core::default::Default;
2424
use core::fmt::Debug;
2525
use core::hash::{Hash, Hasher};
2626
use core::iter::{Map, FromIterator, IntoIterator};
27-
use core::ops::{Index, IndexMut};
27+
use core::ops::{Index};
2828
use core::{iter, fmt, mem, usize};
2929
use Bound::{self, Included, Excluded, Unbounded};
3030

@@ -925,15 +925,6 @@ impl<K: Ord, Q: ?Sized, V> Index<Q> for BTreeMap<K, V>
925925
}
926926
}
927927

928-
#[stable(feature = "rust1", since = "1.0.0")]
929-
impl<K: Ord, Q: ?Sized, V> IndexMut<Q> for BTreeMap<K, V>
930-
where K: Borrow<Q>, Q: Ord
931-
{
932-
fn index_mut(&mut self, key: &Q) -> &mut V {
933-
self.get_mut(key).expect("no entry found for key")
934-
}
935-
}
936-
937928
/// Genericises over how to get the correct type of iterator from the correct type
938929
/// of Node ownership.
939930
trait Traverse<N> {

branches/auto/src/libcollections/fmt.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@
262262
//!
263263
//! ```
264264
//! # #![allow(unused_must_use)]
265+
//! use std::io::Write;
265266
//! let mut w = Vec::new();
266267
//! write!(&mut w, "Hello {}!", "world");
267268
//! ```
@@ -288,15 +289,15 @@
288289
//!
289290
//! ```
290291
//! use std::fmt;
291-
//! use std::old_io;
292+
//! use std::io::{self, Write};
292293
//!
293294
//! fmt::format(format_args!("this returns {}", "String"));
294295
//!
295-
//! let mut some_writer = old_io::stdout();
296+
//! let mut some_writer = io::stdout();
296297
//! write!(&mut some_writer, "{}", format_args!("print with a {}", "macro"));
297298
//!
298299
//! fn my_fmt_fn(args: fmt::Arguments) {
299-
//! write!(&mut old_io::stdout(), "{}", args);
300+
//! write!(&mut io::stdout(), "{}", args);
300301
//! }
301302
//! my_fmt_fn(format_args!("or a {} too", "function"));
302303
//! ```

branches/auto/src/libcore/macros.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ macro_rules! try {
176176
///
177177
/// ```
178178
/// # #![allow(unused_must_use)]
179+
/// use std::io::Write;
179180
///
180181
/// let mut w = Vec::new();
181182
/// write!(&mut w, "test");

branches/auto/src/libcore/prelude.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ pub use marker::{Copy, Send, Sized, Sync};
2929
pub use ops::{Drop, Fn, FnMut, FnOnce};
3030

3131
// Reexported functions
32-
#[allow(deprecated)]
33-
pub use iter::range;
3432
pub use mem::drop;
3533

3634
// Reexported types and traits

branches/auto/src/libcore/result.rs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
//! let bad_result: Result<int, int> = bad_result.or_else(|i| Ok(11));
7979
//!
8080
//! // Consume the result and return the contents with `unwrap`.
81-
//! let final_awesome_result = good_result.ok().unwrap();
81+
//! let final_awesome_result = good_result.unwrap();
8282
//! ```
8383
//!
8484
//! # Results must be used
@@ -110,7 +110,8 @@
110110
//! something like this:
111111
//!
112112
//! ```{.ignore}
113-
//! use std::old_io::{File, Open, Write};
113+
//! use std::old_io::*;
114+
//! use std::old_path::Path;
114115
//!
115116
//! let mut file = File::open_mode(&Path::new("valuable_data.txt"), Open, Write);
116117
//! // If `write_line` errors, then we'll never know, because the return
@@ -128,7 +129,8 @@
128129
//! a marginally useful message indicating why:
129130
//!
130131
//! ```{.no_run}
131-
//! use std::old_io::{File, Open, Write};
132+
//! use std::old_io::*;
133+
//! use std::old_path::Path;
132134
//!
133135
//! let mut file = File::open_mode(&Path::new("valuable_data.txt"), Open, Write);
134136
//! file.write_line("important message").ok().expect("failed to write message");
@@ -138,7 +140,8 @@
138140
//! You might also simply assert success:
139141
//!
140142
//! ```{.no_run}
141-
//! # use std::old_io::{File, Open, Write};
143+
//! # use std::old_io::*;
144+
//! # use std::old_path::Path;
142145
//!
143146
//! # let mut file = File::open_mode(&Path::new("valuable_data.txt"), Open, Write);
144147
//! assert!(file.write_line("important message").is_ok());
@@ -148,7 +151,8 @@
148151
//! Or propagate the error up the call stack with `try!`:
149152
//!
150153
//! ```
151-
//! # use std::old_io::{File, Open, Write, IoError};
154+
//! # use std::old_io::*;
155+
//! # use std::old_path::Path;
152156
//! fn write_message() -> Result<(), IoError> {
153157
//! let mut file = File::open_mode(&Path::new("valuable_data.txt"), Open, Write);
154158
//! try!(file.write_line("important message"));
@@ -167,7 +171,8 @@
167171
//! It replaces this:
168172
//!
169173
//! ```
170-
//! use std::old_io::{File, Open, Write, IoError};
174+
//! use std::old_io::*;
175+
//! use std::old_path::Path;
171176
//!
172177
//! struct Info {
173178
//! name: String,
@@ -191,7 +196,8 @@
191196
//! With this:
192197
//!
193198
//! ```
194-
//! use std::old_io::{File, Open, Write, IoError};
199+
//! use std::old_io::*;
200+
//! use std::old_path::Path;
195201
//!
196202
//! struct Info {
197203
//! name: String,
@@ -446,7 +452,7 @@ impl<T, E> Result<T, E> {
446452
/// ignoring I/O and parse errors:
447453
///
448454
/// ```
449-
/// use std::old_io::IoResult;
455+
/// use std::old_io::*;
450456
///
451457
/// let mut buffer: &[u8] = b"1\n2\n3\n4\n";
452458
/// let mut buffer = &mut buffer;
@@ -460,7 +466,7 @@ impl<T, E> Result<T, E> {
460466
/// line.trim_right().parse::<int>().unwrap_or(0)
461467
/// });
462468
/// // Add the value if there were no errors, otherwise add 0
463-
/// sum += val.ok().unwrap_or(0);
469+
/// sum += val.unwrap_or(0);
464470
/// }
465471
///
466472
/// assert!(sum == 10);

branches/auto/src/libcoretest/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn test_bool_from_str() {
3535
fn check_contains_all_substrings(s: &str) {
3636
assert!(s.contains(""));
3737
for i in 0..s.len() {
38-
for j in range(i+1, s.len() + 1) {
38+
for j in i+1..s.len() + 1 {
3939
assert!(s.contains(&s[i..j]));
4040
}
4141
}

branches/auto/src/liblog/lib.rs

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,9 @@ use std::io::{self, Stderr};
183183
use std::io::prelude::*;
184184
use std::mem;
185185
use std::env;
186-
use std::ptr;
187186
use std::rt;
188187
use std::slice;
189-
use std::sync::{Once, ONCE_INIT};
188+
use std::sync::{Once, ONCE_INIT, StaticMutex, MUTEX_INIT};
190189

191190
use directive::LOG_LEVEL_NAMES;
192191

@@ -202,6 +201,8 @@ pub const MAX_LOG_LEVEL: u32 = 255;
202201
/// The default logging level of a crate if no other is specified.
203202
const DEFAULT_LOG_LEVEL: u32 = 1;
204203

204+
static LOCK: StaticMutex = MUTEX_INIT;
205+
205206
/// An unsafe constant that is the maximum logging level of any module
206207
/// specified. This is the first line of defense to determining whether a
207208
/// logging statement should be run.
@@ -286,9 +287,18 @@ impl Drop for DefaultLogger {
286287
pub fn log(level: u32, loc: &'static LogLocation, args: fmt::Arguments) {
287288
// Test the literal string from args against the current filter, if there
288289
// is one.
289-
match unsafe { FILTER.as_ref() } {
290-
Some(filter) if !args.to_string().contains(&filter[..]) => return,
291-
_ => {}
290+
unsafe {
291+
let _g = LOCK.lock();
292+
match FILTER as uint {
293+
0 => {}
294+
1 => panic!("cannot log after main thread has exited"),
295+
n => {
296+
let filter = mem::transmute::<_, &String>(n);
297+
if !args.to_string().contains(&filter[..]) {
298+
return
299+
}
300+
}
301+
}
292302
}
293303

294304
// Completely remove the local logger from TLS in case anyone attempts to
@@ -370,9 +380,15 @@ pub fn mod_enabled(level: u32, module: &str) -> bool {
370380

371381
// This assertion should never get tripped unless we're in an at_exit
372382
// handler after logging has been torn down and a logging attempt was made.
373-
assert!(unsafe { !DIRECTIVES.is_null() });
374383

375-
enabled(level, module, unsafe { (*DIRECTIVES).iter() })
384+
let _g = LOCK.lock();
385+
unsafe {
386+
assert!(DIRECTIVES as uint != 0);
387+
assert!(DIRECTIVES as uint != 1,
388+
"cannot log after the main thread has exited");
389+
390+
enabled(level, module, (*DIRECTIVES).iter())
391+
}
376392
}
377393

378394
fn enabled(level: u32,
@@ -428,14 +444,14 @@ fn init() {
428444

429445
// Schedule the cleanup for the globals for when the runtime exits.
430446
rt::at_exit(move || {
447+
let _g = LOCK.lock();
431448
assert!(!DIRECTIVES.is_null());
432-
let _directives: Box<Vec<directive::LogDirective>> =
433-
Box::from_raw(DIRECTIVES);
434-
DIRECTIVES = ptr::null_mut();
449+
let _directives = Box::from_raw(DIRECTIVES);
450+
DIRECTIVES = 1 as *mut _;
435451

436452
if !FILTER.is_null() {
437-
let _filter: Box<String> = Box::from_raw(FILTER);
438-
FILTER = 0 as *mut _;
453+
let _filter = Box::from_raw(FILTER);
454+
FILTER = 1 as *mut _;
439455
}
440456
});
441457
}

0 commit comments

Comments
 (0)