Skip to content

Commit c18d7a2

Browse files
committed
---
yaml --- r: 128892 b: refs/heads/try c: 01ec6fa h: refs/heads/master v: v3
1 parent 801f0db commit c18d7a2

File tree

143 files changed

+1646
-611
lines changed

Some content is hidden

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

143 files changed

+1646
-611
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: 8c9bdda89b93bcb4c3b0ffb1b91b9c73318c5304
5+
refs/heads/try: 01ec6fab21026bee34afe79d54521567de9e8517
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-dir html-doc/ --output-format html ../src/libstd/path.rs
22+
rustdoc --output 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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,11 +537,12 @@ extern crate core;
537537
use core::prelude::*;
538538
539539
use core::mem;
540-
use core::raw::Slice;
541540
542541
#[no_mangle]
543542
pub extern fn dot_product(a: *const u32, a_len: u32,
544543
b: *const u32, b_len: u32) -> u32 {
544+
use core::raw::Slice;
545+
545546
// Convert the provided arrays into Rust slices.
546547
// The core::raw module guarantees that the Slice
547548
// structure has the same memory layout as a &[T]

branches/try/src/doc/rust.md

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

930932
A _use declaration_ creates one or more local name bindings synonymous
@@ -943,14 +945,18 @@ Use declarations support a number of convenient shortcuts:
943945
* Simultaneously binding a list of paths differing only in their final element,
944946
using the glob-like brace syntax `use a::b::{c,d,e,f};`
945947
* 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};`
946950

947951
An example of `use` declarations:
948952

949953
~~~~
950954
use std::iter::range_step;
951955
use std::option::{Some, None};
956+
use std::collections::hashmap::{mod, HashMap};
952957
953958
# fn foo<T>(_: T){}
959+
# fn bar(map: HashMap<String, uint>, set: hashmap::HashSet<String>){}
954960
955961
fn main() {
956962
// Equivalent to 'std::iter::range_step(0u, 10u, 2u);'
@@ -959,6 +965,11 @@ fn main() {
959965
// Equivalent to 'foo(vec![std::option::Some(1.0f64),
960966
// std::option::None]);'
961967
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);
962973
}
963974
~~~~
964975

branches/try/src/etc/emacs/rust-mode.el

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

187188
(defconst rust-special-types
188189
'("u8" "i8"

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

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

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<item> as </item>
2020
<item> break </item>
2121
<item> box </item>
22+
<item> const </item>
2223
<item> continue </item>
2324
<item> crate </item>
2425
<item> do </item>
@@ -44,6 +45,8 @@
4445
<item> trait </item>
4546
<item> unsafe </item>
4647
<item> use </item>
48+
<item> virtual </item>
49+
<item> where </item>
4750
<item> while </item>
4851
</list>
4952
<list name="traits">

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ 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+
5969
if has('conceal') && exists('g:rust_conceal')
6070
let b:rust_set_conceallevel=1
6171
setlocal conceallevel=2
@@ -108,6 +118,10 @@ let b:undo_ftplugin = "
108118
\|else
109119
\|unlet! b:delimitMate_excluded_regions
110120
\|endif
121+
\|if exists('b:rust_set_foldmethod')
122+
\|setlocal foldmethod< foldlevel<
123+
\|unlet b:rust_set_foldmethod
124+
\|endif
111125
\|if exists('b:rust_set_conceallevel')
112126
\|setlocal conceallevel<
113127
\|unlet b:rust_set_conceallevel

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

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,6 @@ 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-
2514
" Syntax definitions {{{1
2615
" Basic keywords {{{2
2716
syn keyword rustConditional match if else
@@ -37,7 +26,7 @@ syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
3726
syn keyword rustKeyword for in if impl let
3827
syn keyword rustKeyword loop once proc pub
3928
syn keyword rustKeyword return super
40-
syn keyword rustKeyword unsafe virtual while
29+
syn keyword rustKeyword unsafe virtual where while
4130
syn keyword rustKeyword use nextgroup=rustModPath,rustModPathInUse skipwhite skipempty
4231
" FIXME: Scoped impl's name is also fallen in this category
4332
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite skipempty
@@ -95,7 +84,7 @@ syn keyword rustEnumVariant Ok Err
9584
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr
9685
syn keyword rustTrait IntoBytes
9786
syn keyword rustTrait ToCStr
98-
syn keyword rustTrait Char
87+
syn keyword rustTrait Char UnicodeChar
9988
syn keyword rustTrait Clone
10089
syn keyword rustTrait PartialEq PartialOrd Eq Ord Equiv
10190
syn keyword rustEnum Ordering
@@ -113,18 +102,18 @@ syn keyword rustTrait Box
113102
syn keyword rustTrait GenericPath Path PosixPath WindowsPath
114103
syn keyword rustTrait RawPtr
115104
syn keyword rustTrait Buffer Writer Reader Seek
116-
syn keyword rustTrait Str StrVector StrSlice OwnedStr
117-
syn keyword rustTrait IntoMaybeOwned StrAllocating
105+
syn keyword rustTrait Str StrVector StrSlice
106+
syn keyword rustTrait IntoMaybeOwned StrAllocating UnicodeStrSlice
118107
syn keyword rustTrait ToString IntoStr
119108
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
120109
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
121110
syn keyword rustTrait Tuple9 Tuple10 Tuple11 Tuple12
122111
syn keyword rustTrait CloneableVector ImmutableCloneableVector
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
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
128117
syn keyword rustTrait String
129118
syn keyword rustTrait Vec
130119

branches/try/src/libcollections/bitv.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,11 @@ use core::default::Default;
6868
use core::fmt;
6969
use core::iter::Take;
7070
use core::iter;
71-
use core::ops::Index;
7271
use core::slice;
7372
use core::uint;
7473
use std::hash;
7574

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

7978
// Take two BitV's, and return iterators of their words, where the shorter one
@@ -1325,7 +1324,7 @@ impl BitvSet {
13251324
/// let a = BitvSet::from_bitv(bitv::from_bytes([0b01101000]));
13261325
/// let b = BitvSet::from_bitv(bitv::from_bytes([0b10100000]));
13271326
///
1328-
/// // Print 2, 4 in arbitrary order
1327+
/// // Print 1, 4 in arbitrary order
13291328
/// for x in a.difference(&b) {
13301329
/// println!("{}", x);
13311330
/// }

branches/try/src/libcollections/btree.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
// btree.rs
1212
//
1313

14+
// NB. this is not deprecated for removal, just deprecating the
15+
// current implementation. If the major pain-points are addressed
16+
// (overuse of by-value self and .clone), this can be removed.
17+
#![deprecated = "the current implementation is extremely inefficient, \
18+
prefer a HashMap, TreeMap or TrieMap"]
19+
#![allow(deprecated)]
20+
1421
//! Starting implementation of a btree for rust.
1522
//! Structure inspired by github user davidhalperin's gist.
1623
@@ -24,7 +31,7 @@ use alloc::boxed::Box;
2431
use core::fmt;
2532
use core::fmt::Show;
2633

27-
use {Collection, MutableSeq};
34+
use MutableSeq;
2835
use vec::Vec;
2936

3037
#[allow(missing_doc)]

branches/try/src/libcollections/dlist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use core::mem;
3131
use core::ptr;
3232
use std::hash::{Writer, Hash};
3333

34-
use {Collection, Mutable, Deque, MutableSeq};
34+
use {Mutable, Deque, MutableSeq};
3535

3636
/// A doubly-linked list.
3737
pub struct DList<T> {

branches/try/src/libcollections/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@
2222
html_playground_url = "http://play.rust-lang.org/")]
2323

2424
#![feature(macro_rules, managed_boxes, default_type_params, phase, globs)]
25-
#![feature(unsafe_destructor)]
25+
#![feature(unsafe_destructor, import_shadowing)]
2626
#![no_std]
2727

28+
// NOTE(stage0, pcwalton): Remove after snapshot.
29+
#![allow(unknown_features)]
30+
2831
#[phase(plugin, link)] extern crate core;
2932
extern crate unicode;
3033
extern crate alloc;
@@ -36,11 +39,11 @@ extern crate alloc;
3639
#[cfg(test)] #[phase(plugin, link)] extern crate std;
3740
#[cfg(test)] #[phase(plugin, link)] extern crate log;
3841

39-
use core::prelude::*;
42+
use core::prelude::Option;
4043

41-
pub use core::collections::Collection;
4244
pub use bitv::{Bitv, BitvSet};
4345
pub use btree::BTree;
46+
pub use core::prelude::Collection;
4447
pub use dlist::DList;
4548
pub use enum_set::EnumSet;
4649
pub use priority_queue::PriorityQueue;

branches/try/src/libcollections/priority_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ use core::default::Default;
154154
use core::mem::{zeroed, replace, swap};
155155
use core::ptr;
156156

157-
use {Collection, Mutable, MutableSeq};
157+
use {Mutable, MutableSeq};
158158
use slice;
159159
use vec::Vec;
160160

branches/try/src/libcollections/ringbuf.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ use core::prelude::*;
1818
use core::cmp;
1919
use core::default::Default;
2020
use core::fmt;
21-
use core::iter::RandomAccessIterator;
2221
use core::iter;
2322
use std::hash::{Writer, Hash};
2423

25-
use {Deque, Collection, Mutable, MutableSeq};
24+
use {Deque, Mutable, MutableSeq};
2625
use vec::Vec;
2726

2827
static INITIAL_CAPACITY: uint = 8u; // 2^3

branches/try/src/libcollections/slice.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,23 +86,22 @@ for &x in numbers.iter() {
8686

8787
#![doc(primitive = "slice")]
8888

89-
use core::prelude::*;
90-
9189
use core::cmp;
9290
use core::mem::size_of;
9391
use core::mem;
92+
use core::prelude::{Clone, Collection, Greater, Iterator, Less, None, Option};
93+
use core::prelude::{Ord, Ordering, RawPtr, Some, range};
9494
use core::ptr;
9595
use core::iter::{range_step, MultiplicativeIterator};
9696

97-
use {Collection, MutableSeq};
97+
use MutableSeq;
9898
use vec::Vec;
9999

100-
pub use core::slice::{ref_slice, mut_ref_slice, Splits, Windows};
101100
pub use core::slice::{Chunks, Slice, ImmutableSlice, ImmutablePartialEqSlice};
102101
pub use core::slice::{ImmutableOrdSlice, MutableSlice, Items, MutItems};
103-
pub use core::slice::{MutSplits, MutChunks};
104-
pub use core::slice::{bytes, MutableCloneableSlice};
105-
pub use core::slice::{BinarySearchResult, Found, NotFound};
102+
pub use core::slice::{MutSplits, MutChunks, Splits};
103+
pub use core::slice::{bytes, ref_slice, MutableCloneableSlice};
104+
pub use core::slice::{Found, NotFound};
106105

107106
// Functional utilities
108107

branches/try/src/libcollections/smallintmap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use core::iter;
2121
use core::iter::{Enumerate, FilterMap};
2222
use core::mem::replace;
2323

24-
use {Collection, Mutable, Map, MutableMap, MutableSeq};
24+
use {Mutable, Map, MutableMap, MutableSeq};
2525
use {vec, slice};
2626
use vec::Vec;
2727
use hash;

branches/try/src/libcollections/str.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,17 @@ is the same as `&[u8]`.
6969

7070
#![doc(primitive = "str")]
7171

72-
use core::prelude::*;
73-
7472
use core::default::Default;
7573
use core::fmt;
7674
use core::cmp;
7775
use core::iter::AdditiveIterator;
7876
use core::mem;
77+
use core::prelude::{Char, Clone, Collection, Eq, Equiv, ImmutableSlice};
78+
use core::prelude::{Iterator, MutableSlice, None, Option, Ord, Ordering};
79+
use core::prelude::{PartialEq, PartialOrd, Result, Slice, Some, Tuple2};
80+
use core::prelude::{range};
7981

80-
use {Collection, Deque, MutableSeq};
82+
use {Deque, MutableSeq};
8183
use hash;
8284
use ringbuf::RingBuf;
8385
use string::String;
@@ -1680,7 +1682,7 @@ mod tests {
16801682
fn test_chars_decoding() {
16811683
let mut bytes = [0u8, ..4];
16821684
for c in range(0u32, 0x110000).filter_map(|c| ::core::char::from_u32(c)) {
1683-
let len = c.encode_utf8(bytes);
1685+
let len = c.encode_utf8(bytes).unwrap_or(0);
16841686
let s = ::core::str::from_utf8(bytes.slice_to(len)).unwrap();
16851687
if Some(c) != s.chars().next() {
16861688
fail!("character {:x}={} does not decode correctly", c as u32, c);
@@ -1692,7 +1694,7 @@ mod tests {
16921694
fn test_chars_rev_decoding() {
16931695
let mut bytes = [0u8, ..4];
16941696
for c in range(0u32, 0x110000).filter_map(|c| ::core::char::from_u32(c)) {
1695-
let len = c.encode_utf8(bytes);
1697+
let len = c.encode_utf8(bytes).unwrap_or(0);
16961698
let s = ::core::str::from_utf8(bytes.slice_to(len)).unwrap();
16971699
if Some(c) != s.chars().rev().next() {
16981700
fail!("character {:x}={} does not decode correctly", c as u32, c);

0 commit comments

Comments
 (0)