Skip to content

Commit dcb4e3a

Browse files
---
yaml --- r: 196540 b: refs/heads/auto c: 9b455f1 h: refs/heads/master v: v3
1 parent cc95440 commit dcb4e3a

File tree

22 files changed

+109
-112
lines changed

22 files changed

+109
-112
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 7155c8d1c03931b1be04c8eba0b9497ae1a494ac
13+
refs/heads/auto: 9b455f1799107de5d64715740d6ca38215eecaac
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/compiletest/runtest.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
382382

383383
// write debugger script
384384
let mut script_str = String::with_capacity(2048);
385-
let charset = if cfg!(target_os = "bitrig") { "auto" } else { "UTF-8" };
386-
script_str.push_str(&format!("set charset {}\n", charset));
385+
script_str.push_str("set charset UTF-8\n");
387386
script_str.push_str(&format!("file {}\n", exe_file.to_str().unwrap()));
388387
script_str.push_str("target remote :5039\n");
389388
script_str.push_str(&format!("set solib-search-path \
@@ -517,8 +516,8 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
517516
.to_string();
518517
// write debugger script
519518
let mut script_str = String::with_capacity(2048);
520-
let charset = if cfg!(target_os = "bitrig") { "auto" } else { "UTF-8" };
521-
script_str.push_str(&format!("set charset {}\n", charset));
519+
520+
script_str.push_str("set charset UTF-8\n");
522521
script_str.push_str("show version\n");
523522

524523
match config.gdb_version {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ If you are trying to execute a closure on an iterator for its side effects,
291291
just use `for` instead.
292292

293293
There are tons of interesting iterator adapters. `take(n)` will return an
294-
iterator over the next `n` elements of the original iterator. Note that this
294+
iterator over the next `n` elements of the original iterator, note that this
295295
has no side effect on the original iterator. Let's try it out with our infinite
296296
iterator from before:
297297

branches/auto/src/libcore/convert.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ use marker::Sized;
2121
/// A cheap, reference-to-reference conversion.
2222
#[stable(feature = "rust1", since = "1.0.0")]
2323
pub trait AsRef<T: ?Sized> {
24-
/// Performs the conversion.
24+
/// Perform the conversion.
2525
#[stable(feature = "rust1", since = "1.0.0")]
2626
fn as_ref(&self) -> &T;
2727
}
2828

2929
/// A cheap, mutable reference-to-mutable reference conversion.
3030
#[stable(feature = "rust1", since = "1.0.0")]
3131
pub trait AsMut<T: ?Sized> {
32-
/// Performs the conversion.
32+
/// Perform the conversion.
3333
#[stable(feature = "rust1", since = "1.0.0")]
3434
fn as_mut(&mut self) -> &mut T;
3535
}
@@ -38,15 +38,15 @@ pub trait AsMut<T: ?Sized> {
3838
/// expensive.
3939
#[stable(feature = "rust1", since = "1.0.0")]
4040
pub trait Into<T>: Sized {
41-
/// Performs the conversion.
41+
/// Perform the conversion.
4242
#[stable(feature = "rust1", since = "1.0.0")]
4343
fn into(self) -> T;
4444
}
4545

4646
/// Construct `Self` via a conversion.
4747
#[stable(feature = "rust1", since = "1.0.0")]
4848
pub trait From<T> {
49-
/// Performs the conversion.
49+
/// Perform the conversion.
5050
#[stable(feature = "rust1", since = "1.0.0")]
5151
fn from(T) -> Self;
5252
}

branches/auto/src/libcore/iter.rs

Lines changed: 90 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -608,11 +608,7 @@ pub trait Iterator {
608608
fn all<F>(&mut self, mut f: F) -> bool where
609609
Self: Sized, F: FnMut(Self::Item) -> bool
610610
{
611-
for x in self.by_ref() {
612-
if !f(x) {
613-
return false;
614-
}
615-
}
611+
for x in self.by_ref() { if !f(x) { return false; } }
616612
true
617613
}
618614

@@ -637,11 +633,7 @@ pub trait Iterator {
637633
Self: Sized,
638634
F: FnMut(Self::Item) -> bool
639635
{
640-
for x in self.by_ref() {
641-
if f(x) {
642-
return true;
643-
}
644-
}
636+
for x in self.by_ref() { if f(x) { return true; } }
645637
false
646638
}
647639

@@ -1570,11 +1562,13 @@ impl<A, B> Iterator for Zip<A, B> where A: Iterator, B: Iterator
15701562

15711563
#[inline]
15721564
fn next(&mut self) -> Option<(A::Item, B::Item)> {
1573-
self.a.next().and_then(|x| {
1574-
self.b.next().and_then(|y| {
1575-
Some((x, y))
1576-
})
1577-
})
1565+
match self.a.next() {
1566+
None => None,
1567+
Some(x) => match self.b.next() {
1568+
None => None,
1569+
Some(y) => Some((x, y))
1570+
}
1571+
}
15781572
}
15791573

15801574
#[inline]
@@ -1632,11 +1626,13 @@ impl<A, B> RandomAccessIterator for Zip<A, B> where
16321626

16331627
#[inline]
16341628
fn idx(&mut self, index: usize) -> Option<(A::Item, B::Item)> {
1635-
self.a.idx(index).and_then(|x| {
1636-
self.b.idx(index).and_then(|y| {
1637-
Some((x, y))
1638-
})
1639-
})
1629+
match self.a.idx(index) {
1630+
None => None,
1631+
Some(x) => match self.b.idx(index) {
1632+
None => None,
1633+
Some(y) => Some((x, y))
1634+
}
1635+
}
16401636
}
16411637
}
16421638

@@ -1752,8 +1748,9 @@ impl<B, I: Iterator, F> Iterator for FilterMap<I, F>
17521748
#[inline]
17531749
fn next(&mut self) -> Option<B> {
17541750
for x in self.iter.by_ref() {
1755-
if let Some(y) = (self.f)(x) {
1756-
return Some(y);
1751+
match (self.f)(x) {
1752+
Some(y) => return Some(y),
1753+
None => ()
17571754
}
17581755
}
17591756
None
@@ -1773,8 +1770,9 @@ impl<B, I: DoubleEndedIterator, F> DoubleEndedIterator for FilterMap<I, F>
17731770
#[inline]
17741771
fn next_back(&mut self) -> Option<B> {
17751772
for x in self.iter.by_ref().rev() {
1776-
if let Some(y) = (self.f)(x) {
1777-
return Some(y);
1773+
match (self.f)(x) {
1774+
Some(y) => return Some(y),
1775+
None => ()
17781776
}
17791777
}
17801778
None
@@ -1796,11 +1794,14 @@ impl<I> Iterator for Enumerate<I> where I: Iterator {
17961794

17971795
#[inline]
17981796
fn next(&mut self) -> Option<(usize, <I as Iterator>::Item)> {
1799-
self.iter.next().map(|a| {
1800-
let ret = (self.count, a);
1801-
self.count += 1;
1802-
ret
1803-
})
1797+
match self.iter.next() {
1798+
Some(a) => {
1799+
let ret = Some((self.count, a));
1800+
self.count += 1;
1801+
ret
1802+
}
1803+
_ => None
1804+
}
18041805
}
18051806

18061807
#[inline]
@@ -1815,10 +1816,13 @@ impl<I> DoubleEndedIterator for Enumerate<I> where
18151816
{
18161817
#[inline]
18171818
fn next_back(&mut self) -> Option<(usize, <I as Iterator>::Item)> {
1818-
self.iter.next_back().map(|a| {
1819-
let len = self.iter.len();
1820-
(self.count + len, a)
1821-
})
1819+
match self.iter.next_back() {
1820+
Some(a) => {
1821+
let len = self.iter.len();
1822+
Some((self.count + len, a))
1823+
}
1824+
_ => None
1825+
}
18221826
}
18231827
}
18241828

@@ -1831,7 +1835,10 @@ impl<I> RandomAccessIterator for Enumerate<I> where I: RandomAccessIterator {
18311835

18321836
#[inline]
18331837
fn idx(&mut self, index: usize) -> Option<(usize, <I as Iterator>::Item)> {
1834-
self.iter.idx(index).map(|a| (self.count + index, a))
1838+
match self.iter.idx(index) {
1839+
Some(a) => Some((self.count + index, a)),
1840+
_ => None,
1841+
}
18351842
}
18361843
}
18371844

@@ -1858,18 +1865,19 @@ impl<I: Iterator> Iterator for Peekable<I> {
18581865

18591866
#[inline]
18601867
fn next(&mut self) -> Option<I::Item> {
1861-
match self.peeked {
1862-
Some(_) => self.peeked.take(),
1863-
None => self.iter.next(),
1864-
}
1868+
if self.peeked.is_some() { self.peeked.take() }
1869+
else { self.iter.next() }
18651870
}
18661871

18671872
#[inline]
18681873
fn size_hint(&self) -> (usize, Option<usize>) {
18691874
let (lo, hi) = self.iter.size_hint();
18701875
if self.peeked.is_some() {
18711876
let lo = lo.saturating_add(1);
1872-
let hi = hi.and_then(|x| x.checked_add(1));
1877+
let hi = match hi {
1878+
Some(x) => x.checked_add(1),
1879+
None => None
1880+
};
18731881
(lo, hi)
18741882
} else {
18751883
(lo, hi)
@@ -1958,14 +1966,17 @@ impl<I: Iterator, P> Iterator for TakeWhile<I, P>
19581966
if self.flag {
19591967
None
19601968
} else {
1961-
self.iter.next().and_then(|x| {
1962-
if (self.predicate)(&x) {
1963-
Some(x)
1964-
} else {
1965-
self.flag = true;
1966-
None
1969+
match self.iter.next() {
1970+
Some(x) => {
1971+
if (self.predicate)(&x) {
1972+
Some(x)
1973+
} else {
1974+
self.flag = true;
1975+
None
1976+
}
19671977
}
1968-
})
1978+
None => None
1979+
}
19691980
}
19701981
}
19711982

@@ -2019,7 +2030,11 @@ impl<I> Iterator for Skip<I> where I: Iterator {
20192030
let (lower, upper) = self.iter.size_hint();
20202031

20212032
let lower = lower.saturating_sub(self.n);
2022-
let upper = upper.map(|x| x.saturating_sub(self.n));
2033+
2034+
let upper = match upper {
2035+
Some(x) => Some(x.saturating_sub(self.n)),
2036+
None => None
2037+
};
20232038

20242039
(lower, upper)
20252040
}
@@ -2301,8 +2316,9 @@ pub struct Inspect<I, F> {
23012316
impl<I: Iterator, F> Inspect<I, F> where F: FnMut(&I::Item) {
23022317
#[inline]
23032318
fn do_inspect(&mut self, elt: Option<I::Item>) -> Option<I::Item> {
2304-
if let Some(ref a) = elt {
2305-
(self.f)(a);
2319+
match elt {
2320+
Some(ref a) => (self.f)(a),
2321+
None => ()
23062322
}
23072323

23082324
elt
@@ -2603,14 +2619,17 @@ impl<A: Step + One + Clone> Iterator for RangeInclusive<A> {
26032619

26042620
#[inline]
26052621
fn next(&mut self) -> Option<A> {
2606-
self.range.next().or_else(|| {
2607-
if !self.done && self.range.start == self.range.end {
2608-
self.done = true;
2609-
Some(self.range.end.clone())
2610-
} else {
2611-
None
2622+
match self.range.next() {
2623+
Some(x) => Some(x),
2624+
None => {
2625+
if !self.done && self.range.start == self.range.end {
2626+
self.done = true;
2627+
Some(self.range.end.clone())
2628+
} else {
2629+
None
2630+
}
26122631
}
2613-
})
2632+
}
26142633
}
26152634

26162635
#[inline]
@@ -2620,7 +2639,10 @@ impl<A: Step + One + Clone> Iterator for RangeInclusive<A> {
26202639
(lo, hi)
26212640
} else {
26222641
let lo = lo.saturating_add(1);
2623-
let hi = hi.and_then(|x| x.checked_add(1));
2642+
let hi = match hi {
2643+
Some(x) => x.checked_add(1),
2644+
None => None
2645+
};
26242646
(lo, hi)
26252647
}
26262648
}
@@ -2783,9 +2805,10 @@ impl<A: Step + One + Clone> Iterator for ops::Range<A> {
27832805

27842806
#[inline]
27852807
fn size_hint(&self) -> (usize, Option<usize>) {
2786-
match Step::steps_between(&self.start, &self.end, &A::one()) {
2787-
Some(hint) => (hint, Some(hint)),
2788-
None => (0, None)
2808+
if let Some(hint) = Step::steps_between(&self.start, &self.end, &A::one()) {
2809+
(hint, Some(hint))
2810+
} else {
2811+
(0, None)
27892812
}
27902813
}
27912814
}
@@ -2876,8 +2899,13 @@ pub fn iterate<T, F>(seed: T, f: F) -> Iterate<T, F> where
28762899
let &mut (ref mut f, ref mut val, ref mut first) = st;
28772900
if *first {
28782901
*first = false;
2879-
} else if let Some(x) = val.take() {
2880-
*val = Some((*f)(x))
2902+
} else {
2903+
match val.take() {
2904+
Some(x) => {
2905+
*val = Some((*f)(x))
2906+
}
2907+
None => {}
2908+
}
28812909
}
28822910
val.clone()
28832911
}

branches/auto/src/librustdoc/html/static/main.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,6 @@
468468
if ($active.length) {
469469
document.location.href = $active.find('a').prop('href');
470470
}
471-
} else {
472-
$active.removeClass('highlighted');
473471
}
474472
});
475473
}

branches/auto/src/libstd/sys/unix/fs.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,7 @@ mod tests {
381381
use prelude::v1::*;
382382

383383
#[cfg_attr(any(target_os = "freebsd",
384-
target_os = "openbsd",
385-
target_os = "bitrig"),
384+
target_os = "openbsd"),
386385
ignore)]
387386
// under some system, pipe(2) will return a bidrectionnal pipe
388387
#[test]

branches/auto/src/test/debuginfo/gdb-pretty-struct-and-enums-pre-gdb-7-7.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// older versions of GDB too. A more extensive test can be found in
1313
// gdb-pretty-struct-and-enums.rs
1414

15-
// ignore-bitrig
1615
// ignore-windows failing on win32 bot
1716
// ignore-freebsd: gdb package too new
1817
// ignore-tidy-linelength

branches/auto/src/test/parse-fail/issue-5806.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
// ignore-windows
1212
// ignore-freebsd
1313
// ignore-openbsd
14-
// ignore-bitrig
1514

1615
#[path = "../compile-fail"]
1716
mod foo; //~ ERROR: a directory

branches/auto/src/test/run-make/c-link-to-rust-staticlib/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ endif
88
ifneq ($(shell uname),FreeBSD)
99
all:
1010
$(RUSTC) foo.rs
11-
$(CC) bar.c -lfoo -o $(call RUN_BINFILE,bar) $(EXTRAFLAGS) $(EXTRACXXFLAGS)
11+
$(CC) bar.c -lfoo -o $(call RUN_BINFILE,bar) $(EXTRAFLAGS) -lstdc++
1212
$(call RUN,bar)
1313
rm $(call STATICLIB,foo*)
1414
$(call RUN,bar)

0 commit comments

Comments
 (0)