Skip to content

Commit 9d252d2

Browse files
committed
---
yaml --- r: 128923 b: refs/heads/try c: 40c4516 h: refs/heads/master i: 128921: aebd942 128919: 3510559 v: v3
1 parent 612fe4c commit 9d252d2

File tree

214 files changed

+860
-2056
lines changed

Some content is hidden

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

214 files changed

+860
-2056
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 07d86b46a949a94223da714e35b343243e4ecce4
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a86d9ad15e339ab343a12513f9c90556f677b9ca
5-
refs/heads/try: d16a5cd7c4d37c947faf4661b22e994409197809
5+
refs/heads/try: 40c45169b7b280bbe27380fc5f1c350d25946ec2
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/doc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ for the 'std' and 'extra' libraries.
1919
To generate HTML documentation from one source file/crate, do something like:
2020

2121
~~~~
22-
rustdoc --output html-doc/ --output-format html ../src/libstd/path.rs
22+
rustdoc --output-dir html-doc/ --output-format html ../src/libstd/path.rs
2323
~~~~
2424

2525
(This, of course, requires a working build of the `rustdoc` tool.)

branches/try/src/doc/guide-unsafe.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,12 +537,11 @@ extern crate core;
537537
use core::prelude::*;
538538
539539
use core::mem;
540+
use core::raw::Slice;
540541
541542
#[no_mangle]
542543
pub extern fn dot_product(a: *const u32, a_len: u32,
543544
b: *const u32, b_len: u32) -> u32 {
544-
use core::raw::Slice;
545-
546545
// Convert the provided arrays into Rust slices.
547546
// The core::raw module guarantees that the Slice
548547
// structure has the same memory layout as a &[T]

branches/try/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/try/src/doc/rust.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -924,9 +924,7 @@ use_decl : "pub" ? "use" [ path "as" ident
924924
925925
path_glob : ident [ "::" [ path_glob
926926
| '*' ] ] ?
927-
| '{' path_item [ ',' path_item ] * '}' ;
928-
929-
path_item : ident | "mod" ;
927+
| '{' ident [ ',' ident ] * '}' ;
930928
~~~~
931929

932930
A _use declaration_ creates one or more local name bindings synonymous
@@ -945,18 +943,14 @@ Use declarations support a number of convenient shortcuts:
945943
* Simultaneously binding a list of paths differing only in their final element,
946944
using the glob-like brace syntax `use a::b::{c,d,e,f};`
947945
* Binding all paths matching a given prefix, using the asterisk wildcard syntax `use a::b::*;`
948-
* Simultaneously binding a list of paths differing only in their final element
949-
and their immediate parent module, using the `mod` keyword, such as `use a::b::{mod, c, d};`
950946

951947
An example of `use` declarations:
952948

953949
~~~~
954950
use std::iter::range_step;
955951
use std::option::{Some, None};
956-
use std::collections::hashmap::{mod, HashMap};
957952
958953
# fn foo<T>(_: T){}
959-
# fn bar(map: HashMap<String, uint>, set: hashmap::HashSet<String>){}
960954
961955
fn main() {
962956
// Equivalent to 'std::iter::range_step(0u, 10u, 2u);'
@@ -965,11 +959,6 @@ fn main() {
965959
// Equivalent to 'foo(vec![std::option::Some(1.0f64),
966960
// std::option::None]);'
967961
foo(vec![Some(1.0f64), None]);
968-
969-
// Both `hash` and `HashMap` are in scope.
970-
let map = HashMap::new();
971-
let set = hashmap::HashSet::new();
972-
bar(map, set);
973962
}
974963
~~~~
975964

@@ -1801,7 +1790,7 @@ module through the rules above. It essentially allows public access into the
18011790
re-exported item. For example, this program is valid:
18021791

18031792
~~~~
1804-
pub use self::implementation as api;
1793+
pub use api = self::implementation;
18051794
18061795
mod implementation {
18071796
pub fn f() {}

branches/try/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/try/src/etc/emacs/rust-mode.el

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
(defconst rust-mode-keywords
171171
'("as"
172172
"box" "break"
173-
"const" "continue" "crate"
173+
"continue" "crate"
174174
"do"
175175
"else" "enum" "extern"
176176
"false" "fn" "for"
@@ -182,8 +182,7 @@
182182
"self" "static" "struct" "super"
183183
"true" "trait" "type"
184184
"unsafe" "use"
185-
"virtual"
186-
"where" "while"))
185+
"while"))
187186

188187
(defconst rust-special-types
189188
'("u8" "i8"

branches/try/src/etc/gedit/share/gtksourceview-3.0/language-specs/rust.lang

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@
7171
<keyword>trait</keyword>
7272
<keyword>unsafe</keyword>
7373
<keyword>use</keyword>
74-
<keyword>virtual</keyword>
75-
<keyword>where</keyword>
7674
<keyword>while</keyword>
7775
</context>
7876

branches/try/src/etc/kate/rust.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
<item> as </item>
2020
<item> break </item>
2121
<item> box </item>
22-
<item> const </item>
2322
<item> continue </item>
2423
<item> crate </item>
2524
<item> do </item>
@@ -45,8 +44,6 @@
4544
<item> trait </item>
4645
<item> unsafe </item>
4746
<item> use </item>
48-
<item> virtual </item>
49-
<item> where </item>
5047
<item> while </item>
5148
</list>
5249
<list name="traits">

branches/try/src/etc/vim/ftplugin/rust.vim

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,6 @@ if exists("g:loaded_delimitMate")
5656
let b:delimitMate_excluded_regions = delimitMate#Get("excluded_regions") . ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
5757
endif
5858

59-
if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
60-
let b:rust_set_foldmethod=1
61-
setlocal foldmethod=syntax
62-
if g:rust_fold == 2
63-
setlocal foldlevel<
64-
else
65-
setlocal foldlevel=99
66-
endif
67-
endif
68-
6959
if has('conceal') && exists('g:rust_conceal')
7060
let b:rust_set_conceallevel=1
7161
setlocal conceallevel=2
@@ -118,10 +108,6 @@ let b:undo_ftplugin = "
118108
\|else
119109
\|unlet! b:delimitMate_excluded_regions
120110
\|endif
121-
\|if exists('b:rust_set_foldmethod')
122-
\|setlocal foldmethod< foldlevel<
123-
\|unlet b:rust_set_foldmethod
124-
\|endif
125111
\|if exists('b:rust_set_conceallevel')
126112
\|setlocal conceallevel<
127113
\|unlet b:rust_set_conceallevel

branches/try/src/etc/vim/syntax/rust.vim

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ elseif exists("b:current_syntax")
1111
finish
1212
endif
1313

14+
" Fold settings {{{1
15+
16+
if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
17+
setlocal foldmethod=syntax
18+
if g:rust_fold == 2
19+
setlocal foldlevel<
20+
else
21+
setlocal foldlevel=99
22+
endif
23+
endif
24+
1425
" Syntax definitions {{{1
1526
" Basic keywords {{{2
1627
syn keyword rustConditional match if else
@@ -26,7 +37,7 @@ syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
2637
syn keyword rustKeyword for in if impl let
2738
syn keyword rustKeyword loop once proc pub
2839
syn keyword rustKeyword return super
29-
syn keyword rustKeyword unsafe virtual where while
40+
syn keyword rustKeyword unsafe virtual while
3041
syn keyword rustKeyword use nextgroup=rustModPath,rustModPathInUse skipwhite skipempty
3142
" FIXME: Scoped impl's name is also fallen in this category
3243
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite skipempty
@@ -84,7 +95,7 @@ syn keyword rustEnumVariant Ok Err
8495
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr
8596
syn keyword rustTrait IntoBytes
8697
syn keyword rustTrait ToCStr
87-
syn keyword rustTrait Char UnicodeChar
98+
syn keyword rustTrait Char
8899
syn keyword rustTrait Clone
89100
syn keyword rustTrait PartialEq PartialOrd Eq Ord Equiv
90101
syn keyword rustEnum Ordering
@@ -102,18 +113,18 @@ syn keyword rustTrait Box
102113
syn keyword rustTrait GenericPath Path PosixPath WindowsPath
103114
syn keyword rustTrait RawPtr
104115
syn keyword rustTrait Buffer Writer Reader Seek
105-
syn keyword rustTrait Str StrVector StrSlice
106-
syn keyword rustTrait IntoMaybeOwned StrAllocating UnicodeStrSlice
116+
syn keyword rustTrait Str StrVector StrSlice OwnedStr
117+
syn keyword rustTrait IntoMaybeOwned StrAllocating
107118
syn keyword rustTrait ToString IntoStr
108119
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
109120
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
110121
syn keyword rustTrait Tuple9 Tuple10 Tuple11 Tuple12
111122
syn keyword rustTrait CloneableVector ImmutableCloneableVector
112-
syn keyword rustTrait MutableCloneableSlice MutableOrdSlice
113-
syn keyword rustTrait ImmutableSlice MutableSlice
114-
syn keyword rustTrait ImmutablePartialEqSlice ImmutableOrdSlice
115-
syn keyword rustTrait Slice VectorVector
116-
syn keyword rustTrait MutableSliceAllocating
123+
syn keyword rustTrait MutableCloneableVector MutableOrdVector
124+
syn keyword rustTrait ImmutableVector MutableVector
125+
syn keyword rustTrait ImmutableEqVector ImmutableOrdVector
126+
syn keyword rustTrait Vector VectorVector
127+
syn keyword rustTrait MutableVectorAllocating
117128
syn keyword rustTrait String
118129
syn keyword rustTrait Vec
119130

branches/try/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/try/src/libcollections/bitv.rs

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -66,34 +66,32 @@ use core::prelude::*;
6666
use core::cmp;
6767
use core::default::Default;
6868
use core::fmt;
69-
use core::iter::Take;
69+
use core::iter::{Chain, Enumerate, Repeat, Skip, Take};
7070
use core::iter;
71+
use core::ops::Index;
7172
use core::slice;
7273
use core::uint;
7374
use std::hash;
7475

75-
use {Mutable, Set, MutableSet, MutableSeq};
76+
use {Collection, Mutable, Set, MutableSet, MutableSeq};
7677
use vec::Vec;
7778

79+
type MatchWords<'a> = Chain<MaskWords<'a>, Skip<Take<Enumerate<Repeat<uint>>>>>;
7880
// Take two BitV's, and return iterators of their words, where the shorter one
7981
// has been padded with 0's
80-
macro_rules! match_words(
81-
($a_expr:expr, $b_expr:expr) => ({
82-
let a = $a_expr;
83-
let b = $b_expr;
84-
let a_len = a.storage.len();
85-
let b_len = b.storage.len();
86-
87-
// have to uselessly pretend to pad the longer one for type matching
88-
if a_len < b_len {
89-
(a.mask_words(0).chain(iter::Repeat::new(0u).enumerate().take(b_len).skip(a_len)),
90-
b.mask_words(0).chain(iter::Repeat::new(0u).enumerate().take(0).skip(0)))
91-
} else {
92-
(a.mask_words(0).chain(iter::Repeat::new(0u).enumerate().take(0).skip(0)),
93-
b.mask_words(0).chain(iter::Repeat::new(0u).enumerate().take(a_len).skip(b_len)))
94-
}
95-
})
96-
)
82+
fn match_words <'a,'b>(a: &'a Bitv, b: &'b Bitv) -> (MatchWords<'a>, MatchWords<'b>) {
83+
let a_len = a.storage.len();
84+
let b_len = b.storage.len();
85+
86+
// have to uselessly pretend to pad the longer one for type matching
87+
if a_len < b_len {
88+
(a.mask_words(0).chain(Repeat::new(0u).enumerate().take(b_len).skip(a_len)),
89+
b.mask_words(0).chain(Repeat::new(0u).enumerate().take(0).skip(0)))
90+
} else {
91+
(a.mask_words(0).chain(Repeat::new(0u).enumerate().take(0).skip(0)),
92+
b.mask_words(0).chain(Repeat::new(0u).enumerate().take(a_len).skip(b_len)))
93+
}
94+
}
9795

9896
static TRUE: bool = true;
9997
static FALSE: bool = false;
@@ -1014,23 +1012,23 @@ impl Extendable<bool> for BitvSet {
10141012
impl PartialOrd for BitvSet {
10151013
#[inline]
10161014
fn partial_cmp(&self, other: &BitvSet) -> Option<Ordering> {
1017-
let (a_iter, b_iter) = match_words!(self.get_ref(), other.get_ref());
1015+
let (a_iter, b_iter) = match_words(self.get_ref(), other.get_ref());
10181016
iter::order::partial_cmp(a_iter, b_iter)
10191017
}
10201018
}
10211019

10221020
impl Ord for BitvSet {
10231021
#[inline]
10241022
fn cmp(&self, other: &BitvSet) -> Ordering {
1025-
let (a_iter, b_iter) = match_words!(self.get_ref(), other.get_ref());
1023+
let (a_iter, b_iter) = match_words(self.get_ref(), other.get_ref());
10261024
iter::order::cmp(a_iter, b_iter)
10271025
}
10281026
}
10291027

10301028
impl cmp::PartialEq for BitvSet {
10311029
#[inline]
10321030
fn eq(&self, other: &BitvSet) -> bool {
1033-
let (a_iter, b_iter) = match_words!(self.get_ref(), other.get_ref());
1031+
let (a_iter, b_iter) = match_words(self.get_ref(), other.get_ref());
10341032
iter::order::eq(a_iter, b_iter)
10351033
}
10361034
}
@@ -1191,10 +1189,10 @@ impl BitvSet {
11911189
self_bitv.reserve(other_bitv.capacity());
11921190

11931191
// virtually pad other with 0's for equal lengths
1194-
let self_len = self_bitv.storage.len();
1195-
let other_len = other_bitv.storage.len();
1196-
let mut other_words = other_bitv.mask_words(0)
1197-
.chain(iter::Repeat::new(0u).enumerate().take(self_len).skip(other_len));
1192+
let mut other_words = {
1193+
let (_, result) = match_words(self_bitv, other_bitv);
1194+
result
1195+
};
11981196

11991197
// Apply values found in other
12001198
for (i, w) in other_words {
@@ -1324,7 +1322,7 @@ impl BitvSet {
13241322
/// let a = BitvSet::from_bitv(bitv::from_bytes([0b01101000]));
13251323
/// let b = BitvSet::from_bitv(bitv::from_bytes([0b10100000]));
13261324
///
1327-
/// // Print 1, 4 in arbitrary order
1325+
/// // Print 2, 4 in arbitrary order
13281326
/// for x in a.difference(&b) {
13291327
/// println!("{}", x);
13301328
/// }

0 commit comments

Comments
 (0)