Skip to content

Commit 331a871

Browse files
author
Jakub Wieczorek
committed
---
yaml --- r: 128877 b: refs/heads/try c: 7606f58 h: refs/heads/master i: 128875: e7a8e96 v: v3
1 parent ad65277 commit 331a871

File tree

128 files changed

+561
-1350
lines changed

Some content is hidden

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

128 files changed

+561
-1350
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: 921240e00aa3002c73fb3a8b240eb69118ee391e
5+
refs/heads/try: 7606f580a15da4e093eb51795304c983180a286f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

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/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/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: 19 additions & 8 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
@@ -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/libcollections/bitv.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,12 @@ use core::default::Default;
6868
use core::fmt;
6969
use core::iter::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

7879

branches/try/src/libcollections/btree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use alloc::boxed::Box;
2424
use core::fmt;
2525
use core::fmt::Show;
2626

27-
use MutableSeq;
27+
use {Collection, MutableSeq};
2828
use vec::Vec;
2929

3030
#[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 {Mutable, Deque, MutableSeq};
34+
use {Collection, Mutable, Deque, MutableSeq};
3535

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

branches/try/src/libcollections/lib.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,9 @@
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, import_shadowing)]
25+
#![feature(unsafe_destructor)]
2626
#![no_std]
2727

28-
// NOTE(stage0, pcwalton): Remove after snapshot.
29-
#![allow(unknown_features)]
30-
3128
#[phase(plugin, link)] extern crate core;
3229
extern crate unicode;
3330
extern crate alloc;
@@ -39,11 +36,11 @@ extern crate alloc;
3936
#[cfg(test)] #[phase(plugin, link)] extern crate std;
4037
#[cfg(test)] #[phase(plugin, link)] extern crate log;
4138

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

41+
pub use core::collections::Collection;
4442
pub use bitv::{Bitv, BitvSet};
4543
pub use btree::BTree;
46-
pub use core::prelude::Collection;
4744
pub use dlist::DList;
4845
pub use enum_set::EnumSet;
4946
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 {Mutable, MutableSeq};
157+
use {Collection, Mutable, MutableSeq};
158158
use slice;
159159
use vec::Vec;
160160

branches/try/src/libcollections/ringbuf.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ use core::prelude::*;
1818
use core::cmp;
1919
use core::default::Default;
2020
use core::fmt;
21+
use core::iter::RandomAccessIterator;
2122
use core::iter;
2223
use std::hash::{Writer, Hash};
2324

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

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

branches/try/src/libcollections/slice.rs

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

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

89+
use core::prelude::*;
90+
8991
use core::cmp;
9092
use core::mem::size_of;
9193
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 MutableSeq;
97+
use {Collection, MutableSeq};
9898
use vec::Vec;
9999

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

106107
// Functional utilities
107108

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 {Mutable, Map, MutableMap, MutableSeq};
24+
use {Collection, Mutable, Map, MutableMap, MutableSeq};
2525
use {vec, slice};
2626
use vec::Vec;
2727
use hash;

branches/try/src/libcollections/str.rs

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

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

72+
use core::prelude::*;
73+
7274
use core::default::Default;
7375
use core::fmt;
7476
use core::cmp;
7577
use core::iter::AdditiveIterator;
7678
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};
8179

82-
use {Deque, MutableSeq};
80+
use {Collection, Deque, MutableSeq};
8381
use hash;
8482
use ringbuf::RingBuf;
8583
use string::String;
@@ -1682,7 +1680,7 @@ mod tests {
16821680
fn test_chars_decoding() {
16831681
let mut bytes = [0u8, ..4];
16841682
for c in range(0u32, 0x110000).filter_map(|c| ::core::char::from_u32(c)) {
1685-
let len = c.encode_utf8(bytes).unwrap_or(0);
1683+
let len = c.encode_utf8(bytes);
16861684
let s = ::core::str::from_utf8(bytes.slice_to(len)).unwrap();
16871685
if Some(c) != s.chars().next() {
16881686
fail!("character {:x}={} does not decode correctly", c as u32, c);
@@ -1694,7 +1692,7 @@ mod tests {
16941692
fn test_chars_rev_decoding() {
16951693
let mut bytes = [0u8, ..4];
16961694
for c in range(0u32, 0x110000).filter_map(|c| ::core::char::from_u32(c)) {
1697-
let len = c.encode_utf8(bytes).unwrap_or(0);
1695+
let len = c.encode_utf8(bytes);
16981696
let s = ::core::str::from_utf8(bytes.slice_to(len)).unwrap();
16991697
if Some(c) != s.chars().rev().next() {
17001698
fail!("character {:x}={} does not decode correctly", c as u32, c);

branches/try/src/libcollections/string.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ use core::mem;
2020
use core::ptr;
2121
// FIXME: ICE's abound if you import the `Slice` type while importing `Slice` trait
2222
use RawSlice = core::raw::Slice;
23+
use core::slice::Slice;
2324

24-
use {Mutable, MutableSeq};
25+
use {Collection, Mutable, MutableSeq};
2526
use hash;
2627
use str;
2728
use str::{CharRange, StrAllocating, MaybeOwned, Owned};
@@ -502,7 +503,7 @@ impl String {
502503
data: self.vec.as_ptr().offset(cur_len as int),
503504
len: 4,
504505
};
505-
let used = ch.encode_utf8(mem::transmute(slice)).unwrap_or(0);
506+
let used = ch.encode_utf8(mem::transmute(slice));
506507
self.vec.set_len(cur_len + used);
507508
}
508509
}

branches/try/src/libcollections/treemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ use core::mem::{replace, swap};
4040
use core::ptr;
4141
use std::hash::{Writer, Hash};
4242

43-
use {Mutable, Set, MutableSet, MutableMap, Map, MutableSeq};
43+
use {Collection, Mutable, Set, MutableSet, MutableMap, Map, MutableSeq};
4444
use vec::Vec;
4545

4646
/// This is implemented as an AA tree, which is a simplified variation of

branches/try/src/libcollections/trie.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use core::uint;
2323
use core::iter;
2424
use std::hash::{Writer, Hash};
2525

26-
use {Mutable, Map, MutableMap, Set, MutableSet};
26+
use {Collection, Mutable, Map, MutableMap, Set, MutableSet};
2727
use slice::{Items, MutItems};
2828
use slice;
2929

branches/try/src/libcollections/vec.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ use core::prelude::*;
1414

1515
use alloc::heap::{allocate, reallocate, deallocate};
1616
use RawSlice = core::raw::Slice;
17+
use core::slice::Slice;
1718
use core::cmp::max;
1819
use core::default::Default;
1920
use core::fmt;
2021
use core::mem;
22+
use core::num::{CheckedMul, CheckedAdd};
2123
use core::num;
2224
use core::ptr;
2325
use core::uint;
2426

25-
use {Mutable, MutableSeq};
27+
use {Collection, Mutable, MutableSeq};
2628
use slice::{MutableOrdSlice, MutableSliceAllocating, CloneableVector};
2729
use slice::{Items, MutItems};
2830

0 commit comments

Comments
 (0)