Skip to content

Commit aeed43a

Browse files
committed
---
yaml --- r: 154445 b: refs/heads/try2 c: 62b1fbe h: refs/heads/master i: 154443: 1cec7b5 v: v3
1 parent c4f68f8 commit aeed43a

Some content is hidden

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

75 files changed

+260
-255
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: eaf810a219b136fff67e75840ad3c5efde9ae1e5
8+
refs/heads/try2: 62b1fbe7de981a75ea96a9522a6d671eb75b114a
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/doc/guide.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ note: in expansion of format_args!
517517
<std macros>:1:1: 3:2 note: in expansion of println!
518518
src/hello_world.rs:4:5: 4:42 note: expansion site
519519
error: aborting due to previous error
520-
Could not compile `hello_world`.
520+
Could not execute process `rustc src/hello_world.rs --crate-type bin --out-dir /home/you/projects/hello_world/target -L /home/you/projects/hello_world/target -L /home/you/projects/hello_world/target/deps` (status=101)
521521
```
522522

523523
Rust will not let us use a value that has not been initialized. So why let us
@@ -532,7 +532,7 @@ in the middle of a string." We add a comma, and then `x`, to indicate that we
532532
want `x` to be the value we're interpolating. The comma is used to separate
533533
arguments we pass to functions and macros, if you're passing more than one.
534534

535-
When you just use the curly braces, Rust will attempt to display the
535+
When you just use the double curly braces, Rust will attempt to display the
536536
value in a meaningful way by checking out its type. If you want to specify the
537537
format in a more detailed manner, there are a [wide number of options
538538
available](/std/fmt/index.html). For now, we'll just stick to the default:
@@ -3669,9 +3669,10 @@ manually free this allocation! If we write
36693669
```
36703670

36713671
then Rust will automatically free `x` at the end of the block. This isn't
3672-
because Rust has a garbage collector -- it doesn't. Instead, when `x` goes out
3673-
of scope, Rust `free`s `x`. This Rust code will do the same thing as the
3674-
following C code:
3672+
because Rust has a garbage collector -- it doesn't. Instead, Rust uses static
3673+
analysis to determine the *lifetime* of `x`, and then generates code to free it
3674+
once it's sure the `x` won't be used again. This Rust code will do the same
3675+
thing as the following C code:
36753676

36763677
```{c,ignore}
36773678
{

branches/try2/src/doc/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1801,7 +1801,7 @@ module through the rules above. It essentially allows public access into the
18011801
re-exported item. For example, this program is valid:
18021802

18031803
~~~~
1804-
pub use self::implementation as api;
1804+
pub use api = self::implementation;
18051805
18061806
mod implementation {
18071807
pub fn f() {}

branches/try2/src/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3112,7 +3112,7 @@ use farm::*;
31123112
However, that's not all. You can also rename an item while you're bringing it into scope:
31133113

31143114
~~~
3115-
use farm::chicken as egg_layer;
3115+
use egg_layer = farm::chicken;
31163116
# mod farm { pub fn chicken() { println!("Laying eggs is fun!") } }
31173117
// ...
31183118
@@ -3335,7 +3335,7 @@ you just have to import it with an `use` statement.
33353335
For example, it re-exports `range` which is defined in `std::iter::range`:
33363336

33373337
~~~
3338-
use std::iter::range as iter_range;
3338+
use iter_range = std::iter::range;
33393339
33403340
fn main() {
33413341
// `range` is imported by default

branches/try2/src/liballoc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ extern crate libc;
8686

8787
#[deprecated = "use boxed instead"]
8888
#[cfg(not(test))]
89-
pub use boxed as owned;
89+
pub use owned = boxed;
9090

9191
// Heaps provided for low-level allocation strategies
9292

branches/try2/src/libcollections/hash/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ use core::mem;
7373
use vec::Vec;
7474

7575
/// Reexport the `sip::hash` function as our default hasher.
76-
pub use self::sip::hash as hash;
76+
pub use hash = self::sip::hash;
7777

7878
pub mod sip;
7979

branches/try2/src/libcollections/str.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ the string is valid for the `'static` lifetime, otherwise known as the
4444
lifetime of the entire program. As can be inferred from the type, these static
4545
strings are not mutable.
4646
47+
# Mutability
48+
49+
Many languages have immutable strings by default, and Rust has a particular
50+
flavor on this idea. As with the rest of Rust types, strings are immutable by
51+
default. If a string is declared as `mut`, however, it may be mutated. This
52+
works the same way as the rest of Rust's type system in the sense that if
53+
there's a mutable reference to a string, there may only be one mutable reference
54+
to that string. With these guarantees, strings can easily transition between
55+
being mutable/immutable with the same benefits of having mutable strings in
56+
other languages.
57+
4758
# Representation
4859
4960
Rust's string type, `str`, is a sequence of unicode scalar values encoded as a

branches/try2/src/libcollections/string.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ use core::fmt;
1919
use core::mem;
2020
use core::ptr;
2121
// FIXME: ICE's abound if you import the `Slice` type while importing `Slice` trait
22-
use core::raw::Slice as RawSlice;
22+
use RawSlice = core::raw::Slice;
2323

2424
use {Mutable, MutableSeq};
2525
use hash;
2626
use str;
2727
use str::{CharRange, StrAllocating, MaybeOwned, Owned};
28-
use str::Slice as MaybeOwnedSlice; // So many `Slice`s...
28+
use MaybeOwnedSlice = str::Slice; // So many `Slice`s...
2929
use vec::Vec;
3030

3131
/// A growable string stored as a UTF-8 encoded buffer.

branches/try2/src/libcollections/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
use core::prelude::*;
1414

1515
use alloc::heap::{allocate, reallocate, deallocate};
16+
use RawSlice = core::raw::Slice;
1617
use core::cmp::max;
1718
use core::default::Default;
1819
use core::fmt;
1920
use core::mem;
2021
use core::num;
2122
use core::ptr;
22-
use core::raw::Slice as RawSlice;
2323
use core::uint;
2424

2525
use {Mutable, MutableSeq};

branches/try2/src/libcore/kinds.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ by the compiler automatically for the types to which they apply.
2121
*/
2222

2323
#[deprecated = "This has been renamed to Sync"]
24-
pub use self::Sync as Share;
24+
pub use Share = self::Sync;
2525

2626
/// Types able to be transferred across task boundaries.
2727
#[lang="send"]

branches/try2/src/libcore/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub mod collections;
107107
/// Deprecated module in favor of `std::cell`
108108
pub mod ty {
109109
#[deprecated = "this type has been renamed to `UnsafeCell`"]
110-
pub use cell::UnsafeCell as Unsafe;
110+
pub use Unsafe = cell::UnsafeCell;
111111
}
112112

113113
/* Core types and methods on primitives */

branches/try2/src/libcore/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ impl<T> Option<T> {
244244
}
245245
}
246246

247-
/// Returns the inner `T` of a `Some(T)`.
247+
/// Moves a value out of an option type and returns it, consuming the `Option`.
248248
///
249249
/// # Failure
250250
///

branches/try2/src/libcore/slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ use mem::size_of;
5050
use kinds::marker;
5151
use raw::Repr;
5252
// Avoid conflicts with *both* the Slice trait (buggy) and the `slice::raw` module.
53-
use raw::Slice as RawSlice;
53+
use RawSlice = raw::Slice;
5454

5555

5656
//

branches/try2/src/libgraphviz/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ forming a diamond-shaped acyclic graph and then pointing to the fifth
4747
which is cyclic.
4848
4949
```rust
50-
use graphviz as dot;
50+
use dot = graphviz;
5151
use graphviz::maybe_owned_vec::IntoMaybeOwnedVector;
5252
5353
type Nd = int;
@@ -147,7 +147,7 @@ labelled with the &sube; character (specified using the HTML character
147147
entity `&sube`).
148148
149149
```rust
150-
use graphviz as dot;
150+
use dot = graphviz;
151151
use std::str;
152152
153153
type Nd = uint;
@@ -203,7 +203,7 @@ The output from this example is the same as the second example: the
203203
Hasse-diagram for the subsets of the set `{x, y}`.
204204
205205
```rust
206-
use graphviz as dot;
206+
use dot = graphviz;
207207
use std::str;
208208
209209
type Nd<'a> = (uint, &'a str);

branches/try2/src/libgreen/message_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use alloc::arc::Arc;
12-
use std::sync::mpsc_queue as mpsc;
12+
use mpsc = std::sync::mpsc_queue;
1313
use std::kinds::marker;
1414

1515
pub enum PopResult<T> {

branches/try2/src/libgreen/sched.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use coroutine::Coroutine;
2525
use sleeper_list::SleeperList;
2626
use stack::StackPool;
2727
use task::{TypeSched, GreenTask, HomeSched, AnySched};
28-
use message_queue as msgq;
28+
use msgq = message_queue;
2929

3030
/// A scheduler is responsible for coordinating the execution of Tasks
3131
/// on a single thread. The scheduler runs inside a slightly modified

branches/try2/src/liblibc/lib.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,13 +1456,47 @@ pub mod types {
14561456
pub Data4: [BYTE, ..8],
14571457
}
14581458

1459+
// NOTE(pcwalton, stage0): Remove after snapshot (typeck bug
1460+
// workaround).
1461+
#[cfg(stage0)]
1462+
pub struct WSAPROTOCOLCHAIN {
1463+
pub ChainLen: c_int,
1464+
pub ChainEntries: [DWORD, ..MAX_PROTOCOL_CHAIN],
1465+
}
1466+
#[cfg(not(stage0))]
14591467
pub struct WSAPROTOCOLCHAIN {
14601468
pub ChainLen: c_int,
14611469
pub ChainEntries: [DWORD, ..MAX_PROTOCOL_CHAIN as uint],
14621470
}
14631471

14641472
pub type LPWSAPROTOCOLCHAIN = *mut WSAPROTOCOLCHAIN;
14651473

1474+
// NOTE(pcwalton, stage0): Remove after snapshot (typeck bug
1475+
// workaround).
1476+
#[cfg(stage0)]
1477+
pub struct WSAPROTOCOL_INFO {
1478+
pub dwServiceFlags1: DWORD,
1479+
pub dwServiceFlags2: DWORD,
1480+
pub dwServiceFlags3: DWORD,
1481+
pub dwServiceFlags4: DWORD,
1482+
pub dwProviderFlags: DWORD,
1483+
pub ProviderId: GUID,
1484+
pub dwCatalogEntryId: DWORD,
1485+
pub ProtocolChain: WSAPROTOCOLCHAIN,
1486+
pub iVersion: c_int,
1487+
pub iAddressFamily: c_int,
1488+
pub iMaxSockAddr: c_int,
1489+
pub iMinSockAddr: c_int,
1490+
pub iSocketType: c_int,
1491+
pub iProtocol: c_int,
1492+
pub iProtocolMaxOffset: c_int,
1493+
pub iNetworkByteOrder: c_int,
1494+
pub iSecurityScheme: c_int,
1495+
pub dwMessageSize: DWORD,
1496+
pub dwProviderReserved: DWORD,
1497+
pub szProtocol: [u8, ..WSAPROTOCOL_LEN+1],
1498+
}
1499+
#[cfg(not(stage0))]
14661500
pub struct WSAPROTOCOL_INFO {
14671501
pub dwServiceFlags1: DWORD,
14681502
pub dwServiceFlags2: DWORD,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ mod tty;
7979
#[cfg(windows)] #[path = "c_win32.rs"] mod c;
8080

8181
fn unimpl() -> IoError {
82-
#[cfg(unix)] use libc::ENOSYS as ERROR;
83-
#[cfg(windows)] use libc::ERROR_CALL_NOT_IMPLEMENTED as ERROR;
82+
#[cfg(unix)] use ERROR = libc::ENOSYS;
83+
#[cfg(windows)] use ERROR = libc::ERROR_CALL_NOT_IMPLEMENTED;
8484
IoError {
8585
code: ERROR as uint,
8686
extra: 0,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ pub fn sockaddr_to_addr(storage: &libc::sockaddr_storage,
210210
})
211211
}
212212
_ => {
213-
#[cfg(unix)] use libc::EINVAL as ERROR;
214-
#[cfg(windows)] use libc::WSAEINVAL as ERROR;
213+
#[cfg(unix)] use ERROR = libc::EINVAL;
214+
#[cfg(windows)] use ERROR = libc::WSAEINVAL;
215215
Err(IoError {
216216
code: ERROR as uint,
217217
extra: 0,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ fn addr_to_sockaddr_un(addr: &CString,
3939

4040
let len = addr.len();
4141
if len > s.sun_path.len() - 1 {
42-
#[cfg(unix)] use libc::EINVAL as ERROR;
43-
#[cfg(windows)] use libc::WSAEINVAL as ERROR;
42+
#[cfg(unix)] use ERROR = libc::EINVAL;
43+
#[cfg(windows)] use ERROR = libc::WSAEINVAL;
4444
return Err(IoError {
4545
code: ERROR as uint,
4646
extra: 0,

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ impl rtio::RtioProcess for Process {
148148
}
149149

150150
fn kill(&mut self, signum: int) -> IoResult<()> {
151-
#[cfg(unix)] use libc::EINVAL as ERROR;
152-
#[cfg(windows)] use libc::ERROR_NOTHING_TO_TERMINATE as ERROR;
151+
#[cfg(unix)] use ERROR = libc::EINVAL;
152+
#[cfg(windows)] use ERROR = libc::ERROR_NOTHING_TO_TERMINATE;
153153

154154
// On linux (and possibly other unices), a process that has exited will
155155
// continue to accept signals because it is "defunct". The delivery of
@@ -192,8 +192,8 @@ impl Drop for Process {
192192
}
193193

194194
fn pipe() -> IoResult<(file::FileDesc, file::FileDesc)> {
195-
#[cfg(unix)] use libc::EMFILE as ERROR;
196-
#[cfg(windows)] use libc::WSAEMFILE as ERROR;
195+
#[cfg(unix)] use ERROR = libc::EMFILE;
196+
#[cfg(windows)] use ERROR = libc::WSAEMFILE;
197197
struct Closer { fd: libc::c_int }
198198

199199
let os::Pipe { reader, writer } = match unsafe { os::pipe() } {

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ pub enum SocketStatus {
2525
}
2626

2727
pub fn timeout(desc: &'static str) -> IoError {
28-
#[cfg(unix)] use libc::ETIMEDOUT as ERROR;
29-
#[cfg(windows)] use libc::ERROR_OPERATION_ABORTED as ERROR;
28+
#[cfg(unix)] use ERROR = libc::ETIMEDOUT;
29+
#[cfg(windows)] use ERROR = libc::ERROR_OPERATION_ABORTED;
3030
IoError {
3131
code: ERROR as uint,
3232
extra: 0,
@@ -35,8 +35,8 @@ pub fn timeout(desc: &'static str) -> IoError {
3535
}
3636

3737
pub fn short_write(n: uint, desc: &'static str) -> IoError {
38-
#[cfg(unix)] use libc::EAGAIN as ERROR;
39-
#[cfg(windows)] use libc::ERROR_OPERATION_ABORTED as ERROR;
38+
#[cfg(unix)] use ERROR = libc::EAGAIN;
39+
#[cfg(windows)] use ERROR = libc::ERROR_OPERATION_ABORTED;
4040
IoError {
4141
code: ERROR as uint,
4242
extra: n,
@@ -102,10 +102,10 @@ pub fn connect_timeout(fd: net::sock_t,
102102
len: libc::socklen_t,
103103
timeout_ms: u64) -> IoResult<()> {
104104
use std::os;
105-
#[cfg(unix)] use libc::EINPROGRESS as INPROGRESS;
106-
#[cfg(windows)] use libc::WSAEINPROGRESS as INPROGRESS;
107-
#[cfg(unix)] use libc::EWOULDBLOCK as WOULDBLOCK;
108-
#[cfg(windows)] use libc::WSAEWOULDBLOCK as WOULDBLOCK;
105+
#[cfg(unix)] use INPROGRESS = libc::EINPROGRESS;
106+
#[cfg(windows)] use INPROGRESS = libc::WSAEINPROGRESS;
107+
#[cfg(unix)] use WOULDBLOCK = libc::EWOULDBLOCK;
108+
#[cfg(windows)] use WOULDBLOCK = libc::WSAEWOULDBLOCK;
109109

110110
// Make sure the call to connect() doesn't block
111111
try!(set_nonblocking(fd, true));

branches/try2/src/librustc/driver/driver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use metadata::common::LinkMeta;
2121
use metadata::creader;
2222
use middle::borrowck::{FnPartsWithCFG};
2323
use middle::borrowck;
24-
use middle::borrowck::graphviz as borrowck_dot;
24+
use borrowck_dot = middle::borrowck::graphviz;
2525
use middle::cfg;
2626
use middle::cfg::graphviz::LabelledCFG;
2727
use middle::{trans, freevars, stability, kind, ty, typeck, reachable};
@@ -35,7 +35,7 @@ use util::common::time;
3535
use util::ppaux;
3636
use util::nodemap::{NodeSet};
3737

38-
use graphviz as dot;
38+
use dot = graphviz;
3939

4040
use serialize::{json, Encodable};
4141

branches/try2/src/librustc/metadata/filesearch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::io::fs;
1616
use std::dynamic_lib::DynamicLibrary;
1717
use std::collections::HashSet;
1818

19-
use util::fs as myfs;
19+
use myfs = util::fs;
2020

2121
pub enum FileMatch { FileMatches, FileDoesntMatch }
2222

0 commit comments

Comments
 (0)