Skip to content

Commit 1091523

Browse files
committed
---
yaml --- r: 128883 b: refs/heads/try c: 9e514af h: refs/heads/master i: 128881: 5b899b9 128879: 017076f v: v3
1 parent 63aee98 commit 1091523

File tree

123 files changed

+540
-1294
lines changed

Some content is hidden

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

123 files changed

+540
-1294
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: dc65307e3be587aa1bee9d17a539822626198f9d
5+
refs/heads/try: 9e514af07e19dd3af2b7ec49d58cc1fe88d3c01e
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: 1 addition & 12 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

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/syntax/rust.vim

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
2626
syn keyword rustKeyword for in if impl let
2727
syn keyword rustKeyword loop once proc pub
2828
syn keyword rustKeyword return super
29-
syn keyword rustKeyword unsafe virtual where while
29+
syn keyword rustKeyword unsafe virtual while
3030
syn keyword rustKeyword use nextgroup=rustModPath,rustModPathInUse skipwhite skipempty
3131
" FIXME: Scoped impl's name is also fallen in this category
3232
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite skipempty
@@ -84,7 +84,7 @@ syn keyword rustEnumVariant Ok Err
8484
syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr
8585
syn keyword rustTrait IntoBytes
8686
syn keyword rustTrait ToCStr
87-
syn keyword rustTrait Char UnicodeChar
87+
syn keyword rustTrait Char
8888
syn keyword rustTrait Clone
8989
syn keyword rustTrait PartialEq PartialOrd Eq Ord Equiv
9090
syn keyword rustEnum Ordering
@@ -102,18 +102,18 @@ syn keyword rustTrait Box
102102
syn keyword rustTrait GenericPath Path PosixPath WindowsPath
103103
syn keyword rustTrait RawPtr
104104
syn keyword rustTrait Buffer Writer Reader Seek
105-
syn keyword rustTrait Str StrVector StrSlice
106-
syn keyword rustTrait IntoMaybeOwned StrAllocating UnicodeStrSlice
105+
syn keyword rustTrait Str StrVector StrSlice OwnedStr
106+
syn keyword rustTrait IntoMaybeOwned StrAllocating
107107
syn keyword rustTrait ToString IntoStr
108108
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
109109
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
110110
syn keyword rustTrait Tuple9 Tuple10 Tuple11 Tuple12
111111
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
112+
syn keyword rustTrait MutableCloneableVector MutableOrdVector
113+
syn keyword rustTrait ImmutableVector MutableVector
114+
syn keyword rustTrait ImmutableEqVector ImmutableOrdVector
115+
syn keyword rustTrait Vector VectorVector
116+
syn keyword rustTrait MutableVectorAllocating
117117
syn keyword rustTrait String
118118
syn keyword rustTrait Vec
119119

branches/try/src/libcollections/bitv.rs

Lines changed: 3 additions & 2 deletions
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

@@ -1271,7 +1272,7 @@ impl BitvSet {
12711272
/// let a = BitvSet::from_bitv(bitv::from_bytes([0b01101000]));
12721273
/// let b = BitvSet::from_bitv(bitv::from_bytes([0b10100000]));
12731274
///
1274-
/// // Print 2, 4 in arbitrary order
1275+
/// // Print 1, 4 in arbitrary order
12751276
/// for x in a.difference(&b) {
12761277
/// println!("{}", x);
12771278
/// }

branches/try/src/libcollections/btree.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@
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-
2114
//! Starting implementation of a btree for rust.
2215
//! Structure inspired by github user davidhalperin's gist.
2316
@@ -31,7 +24,7 @@ use alloc::boxed::Box;
3124
use core::fmt;
3225
use core::fmt::Show;
3326

34-
use MutableSeq;
27+
use {Collection, MutableSeq};
3528
use vec::Vec;
3629

3730
#[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)