Skip to content

Commit 27fcc0c

Browse files
committed
---
yaml --- r: 132846 b: refs/heads/dist-snap c: 958250c h: refs/heads/master v: v3
1 parent 9eaf1a3 commit 27fcc0c

File tree

151 files changed

+657
-1716
lines changed

Some content is hidden

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

151 files changed

+657
-1716
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 457a3c991d79b971be07fce75f9d0c12848fb37c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: ef439ddce0d735bf6ae6f583a76b36a22951ab28
9+
refs/heads/dist-snap: 958250c0e5144c4fb07e80eb1742d810687bd80e
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

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

Lines changed: 6 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -68,32 +68,14 @@ 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

78-
// Take two BitV's, and return iterators of their words, where the shorter one
79-
// 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-
)
9779

9880
static TRUE: bool = true;
9981
static FALSE: bool = false;
@@ -988,7 +970,7 @@ impl<'a> RandomAccessIterator<bool> for Bits<'a> {
988970
/// assert!(bv.eq_vec([true, true, false, true,
989971
/// false, false, false, false]));
990972
/// ```
991-
#[deriving(Clone)]
973+
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)]
992974
pub struct BitvSet(Bitv);
993975

994976
impl Default for BitvSet {
@@ -1011,32 +993,6 @@ impl Extendable<bool> for BitvSet {
1011993
}
1012994
}
1013995

1014-
impl PartialOrd for BitvSet {
1015-
#[inline]
1016-
fn partial_cmp(&self, other: &BitvSet) -> Option<Ordering> {
1017-
let (a_iter, b_iter) = match_words!(self.get_ref(), other.get_ref());
1018-
iter::order::partial_cmp(a_iter, b_iter)
1019-
}
1020-
}
1021-
1022-
impl Ord for BitvSet {
1023-
#[inline]
1024-
fn cmp(&self, other: &BitvSet) -> Ordering {
1025-
let (a_iter, b_iter) = match_words!(self.get_ref(), other.get_ref());
1026-
iter::order::cmp(a_iter, b_iter)
1027-
}
1028-
}
1029-
1030-
impl cmp::PartialEq for BitvSet {
1031-
#[inline]
1032-
fn eq(&self, other: &BitvSet) -> bool {
1033-
let (a_iter, b_iter) = match_words!(self.get_ref(), other.get_ref());
1034-
iter::order::eq(a_iter, b_iter)
1035-
}
1036-
}
1037-
1038-
impl cmp::Eq for BitvSet {}
1039-
1040996
impl BitvSet {
1041997
/// Create a new bit vector set with initially no contents.
1042998
///
@@ -1186,18 +1142,10 @@ impl BitvSet {
11861142
// Unwrap Bitvs
11871143
let &BitvSet(ref mut self_bitv) = self;
11881144
let &BitvSet(ref other_bitv) = other;
1189-
11901145
// Expand the vector if necessary
11911146
self_bitv.reserve(other_bitv.capacity());
1192-
1193-
// 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));
1198-
1199-
// Apply values found in other
1200-
for (i, w) in other_words {
1147+
// Apply values
1148+
for (i, w) in other_bitv.mask_words(0) {
12011149
let old = self_bitv.storage[i];
12021150
let new = f(old, w);
12031151
*self_bitv.storage.get_mut(i) = new;
@@ -1324,7 +1272,7 @@ impl BitvSet {
13241272
/// let a = BitvSet::from_bitv(bitv::from_bytes([0b01101000]));
13251273
/// let b = BitvSet::from_bitv(bitv::from_bytes([0b10100000]));
13261274
///
1327-
/// // Print 1, 4 in arbitrary order
1275+
/// // Print 2, 4 in arbitrary order
13281276
/// for x in a.difference(&b) {
13291277
/// println!("{}", x);
13301278
/// }
@@ -2266,64 +2214,6 @@ mod tests {
22662214
assert!(set1.is_subset(&set2)); // { 2 } { 2, 4 }
22672215
}
22682216

2269-
#[test]
2270-
fn test_bitv_set_intersect_with() {
2271-
// Explicitly 0'ed bits
2272-
let mut a = BitvSet::from_bitv(from_bytes([0b10100010]));
2273-
let mut b = BitvSet::from_bitv(from_bytes([0b00000000]));
2274-
let c = a.clone();
2275-
a.intersect_with(&b);
2276-
b.intersect_with(&c);
2277-
assert!(a.is_empty());
2278-
assert!(b.is_empty());
2279-
2280-
// Uninitialized bits should behave like 0's
2281-
let mut a = BitvSet::from_bitv(from_bytes([0b10100010]));
2282-
let mut b = BitvSet::new();
2283-
let c = a.clone();
2284-
a.intersect_with(&b);
2285-
b.intersect_with(&c);
2286-
assert!(a.is_empty());
2287-
assert!(b.is_empty());
2288-
2289-
// Standard
2290-
let mut a = BitvSet::from_bitv(from_bytes([0b10100010]));
2291-
let mut b = BitvSet::from_bitv(from_bytes([0b01100010]));
2292-
let c = a.clone();
2293-
a.intersect_with(&b);
2294-
b.intersect_with(&c);
2295-
assert_eq!(a.len(), 2);
2296-
assert_eq!(b.len(), 2);
2297-
}
2298-
2299-
#[test]
2300-
fn test_bitv_set_eq() {
2301-
let a = BitvSet::from_bitv(from_bytes([0b10100010]));
2302-
let b = BitvSet::from_bitv(from_bytes([0b00000000]));
2303-
let c = BitvSet::new();
2304-
2305-
assert!(a == a);
2306-
assert!(a != b);
2307-
assert!(a != c);
2308-
assert!(b == b);
2309-
assert!(b == c);
2310-
assert!(c == c);
2311-
}
2312-
2313-
#[test]
2314-
fn test_bitv_set_cmp() {
2315-
let a = BitvSet::from_bitv(from_bytes([0b10100010]));
2316-
let b = BitvSet::from_bitv(from_bytes([0b00000000]));
2317-
let c = BitvSet::new();
2318-
2319-
assert_eq!(a.cmp(&b), Greater);
2320-
assert_eq!(a.cmp(&c), Greater);
2321-
assert_eq!(b.cmp(&a), Less);
2322-
assert_eq!(b.cmp(&c), Equal);
2323-
assert_eq!(c.cmp(&a), Less);
2324-
assert_eq!(c.cmp(&b), Equal);
2325-
}
2326-
23272217
#[test]
23282218
fn test_bitv_remove() {
23292219
let mut a = BitvSet::new();

0 commit comments

Comments
 (0)