Skip to content

Commit f71b6c9

Browse files
committed
---
yaml --- r: 161141 b: refs/heads/snap-stage3 c: cd75847 h: refs/heads/master i: 161139: b874bf8 v: v3
1 parent 735ecd6 commit f71b6c9

File tree

112 files changed

+800
-7209
lines changed

Some content is hidden

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

112 files changed

+800
-7209
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 4eb72d268f337a8f117c86a2ac1b98336cab9e9d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 26107f6181a5301d3af9c9614fee4c69d76c7213
4+
refs/heads/snap-stage3: cd7584743710aa2355eb7e09146fea7c338a27e5
55
refs/heads/try: 0f0d21c1eb5c7be04d323e0b06faf252ad790af6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/AUTHORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ Cole Mickens <[email protected]>
121121
Colin Davidson <[email protected]>
122122
Colin Sherratt <[email protected]>
123123
Conrad Kleinespel <[email protected]>
124+
Corey Farwell <[email protected]>
124125
Corey Ford <[email protected]>
125126
Corey Richardson <[email protected]>
126127

branches/snap-stage3/configure

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,9 +550,19 @@ CFG_LIBDIR_RELATIVE=lib
550550
if [ "$CFG_OSTYPE" = "pc-windows-gnu" ]
551551
then
552552
CFG_LIBDIR_RELATIVE=bin
553-
fi
553+
CFG_LIBDIR="${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}"
554+
else
555+
valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries (ignored on windows platform)"
556+
557+
case "$CFG_LIBDIR" in
558+
"$CFG_PREFIX"/*) CAT_INC=2;;
559+
"$CFG_PREFIX"*) CAT_INC=1;;
560+
*)
561+
err "libdir must begin with the prefix. Use --prefix to set it accordingly.";;
562+
esac
554563

555-
valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries"
564+
CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-`
565+
fi
556566

557567
if [ $HELP -eq 1 ]
558568
then
@@ -989,6 +999,15 @@ for h in $CFG_HOST
989999
do
9901000
for t in $CFG_TARGET
9911001
do
1002+
# host lib dir stage0
1003+
make_dir $h/stage0/lib
1004+
1005+
# target bin dir stage0
1006+
make_dir $h/stage0/lib/rustlib/$t/bin
1007+
1008+
# target lib dir stage0
1009+
make_dir $h/stage0/lib/rustlib/$t/lib
1010+
9921011
for i in 0 1 2 3
9931012
do
9941013
# host bin dir

branches/snap-stage3/mk/crates.mk

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#
3838
# DEPS_<crate>
3939
# These lists are the dependencies of the <crate> that is to be built.
40-
# Rust dependencies are listed bare (i.e. std, green) and native
40+
# Rust dependencies are listed bare (i.e. std) and native
4141
# dependencies have a "native:" prefix (i.e. native:hoedown). All deps
4242
# will be built before the crate itself is built.
4343
#
@@ -49,7 +49,7 @@
4949
# automatically generated for all stage/host/target combinations.
5050
################################################################################
5151

52-
TARGET_CRATES := libc std green native flate arena term \
52+
TARGET_CRATES := libc std flate arena term \
5353
serialize sync getopts collections test time rand \
5454
log regex graphviz core rbml alloc rustrt \
5555
unicode
@@ -66,8 +66,6 @@ DEPS_rustrt := alloc core libc collections native:rustrt_native
6666
DEPS_std := core libc rand alloc collections rustrt sync unicode \
6767
native:rust_builtin native:backtrace
6868
DEPS_graphviz := std
69-
DEPS_green := std native:context_switch
70-
DEPS_native := std
7169
DEPS_syntax := std term serialize log fmt_macros arena libc
7270
DEPS_rustc_trans := rustc rustc_back rustc_llvm libc
7371
DEPS_rustc := syntax flate arena serialize getopts rbml \
@@ -95,9 +93,9 @@ DEPS_regex := std
9593
DEPS_regex_macros = rustc syntax std regex
9694
DEPS_fmt_macros = std
9795

98-
TOOL_DEPS_compiletest := test getopts native
99-
TOOL_DEPS_rustdoc := rustdoc native
100-
TOOL_DEPS_rustc := rustc_trans native
96+
TOOL_DEPS_compiletest := test getopts
97+
TOOL_DEPS_rustdoc := rustdoc
98+
TOOL_DEPS_rustc := rustc_trans
10199
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs
102100
TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
103101
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs

branches/snap-stage3/mk/main.mk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,15 @@ define SREQ
332332
# Destinations of artifacts for the host compiler
333333
HROOT$(1)_H_$(3) = $(3)/stage$(1)
334334
HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin
335+
ifeq ($$(CFG_WINDOWSY_$(3)),1)
335336
HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE)
337+
else
338+
ifeq ($(1),0)
339+
HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/lib
340+
else
341+
HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE)
342+
endif
343+
endif
336344

337345
# Destinations of artifacts for target architectures
338346
TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustlib/$(2)

branches/snap-stage3/src/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ Source layout:
99
| `libcore/` | The Rust core library |
1010
| `libdebug/` | Debugging utilities |
1111
| `libstd/` | The standard library (imported and linked by default) |
12-
| `libgreen/` | The M:N runtime library |
13-
| `libnative/` | The 1:1 runtime library |
1412
| `libsyntax/` | The Rust parser and pretty-printer |
1513
| `libtest/` | Rust's test-runner code |
1614
| ------------------- | --------------------------------------------------------- |

branches/snap-stage3/src/doc/reference.md

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,52 @@ reserved for future extension, that is, the above gives the lexical
225225
grammar, but a Rust parser will reject everything but the 12 special
226226
cases mentioned in [Number literals](#number-literals) below.
227227

228+
#### Examples
229+
230+
##### Characters and strings
231+
232+
| | Example | Number of `#` pairs allowed | Available characters | Escapes | Equivalent to |
233+
|---|---------|-----------------------------|----------------------|---------|---------------|
234+
| [Character](#character-literals) | `'H'` | `N/A` | All unicode | `\'` & [Byte escapes](#byte-escapes) & [Unicode escapes](#unicode-escapes) | `N/A` |
235+
| [String](#string-literals) | `"hello"` | `N/A` | All unicode | `\"` & [Byte escapes](#byte-escapes) & [Unicode escapes](#unicode-escapes) | `N/A` |
236+
| [Raw](#raw-string-literals) | `r##"hello"##` | `0...` | All unicode | `N/A` | `N/A` |
237+
| [Byte](#byte-literals) | `b'H'` | `N/A` | All ASCII | `\'` & [Byte escapes](#byte-escapes) | `u8` |
238+
| [Byte string](#byte-string-literals) | `b"hello"` | `N/A` | All ASCII | `\"` & [Byte escapes](#byte-escapes) | `&'static [u8]` |
239+
| [Raw byte string](#raw-byte-string-literals) | `br##"hello"##` | `0...` | All ASCII | `N/A` | `&'static [u8]` (unsure...not stated) |
240+
241+
##### Byte escapes
242+
243+
| | Name |
244+
|---|------|
245+
| `\x7F` | 8-bit character code (exactly 2 digits) |
246+
| `\n` | Newline |
247+
| `\r` | Carriage return |
248+
| `\t` | Tab |
249+
| `\\` | Backslash |
250+
251+
##### Unicode escapes
252+
| | Name |
253+
|---|------|
254+
| `\u7FFF` | 16-bit character code (exactly 4 digits) |
255+
| `\U7EEEFFFF` | 32-bit character code (exactly 8 digits) |
256+
257+
##### Numbers
258+
259+
| [Number literals](#number-literals)`*` | Example | Exponentiation | Suffixes |
260+
|----------------------------------------|---------|----------------|----------|
261+
| Decimal integer | `98_222i` | `N/A` | Integer suffixes |
262+
| Hex integer | `0xffi` | `N/A` | Integer suffixes |
263+
| Octal integer | `0o77i` | `N/A` | Integer suffixes |
264+
| Binary integer | `0b1111_0000i` | `N/A` | Integer suffixes |
265+
| Floating-point | `123.0E+77f64` | `Optional` | Floating-point suffixes |
266+
267+
`*` All number literals allow `_` as a visual separator: `1_234.0E+18f64`
268+
269+
##### Suffixes
270+
| Integer | Floating-point |
271+
|---------|----------------|
272+
| `i` (`int`), `u` (`uint`), `u8`, `i8`, `u16`, `i16`, `u32`, `i32`, `u64`, `i64` | `f32`, `f64` |
273+
228274
#### Character and string literals
229275

230276
```{.ebnf .gram}
@@ -253,15 +299,21 @@ nonzero_dec: '1' | '2' | '3' | '4'
253299
| '5' | '6' | '7' | '8' | '9' ;
254300
```
255301

302+
##### Character literals
303+
256304
A _character literal_ is a single Unicode character enclosed within two
257305
`U+0027` (single-quote) characters, with the exception of `U+0027` itself,
258306
which must be _escaped_ by a preceding U+005C character (`\`).
259307

308+
##### String literals
309+
260310
A _string literal_ is a sequence of any Unicode characters enclosed within two
261311
`U+0022` (double-quote) characters, with the exception of `U+0022` itself,
262312
which must be _escaped_ by a preceding `U+005C` character (`\`), or a _raw
263313
string literal_.
264314

315+
##### Character escapes
316+
265317
Some additional _escapes_ are available in either character or non-raw string
266318
literals. An escape starts with a `U+005C` (`\`) and continues with one of the
267319
following forms:
@@ -281,6 +333,8 @@ following forms:
281333
* The _backslash escape_ is the character `U+005C` (`\`) which must be
282334
escaped in order to denote *itself*.
283335

336+
##### Raw string literals
337+
284338
Raw string literals do not process any escapes. They start with the character
285339
`U+0072` (`r`), followed by zero or more of the character `U+0023` (`#`) and a
286340
`U+0022` (double-quote) character. The _raw string body_ is not defined in the
@@ -322,12 +376,16 @@ raw_byte_string : '"' raw_byte_string_body '"' | '#' raw_byte_string '#' ;
322376
323377
```
324378

379+
##### Byte literals
380+
325381
A _byte literal_ is a single ASCII character (in the `U+0000` to `U+007F`
326382
range) enclosed within two `U+0027` (single-quote) characters, with the
327383
exception of `U+0027` itself, which must be _escaped_ by a preceding U+005C
328384
character (`\`), or a single _escape_. It is equivalent to a `u8` unsigned
329385
8-bit integer _number literal_.
330386

387+
##### Byte string literals
388+
331389
A _byte string literal_ is a sequence of ASCII characters and _escapes_
332390
enclosed within two `U+0022` (double-quote) characters, with the exception of
333391
`U+0022` itself, which must be _escaped_ by a preceding `U+005C` character
@@ -347,6 +405,8 @@ following forms:
347405
* The _backslash escape_ is the character `U+005C` (`\`) which must be
348406
escaped in order to denote its ASCII encoding `0x5C`.
349407

408+
##### Raw byte string literals
409+
350410
Raw byte string literals do not process any escapes. They start with the
351411
character `U+0062` (`b`), followed by `U+0072` (`r`), followed by zero or more
352412
of the character `U+0023` (`#`), and a `U+0022` (double-quote) character. The
@@ -999,14 +1059,14 @@ An example of what will and will not work for `use` items:
9991059

10001060
```
10011061
# #![allow(unused_imports)]
1002-
use foo::native::start; // good: foo is at the root of the crate
1062+
use foo::core::iter; // good: foo is at the root of the crate
10031063
use foo::baz::foobaz; // good: foo is at the root of the crate
10041064
10051065
mod foo {
1006-
extern crate native;
1066+
extern crate core;
10071067
1008-
use foo::native::start; // good: foo is at crate root
1009-
// use native::start; // bad: native is not at the crate root
1068+
use foo::core::iter; // good: foo is at crate root
1069+
// use core::iter; // bad: native is not at the crate root
10101070
use self::baz::foobaz; // good: self refers to module 'foo'
10111071
use foo::bar::foobar; // good: foo is at crate root
10121072

branches/snap-stage3/src/driver/driver.rs

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

11+
#![no_start]
12+
1113
#[cfg(rustdoc)]
1214
extern crate "rustdoc" as this;
1315

branches/snap-stage3/src/etc/install.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,16 @@ fi
301301
flag uninstall "only uninstall from the installation prefix"
302302
opt verify 1 "verify that the installed binaries run correctly"
303303
valopt prefix "/usr/local" "set installation prefix"
304-
# NB This isn't quite the same definition as in `configure`.
305-
# just using 'lib' instead of CFG_LIBDIR_RELATIVE
304+
# NB This is exactly the same definition as in `configure`.
306305
valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries"
306+
case "$CFG_LIBDIR" in
307+
"$CFG_PREFIX"/*) CAT_INC=2;;
308+
"$CFG_PREFIX"*) CAT_INC=1;;
309+
*)
310+
err "libdir must begin with the prefix. Use --prefix to set it accordingly.";;
311+
esac
312+
CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-`
313+
307314
valopt mandir "${CFG_PREFIX}/share/man" "install man pages in PATH"
308315

309316
if [ $HELP -eq 1 ]
@@ -428,9 +435,9 @@ while read p; do
428435
# Decide the destination of the file
429436
FILE_INSTALL_PATH="${CFG_PREFIX}/$p"
430437

431-
if echo "$p" | grep "^lib/" > /dev/null
438+
if echo "$p" | grep "^${CFG_LIBDIR_RELATIVE}/" > /dev/null
432439
then
433-
pp=`echo $p | sed 's/^lib\///'`
440+
pp=`echo $p | sed "s%^${CFG_LIBDIR_RELATIVE}/%%"`
434441
FILE_INSTALL_PATH="${CFG_LIBDIR}/$pp"
435442
fi
436443

branches/snap-stage3/src/etc/vim/doc/rust.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ g:rust_conceal_pub~
5353
let g:rust_conceal_pub = 1
5454
<
5555

56+
*g:rust_recommended_style*
57+
g:rust_recommended_style~
58+
Set this option to enable vim indentation and textwidth settings to
59+
conform to style conventions of the rust standard library (i.e. use 4
60+
spaces for indents and sets 'textwidth' to 99). This option is enabled
61+
by default. To disable it: >
62+
let g:rust_recommended_style = 0
63+
<
64+
5665
*g:rust_fold*
5766
g:rust_fold~
5867
Set this option to turn on |folding|: >

branches/snap-stage3/src/etc/vim/ftplugin/rust.vim

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ silent! setlocal formatoptions+=j
3535
" otherwise it's better than nothing.
3636
setlocal smartindent nocindent
3737

38-
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
39-
40-
setlocal textwidth=99
38+
if !exists("g:rust_recommended_style") || g:rust_recommended_style == 1
39+
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
40+
setlocal textwidth=99
41+
endif
4142

4243
" This includeexpr isn't perfect, but it's a good start
4344
setlocal includeexpr=substitute(v:fname,'::','/','g')

branches/snap-stage3/src/liballoc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ extern crate libc;
7373

7474
// Allow testing this library
7575

76-
#[cfg(test)] extern crate native;
7776
#[cfg(test)] #[phase(plugin, link)] extern crate std;
7877
#[cfg(test)] #[phase(plugin, link)] extern crate log;
7978

branches/snap-stage3/src/libcollections/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
extern crate unicode;
3232
extern crate alloc;
3333

34-
#[cfg(test)] extern crate native;
3534
#[cfg(test)] extern crate test;
3635

3736
#[cfg(test)] #[phase(plugin, link)] extern crate std;

branches/snap-stage3/src/libcollections/slice.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ fn merge_sort<T>(v: &mut [T], compare: |&T, &T| -> Ordering) {
424424
// allocate some memory to use as scratch memory, we keep the
425425
// length 0 so we can keep shallow copies of the contents of `v`
426426
// without risking the dtors running on an object twice if
427-
// `compare` fails.
427+
// `compare` panics.
428428
let mut working_space = Vec::with_capacity(2 * len);
429429
// these both are buffers of length `len`.
430430
let mut buf_dat = working_space.as_mut_ptr();
@@ -666,6 +666,8 @@ pub mod raw {
666666

667667
#[cfg(test)]
668668
mod tests {
669+
extern crate rustrt;
670+
669671
use std::cell::Cell;
670672
use std::default::Default;
671673
use std::mem;
@@ -949,9 +951,9 @@ mod tests {
949951
#[test]
950952
fn test_swap_remove_noncopyable() {
951953
// Tests that we don't accidentally run destructors twice.
952-
let mut v = vec![rt::exclusive::Exclusive::new(()),
953-
rt::exclusive::Exclusive::new(()),
954-
rt::exclusive::Exclusive::new(())];
954+
let mut v = vec![rustrt::exclusive::Exclusive::new(()),
955+
rustrt::exclusive::Exclusive::new(()),
956+
rustrt::exclusive::Exclusive::new(())];
955957
let mut _e = v.swap_remove(0);
956958
assert_eq!(v.len(), 2);
957959
_e = v.swap_remove(1);

branches/snap-stage3/src/libcollections/str.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
//! # Representation
4343
//!
4444
//! Rust's string type, `str`, is a sequence of Unicode scalar values encoded as a
45-
//! stream of UTF-8 bytes. All strings are guaranteed to be validly encoded UTF-8
46-
//! sequences. Additionally, strings are not null-terminated and can thus contain
47-
//! null bytes.
45+
//! stream of UTF-8 bytes. All [strings](../../reference.html#literals) are
46+
//! guaranteed to be validly encoded UTF-8 sequences. Additionally, strings are
47+
//! not null-terminated and can thus contain null bytes.
4848
//!
4949
//! The actual representation of strings have direct mappings to slices: `&str`
5050
//! is the same as `&[u8]`.
@@ -74,7 +74,8 @@ use vec::Vec;
7474
pub use core::str::{from_utf8, CharEq, Chars, CharOffsets};
7575
pub use core::str::{Bytes, CharSplits};
7676
pub use core::str::{CharSplitsN, AnyLines, MatchIndices, StrSplits};
77-
pub use core::str::{Utf16CodeUnits, eq_slice, is_utf8, is_utf16, Utf16Items};
77+
pub use core::str::{Utf16Encoder, Utf16CodeUnits};
78+
pub use core::str::{eq_slice, is_utf8, is_utf16, Utf16Items};
7879
pub use core::str::{Utf16Item, ScalarValue, LoneSurrogate, utf16_items};
7980
pub use core::str::{truncate_utf16_at_nul, utf8_char_width, CharRange};
8081
pub use core::str::{FromStr, from_str};

0 commit comments

Comments
 (0)