Skip to content

Commit a67f0ca

Browse files
committed
---
yaml --- r: 151341 b: refs/heads/try2 c: b733df0 h: refs/heads/master i: 151339: 1396ca4 v: v3
1 parent 6d6aba0 commit a67f0ca

File tree

27 files changed

+316
-497
lines changed

27 files changed

+316
-497
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: 1f6db7f4f6399628eaaca5d38cc5fb38e71b4c23
8+
refs/heads/try2: b733df0fc7942aea205d8fc451d2a4d17d47dfe9
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/guide-tasks.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,9 @@ closure in the new task.
8989
fn print_message() { println!("I am running in a different task!"); }
9090
spawn(print_message);
9191
92-
// Print something profound in a different task using a `proc` expression
93-
// The `proc` expression evaluates to an (unnamed) owned closure.
94-
// That closure will call `println!(...)` when the spawned task runs.
95-
92+
// Print something more profound in a different task using a lambda expression
93+
// This uses the proc() keyword to assign to spawn a function with no name
94+
// That function will call println!(...) as requested
9695
spawn(proc() println!("I am also running in a different task!") );
9796
~~~~
9897

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/etc/vim/indent/rust.vim

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ endif
3030

3131
" Come here when loading the script the first time.
3232

33-
function! s:get_line_trimmed(lnum)
33+
function s:get_line_trimmed(lnum)
3434
" Get the line and remove a trailing comment.
3535
" Use syntax highlighting attributes when possible.
3636
" NOTE: this is not accurate; /* */ or a line continuation could trick it
@@ -61,20 +61,6 @@ function! s:get_line_trimmed(lnum)
6161
endif
6262
endfunction
6363

64-
function! s:is_string_comment(lnum, col)
65-
if has('syntax_items')
66-
for id in synstack(a:lnum, a:col)
67-
let synname = synIDattr(id, "name")
68-
if synname == "rustString" || synname =~ "^rustComment"
69-
return 1
70-
endif
71-
endfor
72-
else
73-
" without syntax, let's not even try
74-
return 0
75-
endif
76-
endfunction
77-
7864
function GetRustIndent(lnum)
7965

8066
" Starting assumption: cindent (called at the end) will do it right
@@ -166,10 +152,8 @@ function GetRustIndent(lnum)
166152
" column zero)
167153

168154
call cursor(a:lnum, 1)
169-
if searchpair('{\|(', '', '}\|)', 'nbW'
170-
\ 's:is_string_comment(line("."), col("."))') == 0
171-
if searchpair('\[', '', '\]', 'nbW',
172-
\ 's:is_string_comment(line("."), col("."))') == 0
155+
if searchpair('{\|(', '', '}\|)', 'nbW') == 0
156+
if searchpair('\[', '', '\]', 'nbW') == 0
173157
" Global scope, should be zero
174158
return 0
175159
else

branches/try2/src/libarena/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
extern crate collections;
2828

29-
use std::cast::{transmute, transmute_mut_lifetime};
29+
use std::cast::{transmute, transmute_mut, transmute_mut_lifetime};
3030
use std::cast;
3131
use std::cell::{Cell, RefCell};
3232
use std::mem;
@@ -281,8 +281,8 @@ impl Arena {
281281
#[inline]
282282
pub fn alloc<'a, T>(&'a self, op: || -> T) -> &'a T {
283283
unsafe {
284-
// FIXME #13933: Remove/justify all `&T` to `&mut T` transmutes
285-
let this: &mut Arena = transmute::<&_, &mut _>(self);
284+
// FIXME: Borrow check
285+
let this = transmute_mut(self);
286286
if intrinsics::needs_drop::<T>() {
287287
this.alloc_noncopy(op)
288288
} else {
@@ -438,8 +438,7 @@ impl<T> TypedArena<T> {
438438
#[inline]
439439
pub fn alloc<'a>(&'a self, object: T) -> &'a T {
440440
unsafe {
441-
// FIXME #13933: Remove/justify all `&T` to `&mut T` transmutes
442-
let this: &mut TypedArena<T> = cast::transmute::<&_, &mut _>(self);
441+
let this = cast::transmute_mut(self);
443442
if this.ptr == this.end {
444443
this.grow()
445444
}

branches/try2/src/liblog/directive.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::ascii::StrAsciiExt;
1211
use std::cmp;
1312

1413
#[deriving(Show, Clone)]
@@ -17,13 +16,13 @@ pub struct LogDirective {
1716
pub level: u32,
1817
}
1918

20-
pub static LOG_LEVEL_NAMES: [&'static str, ..4] = ["ERROR", "WARN", "INFO",
21-
"DEBUG"];
19+
static LOG_LEVEL_NAMES: [&'static str, ..4] = ["error", "warn", "info",
20+
"debug"];
2221

2322
/// Parse an individual log level that is either a number or a symbolic log level
2423
fn parse_log_level(level: &str) -> Option<u32> {
2524
from_str::<u32>(level).or_else(|| {
26-
let pos = LOG_LEVEL_NAMES.iter().position(|&name| name.eq_ignore_ascii_case(level));
25+
let pos = LOG_LEVEL_NAMES.iter().position(|&name| name == level);
2726
pos.map(|p| p as u32 + 1)
2827
}).map(|p| cmp::min(p, ::MAX_LOG_LEVEL))
2928
}

branches/try2/src/liblog/lib.rs

Lines changed: 8 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ use std::slice;
129129

130130
use sync::one::{Once, ONCE_INIT};
131131

132-
use directive::LOG_LEVEL_NAMES;
133-
134132
pub mod macros;
135133
mod directive;
136134

@@ -164,42 +162,19 @@ local_data_key!(local_logger: ~Logger:Send)
164162
/// can have its own custom logger which can respond to logging messages
165163
/// however it likes.
166164
pub trait Logger {
167-
/// Logs a single message described by the `record`.
168-
fn log(&mut self, record: &LogRecord);
165+
/// Logs a single message described by the `args` structure. The level is
166+
/// provided in case you want to do things like color the message, etc.
167+
fn log(&mut self, level: u32, args: &fmt::Arguments);
169168
}
170169

171170
struct DefaultLogger {
172171
handle: LineBufferedWriter<io::stdio::StdWriter>,
173172
}
174173

175-
/// Wraps the log level with fmt implementations.
176-
#[deriving(Eq, Ord)]
177-
pub struct LogLevel(pub u32);
178-
179-
impl fmt::Show for LogLevel {
180-
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
181-
let LogLevel(level) = *self;
182-
match LOG_LEVEL_NAMES.get(level as uint - 1) {
183-
Some(name) => name.fmt(fmt),
184-
None => level.fmt(fmt)
185-
}
186-
}
187-
}
188-
189-
impl fmt::Signed for LogLevel {
190-
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
191-
let LogLevel(level) = *self;
192-
write!(fmt.buf, "{}", level)
193-
}
194-
}
195-
196174
impl Logger for DefaultLogger {
197-
fn log(&mut self, record: &LogRecord) {
198-
match write!(&mut self.handle,
199-
"{}:{}: {}",
200-
record.level,
201-
record.module_path,
202-
record.args) {
175+
// by default, just ignore the level
176+
fn log(&mut self, _level: u32, args: &fmt::Arguments) {
177+
match fmt::writeln(&mut self.handle, args) {
203178
Err(e) => fail!("failed to log: {}", e),
204179
Ok(()) => {}
205180
}
@@ -223,21 +198,14 @@ impl Drop for DefaultLogger {
223198
///
224199
/// It is not recommended to call this function directly, rather it should be
225200
/// invoked through the logging family of macros.
226-
#[doc(hidden)]
227-
pub fn log(level: u32, loc: &'static LogLocation, args: &fmt::Arguments) {
201+
pub fn log(level: u32, args: &fmt::Arguments) {
228202
// Completely remove the local logger from TLS in case anyone attempts to
229203
// frob the slot while we're doing the logging. This will destroy any logger
230204
// set during logging.
231205
let mut logger = local_data::pop(local_logger).unwrap_or_else(|| {
232206
box DefaultLogger { handle: io::stderr() } as ~Logger:Send
233207
});
234-
logger.log(&LogRecord {
235-
level: LogLevel(level),
236-
args: args,
237-
file: loc.file,
238-
module_path: loc.module_path,
239-
line: loc.line,
240-
});
208+
logger.log(level, args);
241209
local_data::set(local_logger, logger);
242210
}
243211

@@ -255,34 +223,6 @@ pub fn set_logger(logger: ~Logger:Send) -> Option<~Logger:Send> {
255223
return prev;
256224
}
257225

258-
/// A LogRecord is created by the logging macros, and passed as the only
259-
/// argument to Loggers.
260-
#[deriving(Show)]
261-
pub struct LogRecord<'a> {
262-
263-
/// The module path of where the LogRecord originated.
264-
pub module_path: &'a str,
265-
266-
/// The LogLevel of this record.
267-
pub level: LogLevel,
268-
269-
/// The arguments from the log line.
270-
pub args: &'a fmt::Arguments<'a>,
271-
272-
/// The file of where the LogRecord originated.
273-
pub file: &'a str,
274-
275-
/// The line number of where the LogRecord originated.
276-
pub line: uint,
277-
}
278-
279-
#[doc(hidden)]
280-
pub struct LogLocation {
281-
pub module_path: &'static str,
282-
pub file: &'static str,
283-
pub line: uint,
284-
}
285-
286226
/// Tests whether a given module's name is enabled for a particular level of
287227
/// logging. This is the second layer of defense about determining whether a
288228
/// module's log statement should be emitted or not.

branches/try2/src/liblog/macros.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,9 @@
3333
#[macro_export]
3434
macro_rules! log(
3535
($lvl:expr, $($arg:tt)+) => ({
36-
static LOC: ::log::LogLocation = ::log::LogLocation {
37-
line: line!(),
38-
file: file!(),
39-
module_path: module_path!(),
40-
};
4136
let lvl = $lvl;
4237
if log_enabled!(lvl) {
43-
format_args!(|args| { ::log::log(lvl, &LOC, args) }, $($arg)+)
38+
format_args!(|args| { ::log::log(lvl, args) }, $($arg)+)
4439
}
4540
})
4641
)

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@ impl rtio::RtioFileStream for FileDesc {
174174
fn tell(&self) -> Result<u64, IoError> {
175175
// This transmute is fine because our seek implementation doesn't
176176
// actually use the mutable self at all.
177-
// FIXME #13933: Remove/justify all `&T` to `&mut T` transmutes
178-
unsafe { cast::transmute::<&_, &mut FileDesc>(self).seek(0, io::SeekCur) }
177+
unsafe { cast::transmute_mut(self).seek(0, io::SeekCur) }
179178
}
180179

181180
fn fsync(&mut self) -> Result<(), IoError> {

0 commit comments

Comments
 (0)