Skip to content

Commit 611f340

Browse files
committed
---
yaml --- r: 194033 b: refs/heads/beta c: f5782fa h: refs/heads/master i: 194031: 118b44a v: v3
1 parent bd5d9bc commit 611f340

File tree

125 files changed

+941
-606
lines changed

Some content is hidden

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

125 files changed

+941
-606
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 9acdcba3d5e6901e6a91e28f86420c8014a28328
34+
refs/heads/beta: f5782faa0667c0ee64eba8b5d49fc7d94358601e
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

branches/beta/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/beta/src/compiletest/header.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
163163
fn ignore_target(config: &Config) -> String {
164164
format!("ignore-{}", util::get_os(&config.target))
165165
}
166+
fn ignore_architecture(config: &Config) -> String {
167+
format!("ignore-{}", util::get_arch(&config.target))
168+
}
166169
fn ignore_stage(config: &Config) -> String {
167170
format!("ignore-{}",
168171
config.stage_id.split('-').next().unwrap())
@@ -226,6 +229,7 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
226229
let val = iter_header(testfile, &mut |ln| {
227230
!parse_name_directive(ln, "ignore-test") &&
228231
!parse_name_directive(ln, &ignore_target(config)) &&
232+
!parse_name_directive(ln, &ignore_architecture(config)) &&
229233
!parse_name_directive(ln, &ignore_stage(config)) &&
230234
!(config.mode == common::Pretty && parse_name_directive(ln, "ignore-pretty")) &&
231235
!(config.target != config.host && parse_name_directive(ln, "ignore-cross-compile")) &&

branches/beta/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/beta/src/compiletest/util.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,23 @@ const OS_TABLE: &'static [(&'static str, &'static str)] = &[
2525
("openbsd", "openbsd"),
2626
];
2727

28+
const ARCH_TABLE: &'static [(&'static str, &'static str)] = &[
29+
("i386", "x86"),
30+
("i686", "x86"),
31+
("amd64", "x86_64"),
32+
("x86_64", "x86_64"),
33+
("sparc", "sparc"),
34+
("powerpc", "powerpc"),
35+
("arm64", "aarch64"),
36+
("arm", "arm"),
37+
("aarch64", "aarch64"),
38+
("mips", "mips"),
39+
("xcore", "xcore"),
40+
("msp430", "msp430"),
41+
("hexagon", "hexagon"),
42+
("s390x", "systemz"),
43+
];
44+
2845
pub fn get_os(triple: &str) -> &'static str {
2946
for &(triple_os, os) in OS_TABLE {
3047
if triple.contains(triple_os) {
@@ -33,6 +50,14 @@ pub fn get_os(triple: &str) -> &'static str {
3350
}
3451
panic!("Cannot determine OS from triple");
3552
}
53+
pub fn get_arch(triple: &str) -> &'static str {
54+
for &(triple_arch, arch) in ARCH_TABLE {
55+
if triple.contains(triple_arch) {
56+
return arch
57+
}
58+
}
59+
panic!("Cannot determine Architecture from triple");
60+
}
3661

3762
pub fn make_new_path(path: &str) -> String {
3863
assert!(cfg!(windows));

branches/beta/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/beta/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/beta/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/beta/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/beta/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/beta/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/beta/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)