Skip to content

Commit 73a9fea

Browse files
committed
---
yaml --- r: 236505 b: refs/heads/auto c: 30b43c1 h: refs/heads/master i: 236503: 9973da9 v: v3
1 parent 779b30d commit 73a9fea

File tree

141 files changed

+934
-742
lines changed

Some content is hidden

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

141 files changed

+934
-742
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 589c82449a8a2fc339757f12001e9309903791e3
11+
refs/heads/auto: 30b43c1b124048b54b190a40e0f7e407fc063b1e
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/configure

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,12 @@ $ pacman -R cmake && pacman -S mingw-w64-x86_64-cmake
12951295
putvar CFG_MSVC_LIB_PATH_${bits}
12961296
;;
12971297

1298+
*-rumprun-netbsd)
1299+
step_msg "targeting rumprun-netbsd, disabling jemalloc"
1300+
CFG_DISABLE_JEMALLOC=1
1301+
putvar CFG_DISABLE_JEMALLOC
1302+
;;
1303+
12981304
*)
12991305
;;
13001306
esac
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# x86_64-rumprun-netbsd configuration
2+
CROSS_PREFIX_x86_64-rumprun-netbsd=x86_64-rumprun-netbsd-
3+
CC_x86_64-rumprun-netbsd=gcc
4+
CXX_x86_64-rumprun-netbsd=g++
5+
CPP_x86_64-rumprun-netbsd=gcc -E
6+
AR_x86_64-rumprun-netbsd=ar
7+
CFG_INSTALL_ONLY_RLIB_x86_64-rumprun-netbsd = 1
8+
CFG_LIB_NAME_x86_64-rumprun-netbsd=lib$(1).so
9+
CFG_STATIC_LIB_NAME_x86_64-rumprun-netbsd=lib$(1).a
10+
CFG_LIB_GLOB_x86_64-rumprun-netbsd=lib$(1)-*.so
11+
CFG_JEMALLOC_CFLAGS_x86_64-rumprun-netbsd := -m64
12+
CFG_GCCISH_CFLAGS_x86_64-rumprun-netbsd := -Wall -Werror -g -fPIC -m64
13+
CFG_GCCISH_CXXFLAGS_x86_64-rumprun-netbsd :=
14+
CFG_GCCISH_LINK_FLAGS_x86_64-rumprun-netbsd :=
15+
CFG_GCCISH_DEF_FLAG_x86_64-rumprun-netbsd :=
16+
CFG_LLC_FLAGS_x86_64-rumprun-netbsd :=
17+
CFG_INSTALL_NAME_x86_64-rumprun-netbsd =
18+
CFG_EXE_SUFFIX_x86_64-rumprun-netbsd =
19+
CFG_WINDOWSY_x86_64-rumprun-netbsd :=
20+
CFG_UNIXY_x86_64-rumprun-netbsd := 1
21+
CFG_LDPATH_x86_64-rumprun-netbsd :=
22+
CFG_RUN_x86_64-rumprun-netbsd=$(2)
23+
CFG_RUN_TARG_x86_64-rumprun-netbsd=$(call CFG_RUN_x86_64-rumprun-netbsd,,$(2))
24+
CFG_GNU_TRIPLE_x86_64-rumprun-netbsd := x86_64-rumprun-netbsd

branches/auto/src/doc/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
## Building
44

5-
To generate all the docs, just run `make docs` from the root of the repository.
6-
This will convert the distributed Markdown docs to HTML and generate HTML doc
7-
for the 'std' and 'extra' libraries.
5+
To generate all the docs, follow the "Building Documentation" instructions in
6+
the README in the root of the repository. This will convert the distributed
7+
Markdown docs to HTML and generate HTML doc for the books, 'std' and 'extra'
8+
libraries.
89

910
To generate HTML documentation from one source file/crate, do something like:
1011

branches/auto/src/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ mod foo {
881881
}
882882
883883
use foo::example::iter; // good: foo is at crate root
884-
// use example::iter; // bad: core is not at the crate root
884+
// use example::iter; // bad: example is not at the crate root
885885
use self::baz::foobaz; // good: self refers to module 'foo'
886886
use foo::bar::foobar; // good: foo is at crate root
887887

branches/auto/src/doc/trpl/iterators.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,16 @@ let greater_than_forty_two = (0..100)
150150
.find(|x| *x > 42);
151151

152152
match greater_than_forty_two {
153-
Some(_) => println!("We got some numbers!"),
154-
None => println!("No numbers found :("),
153+
Some(_) => println!("Found a match!"),
154+
None => println!("No match found :("),
155155
}
156156
```
157157

158158
`find` takes a closure, and works on a reference to each element of an
159159
iterator. This closure returns `true` if the element is the element we're
160-
looking for, and `false` otherwise. Because we might not find a matching
161-
element, `find` returns an `Option` rather than the element itself.
160+
looking for, and `false` otherwise. `find` returns the first element satisfying
161+
the specified predicate. Because we might not find a matching element, `find`
162+
returns an `Option` rather than the element itself.
162163

163164
Another important consumer is `fold`. Here's what it looks like:
164165

branches/auto/src/doc/trpl/structs.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ You can define a `struct` with no members at all:
184184

185185
```rust
186186
struct Electron;
187+
188+
let x = Electron;
187189
```
188190

189191
Such a `struct` is called ‘unit-like’ because it resembles the empty

branches/auto/src/grammar/verify.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use syntax::parse::lexer::TokenAndSpan;
3535

3636
fn parse_token_list(file: &str) -> HashMap<String, token::Token> {
3737
fn id() -> token::Token {
38-
token::Ident(ast::Ident { name: Name(0), ctxt: 0, }, token::Plain)
38+
token::Ident(ast::Ident::with_empty_ctxt(Name(0))), token::Plain)
3939
}
4040

4141
let mut res = HashMap::new();
@@ -75,7 +75,7 @@ fn parse_token_list(file: &str) -> HashMap<String, token::Token> {
7575
"RPAREN" => token::CloseDelim(token::Paren),
7676
"SLASH" => token::BinOp(token::Slash),
7777
"COMMA" => token::Comma,
78-
"LIFETIME" => token::Lifetime(ast::Ident { name: Name(0), ctxt: 0 }),
78+
"LIFETIME" => token::Lifetime(ast::Ident::with_empty_ctxt(Name(0))),
7979
"CARET" => token::BinOp(token::Caret),
8080
"TILDE" => token::Tilde,
8181
"IDENT" => id(),
@@ -208,9 +208,9 @@ fn parse_antlr_token(s: &str, tokens: &HashMap<String, token::Token>, surrogate_
208208
token::Literal(token::ByteStr(..), n) => token::Literal(token::ByteStr(nm), n),
209209
token::Literal(token::ByteStrRaw(..), n) => token::Literal(token::ByteStrRaw(fix(content),
210210
count(content)), n),
211-
token::Ident(..) => token::Ident(ast::Ident { name: nm, ctxt: 0 },
211+
token::Ident(..) => token::Ident(ast::Ident::with_empty_ctxt(nm)),
212212
token::ModName),
213-
token::Lifetime(..) => token::Lifetime(ast::Ident { name: nm, ctxt: 0 }),
213+
token::Lifetime(..) => token::Lifetime(ast::Ident::with_empty_ctxt(nm)),
214214
ref t => t.clone()
215215
};
216216

branches/auto/src/libcollections/enum_set.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,7 @@ impl<E> Clone for EnumSet<E> {
4949
#[stable(feature = "rust1", since = "1.0.0")]
5050
impl<E:CLike + fmt::Debug> fmt::Debug for EnumSet<E> {
5151
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
52-
try!(write!(fmt, "{{"));
53-
let mut first = true;
54-
for e in self {
55-
if !first {
56-
try!(write!(fmt, ", "));
57-
}
58-
try!(write!(fmt, "{:?}", e));
59-
first = false;
60-
}
61-
write!(fmt, "}}")
52+
fmt.debug_set().entries(self).finish()
6253
}
6354
}
6455

branches/auto/src/libcollections/str.rs

Lines changed: 30 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,25 +1155,21 @@ impl str {
11551155
core_str::StrExt::rmatches(self, pat)
11561156
}
11571157

1158-
/// An iterator over the start and end indices of the disjoint matches
1159-
/// of a pattern within `self`.
1158+
/// An iterator over the disjoint matches of a pattern within `self` as well
1159+
/// as the index that the match starts at.
11601160
///
11611161
/// For matches of `pat` within `self` that overlap, only the indices
1162-
/// corresponding to the first
1163-
/// match are returned.
1162+
/// corresponding to the first match are returned.
11641163
///
1165-
/// The pattern can be a simple `&str`, `char`, or a closure that
1166-
/// determines if a character matches.
1167-
/// Additional libraries might provide more complex patterns like
1168-
/// regular expressions.
1164+
/// The pattern can be a simple `&str`, `char`, or a closure that determines
1165+
/// if a character matches. Additional libraries might provide more complex
1166+
/// patterns like regular expressions.
11691167
///
11701168
/// # Iterator behavior
11711169
///
11721170
/// The returned iterator will be double ended if the pattern allows a
1173-
/// reverse search
1174-
/// and forward/reverse search yields the same elements. This is true for,
1175-
/// eg, `char` but not
1176-
/// for `&str`.
1171+
/// reverse search and forward/reverse search yields the same elements. This
1172+
/// is true for, eg, `char` but not for `&str`.
11771173
///
11781174
/// If the pattern allows a reverse search but its results might differ
11791175
/// from a forward search, `rmatch_indices()` can be used.
@@ -1183,42 +1179,36 @@ impl str {
11831179
/// ```
11841180
/// #![feature(str_match_indices)]
11851181
///
1186-
/// let v: Vec<(usize, usize)> = "abcXXXabcYYYabc".match_indices("abc").collect();
1187-
/// assert_eq!(v, [(0, 3), (6, 9), (12, 15)]);
1182+
/// let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect();
1183+
/// assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]);
11881184
///
1189-
/// let v: Vec<(usize, usize)> = "1abcabc2".match_indices("abc").collect();
1190-
/// assert_eq!(v, [(1, 4), (4, 7)]);
1185+
/// let v: Vec<_> = "1abcabc2".match_indices("abc").collect();
1186+
/// assert_eq!(v, [(1, "abc"), (4, "abc")]);
11911187
///
1192-
/// let v: Vec<(usize, usize)> = "ababa".match_indices("aba").collect();
1193-
/// assert_eq!(v, [(0, 3)]); // only the first `aba`
1188+
/// let v: Vec<_> = "ababa".match_indices("aba").collect();
1189+
/// assert_eq!(v, [(0, "aba")]); // only the first `aba`
11941190
/// ```
11951191
#[unstable(feature = "str_match_indices",
11961192
reason = "might have its iterator type changed",
11971193
issue = "27743")]
1198-
// NB: Right now MatchIndices yields `(usize, usize)`, but it would
1199-
// be more consistent with `matches` and `char_indices` to return `(usize, &str)`
12001194
pub fn match_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> MatchIndices<'a, P> {
12011195
core_str::StrExt::match_indices(self, pat)
12021196
}
12031197

1204-
/// An iterator over the start and end indices of the disjoint matches of
1205-
/// a pattern within
1206-
/// `self`, yielded in reverse order.
1198+
/// An iterator over the disjoint matches of a pattern within `self`,
1199+
/// yielded in reverse order along with the index of the match.
12071200
///
12081201
/// For matches of `pat` within `self` that overlap, only the indices
1209-
/// corresponding to the last
1210-
/// match are returned.
1202+
/// corresponding to the last match are returned.
12111203
///
1212-
/// The pattern can be a simple `&str`, `char`, or a closure that
1213-
/// determines if a character matches.
1214-
/// Additional libraries might provide more complex patterns like
1215-
/// regular expressions.
1204+
/// The pattern can be a simple `&str`, `char`, or a closure that determines
1205+
/// if a character matches. Additional libraries might provide more complex
1206+
/// patterns like regular expressions.
12161207
///
12171208
/// # Iterator behavior
12181209
///
1219-
/// The returned iterator requires that the pattern supports a
1220-
/// reverse search,
1221-
/// and it will be double ended if a forward/reverse search yields
1210+
/// The returned iterator requires that the pattern supports a reverse
1211+
/// search, and it will be double ended if a forward/reverse search yields
12221212
/// the same elements.
12231213
///
12241214
/// For iterating from the front, `match_indices()` can be used.
@@ -1228,20 +1218,18 @@ impl str {
12281218
/// ```
12291219
/// #![feature(str_match_indices)]
12301220
///
1231-
/// let v: Vec<(usize, usize)> = "abcXXXabcYYYabc".rmatch_indices("abc").collect();
1232-
/// assert_eq!(v, [(12, 15), (6, 9), (0, 3)]);
1221+
/// let v: Vec<_> = "abcXXXabcYYYabc".rmatch_indices("abc").collect();
1222+
/// assert_eq!(v, [(12, "abc"), (6, "abc"), (0, "abc")]);
12331223
///
1234-
/// let v: Vec<(usize, usize)> = "1abcabc2".rmatch_indices("abc").collect();
1235-
/// assert_eq!(v, [(4, 7), (1, 4)]);
1224+
/// let v: Vec<_> = "1abcabc2".rmatch_indices("abc").collect();
1225+
/// assert_eq!(v, [(4, "abc"), (1, "abc")]);
12361226
///
1237-
/// let v: Vec<(usize, usize)> = "ababa".rmatch_indices("aba").collect();
1238-
/// assert_eq!(v, [(2, 5)]); // only the last `aba`
1227+
/// let v: Vec<_> = "ababa".rmatch_indices("aba").collect();
1228+
/// assert_eq!(v, [(2, "aba")]); // only the last `aba`
12391229
/// ```
12401230
#[unstable(feature = "str_match_indices",
12411231
reason = "might have its iterator type changed",
12421232
issue = "27743")]
1243-
// NB: Right now RMatchIndices yields `(usize, usize)`, but it would
1244-
// be more consistent with `rmatches` and `char_indices` to return `(usize, &str)`
12451233
pub fn rmatch_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> RMatchIndices<'a, P>
12461234
where P::Searcher: ReverseSearcher<'a>
12471235
{
@@ -1414,10 +1402,10 @@ impl str {
14141402
pub fn replace(&self, from: &str, to: &str) -> String {
14151403
let mut result = String::new();
14161404
let mut last_end = 0;
1417-
for (start, end) in self.match_indices(from) {
1405+
for (start, part) in self.match_indices(from) {
14181406
result.push_str(unsafe { self.slice_unchecked(last_end, start) });
14191407
result.push_str(to);
1420-
last_end = end;
1408+
last_end = start + part.len();
14211409
}
14221410
result.push_str(unsafe { self.slice_unchecked(last_end, self.len()) });
14231411
result

branches/auto/src/libcollections/string.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,8 +1041,8 @@ impl ops::DerefMut for String {
10411041
#[unstable(feature = "str_parse_error", reason = "may want to be replaced with \
10421042
Void if it ever exists",
10431043
issue = "27734")]
1044-
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
1045-
pub struct ParseError(());
1044+
#[derive(Copy)]
1045+
pub enum ParseError {}
10461046

10471047
#[stable(feature = "rust1", since = "1.0.0")]
10481048
impl FromStr for String {
@@ -1053,6 +1053,26 @@ impl FromStr for String {
10531053
}
10541054
}
10551055

1056+
impl Clone for ParseError {
1057+
fn clone(&self) -> ParseError {
1058+
match *self {}
1059+
}
1060+
}
1061+
1062+
impl fmt::Debug for ParseError {
1063+
fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
1064+
match *self {}
1065+
}
1066+
}
1067+
1068+
impl PartialEq for ParseError {
1069+
fn eq(&self, _: &ParseError) -> bool {
1070+
match *self {}
1071+
}
1072+
}
1073+
1074+
impl Eq for ParseError {}
1075+
10561076
/// A generic trait for converting a value to a string
10571077
#[stable(feature = "rust1", since = "1.0.0")]
10581078
pub trait ToString {

branches/auto/src/libcollections/vec_deque.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,14 +1783,7 @@ impl<'a, T: 'a + Copy> Extend<&'a T> for VecDeque<T> {
17831783
#[stable(feature = "rust1", since = "1.0.0")]
17841784
impl<T: fmt::Debug> fmt::Debug for VecDeque<T> {
17851785
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1786-
try!(write!(f, "["));
1787-
1788-
for (i, e) in self.iter().enumerate() {
1789-
if i != 0 { try!(write!(f, ", ")); }
1790-
try!(write!(f, "{:?}", *e));
1791-
}
1792-
1793-
write!(f, "]")
1786+
f.debug_list().entries(self).finish()
17941787
}
17951788
}
17961789

branches/auto/src/libcollectionstest/str.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ fn test_pattern_deref_forward() {
10471047
fn test_empty_match_indices() {
10481048
let data = "aä中!";
10491049
let vec: Vec<_> = data.match_indices("").collect();
1050-
assert_eq!(vec, [(0, 0), (1, 1), (3, 3), (6, 6), (7, 7)]);
1050+
assert_eq!(vec, [(0, ""), (1, ""), (3, ""), (6, ""), (7, "")]);
10511051
}
10521052

10531053
#[test]
@@ -1477,7 +1477,7 @@ generate_iterator_test! {
14771477

14781478
generate_iterator_test! {
14791479
double_ended_match_indices {
1480-
("a1b2c3", char::is_numeric) -> [(1, 2), (3, 4), (5, 6)];
1480+
("a1b2c3", char::is_numeric) -> [(1, "1"), (3, "2"), (5, "3")];
14811481
}
14821482
with str::match_indices, str::rmatch_indices;
14831483
}

branches/auto/src/libcore/ops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,7 @@ impl<Idx: fmt::Debug> fmt::Debug for RangeTo<Idx> {
16281628
/// impl<T> Deref for DerefExample<T> {
16291629
/// type Target = T;
16301630
///
1631-
/// fn deref<'a>(&'a self) -> &'a T {
1631+
/// fn deref(&self) -> &T {
16321632
/// &self.value
16331633
/// }
16341634
/// }

branches/auto/src/libcore/str/mod.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -729,15 +729,19 @@ struct MatchIndicesInternal<'a, P: Pattern<'a>>(P::Searcher);
729729

730730
impl<'a, P: Pattern<'a>> MatchIndicesInternal<'a, P> {
731731
#[inline]
732-
fn next(&mut self) -> Option<(usize, usize)> {
733-
self.0.next_match()
732+
fn next(&mut self) -> Option<(usize, &'a str)> {
733+
self.0.next_match().map(|(start, end)| unsafe {
734+
(start, self.0.haystack().slice_unchecked(start, end))
735+
})
734736
}
735737

736738
#[inline]
737-
fn next_back(&mut self) -> Option<(usize, usize)>
739+
fn next_back(&mut self) -> Option<(usize, &'a str)>
738740
where P::Searcher: ReverseSearcher<'a>
739741
{
740-
self.0.next_match_back()
742+
self.0.next_match_back().map(|(start, end)| unsafe {
743+
(start, self.0.haystack().slice_unchecked(start, end))
744+
})
741745
}
742746
}
743747

@@ -753,7 +757,7 @@ generate_pattern_iterators! {
753757
reason = "type may be removed or have its iterator impl changed",
754758
issue = "27743")]
755759
internal:
756-
MatchIndicesInternal yielding ((usize, usize));
760+
MatchIndicesInternal yielding ((usize, &'a str));
757761
delegate double ended;
758762
}
759763

0 commit comments

Comments
 (0)