Skip to content

Commit f4a36b0

Browse files
committed
---
yaml --- r: 196541 b: refs/heads/auto c: b3c5507 h: refs/heads/master i: 196539: cc95440 v: v3
1 parent dcb4e3a commit f4a36b0

File tree

22 files changed

+112
-109
lines changed

22 files changed

+112
-109
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: 9b455f1799107de5d64715740d6ca38215eecaac
13+
refs/heads/auto: b3c5507f3a1a5e6caf07ffa63b125725c0b30f3d
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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ 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-
script_str.push_str("set charset UTF-8\n");
385+
let charset = if cfg!(target_os = "bitrig") { "auto" } else { "UTF-8" };
386+
script_str.push_str(&format!("set charset {}\n", charset));
386387
script_str.push_str(&format!("file {}\n", exe_file.to_str().unwrap()));
387388
script_str.push_str("target remote :5039\n");
388389
script_str.push_str(&format!("set solib-search-path \
@@ -516,8 +517,8 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
516517
.to_string();
517518
// write debugger script
518519
let mut script_str = String::with_capacity(2048);
519-
520-
script_str.push_str("set charset UTF-8\n");
520+
let charset = if cfg!(target_os = "bitrig") { "auto" } else { "UTF-8" };
521+
script_str.push_str(&format!("set charset {}\n", charset));
521522
script_str.push_str("show version\n");
522523

523524
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-
/// Perform the conversion.
24+
/// Performs 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-
/// Perform the conversion.
32+
/// Performs 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-
/// Perform the conversion.
41+
/// Performs 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-
/// Perform the conversion.
49+
/// Performs the conversion.
5050
#[stable(feature = "rust1", since = "1.0.0")]
5151
fn from(T) -> Self;
5252
}

branches/auto/src/libcore/iter.rs

Lines changed: 62 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,11 @@ 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() { if !f(x) { return false; } }
611+
for x in self.by_ref() {
612+
if !f(x) {
613+
return false;
614+
}
615+
}
612616
true
613617
}
614618

@@ -633,7 +637,11 @@ pub trait Iterator {
633637
Self: Sized,
634638
F: FnMut(Self::Item) -> bool
635639
{
636-
for x in self.by_ref() { if f(x) { return true; } }
640+
for x in self.by_ref() {
641+
if f(x) {
642+
return true;
643+
}
644+
}
637645
false
638646
}
639647

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

15631571
#[inline]
15641572
fn next(&mut self) -> Option<(A::Item, B::Item)> {
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-
}
1573+
self.a.next().and_then(|x| {
1574+
self.b.next().and_then(|y| {
1575+
Some((x, y))
1576+
})
1577+
})
15721578
}
15731579

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

16271633
#[inline]
16281634
fn idx(&mut self, index: usize) -> Option<(A::Item, B::Item)> {
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-
}
1635+
self.a.idx(index).and_then(|x| {
1636+
self.b.idx(index).and_then(|y| {
1637+
Some((x, y))
1638+
})
1639+
})
16361640
}
16371641
}
16381642

@@ -1748,9 +1752,8 @@ impl<B, I: Iterator, F> Iterator for FilterMap<I, F>
17481752
#[inline]
17491753
fn next(&mut self) -> Option<B> {
17501754
for x in self.iter.by_ref() {
1751-
match (self.f)(x) {
1752-
Some(y) => return Some(y),
1753-
None => ()
1755+
if let Some(y) = (self.f)(x) {
1756+
return Some(y);
17541757
}
17551758
}
17561759
None
@@ -1770,9 +1773,8 @@ impl<B, I: DoubleEndedIterator, F> DoubleEndedIterator for FilterMap<I, F>
17701773
#[inline]
17711774
fn next_back(&mut self) -> Option<B> {
17721775
for x in self.iter.by_ref().rev() {
1773-
match (self.f)(x) {
1774-
Some(y) => return Some(y),
1775-
None => ()
1776+
if let Some(y) = (self.f)(x) {
1777+
return Some(y);
17761778
}
17771779
}
17781780
None
@@ -1794,14 +1796,11 @@ impl<I> Iterator for Enumerate<I> where I: Iterator {
17941796

17951797
#[inline]
17961798
fn next(&mut self) -> Option<(usize, <I as Iterator>::Item)> {
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-
}
1799+
self.iter.next().map(|a| {
1800+
let ret = (self.count, a);
1801+
self.count += 1;
1802+
ret
1803+
})
18051804
}
18061805

18071806
#[inline]
@@ -1816,13 +1815,10 @@ impl<I> DoubleEndedIterator for Enumerate<I> where
18161815
{
18171816
#[inline]
18181817
fn next_back(&mut self) -> Option<(usize, <I as Iterator>::Item)> {
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-
}
1818+
self.iter.next_back().map(|a| {
1819+
let len = self.iter.len();
1820+
(self.count + len, a)
1821+
})
18261822
}
18271823
}
18281824

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

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

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

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

18721867
#[inline]
18731868
fn size_hint(&self) -> (usize, Option<usize>) {
18741869
let (lo, hi) = self.iter.size_hint();
18751870
if self.peeked.is_some() {
18761871
let lo = lo.saturating_add(1);
1877-
let hi = match hi {
1878-
Some(x) => x.checked_add(1),
1879-
None => None
1880-
};
1872+
let hi = hi.and_then(|x| x.checked_add(1));
18811873
(lo, hi)
18821874
} else {
18831875
(lo, hi)
@@ -1966,17 +1958,14 @@ impl<I: Iterator, P> Iterator for TakeWhile<I, P>
19661958
if self.flag {
19671959
None
19681960
} else {
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-
}
1961+
self.iter.next().and_then(|x| {
1962+
if (self.predicate)(&x) {
1963+
Some(x)
1964+
} else {
1965+
self.flag = true;
1966+
None
19771967
}
1978-
None => None
1979-
}
1968+
})
19801969
}
19811970
}
19821971

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

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

20392024
(lower, upper)
20402025
}
@@ -2316,9 +2301,8 @@ pub struct Inspect<I, F> {
23162301
impl<I: Iterator, F> Inspect<I, F> where F: FnMut(&I::Item) {
23172302
#[inline]
23182303
fn do_inspect(&mut self, elt: Option<I::Item>) -> Option<I::Item> {
2319-
match elt {
2320-
Some(ref a) => (self.f)(a),
2321-
None => ()
2304+
if let Some(ref a) = elt {
2305+
(self.f)(a);
23222306
}
23232307

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

26202604
#[inline]
26212605
fn next(&mut self) -> Option<A> {
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-
}
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
26312612
}
2632-
}
2613+
})
26332614
}
26342615

26352616
#[inline]
@@ -2639,10 +2620,7 @@ impl<A: Step + One + Clone> Iterator for RangeInclusive<A> {
26392620
(lo, hi)
26402621
} else {
26412622
let lo = lo.saturating_add(1);
2642-
let hi = match hi {
2643-
Some(x) => x.checked_add(1),
2644-
None => None
2645-
};
2623+
let hi = hi.and_then(|x| x.checked_add(1));
26462624
(lo, hi)
26472625
}
26482626
}
@@ -2805,10 +2783,9 @@ impl<A: Step + One + Clone> Iterator for ops::Range<A> {
28052783

28062784
#[inline]
28072785
fn size_hint(&self) -> (usize, Option<usize>) {
2808-
if let Some(hint) = Step::steps_between(&self.start, &self.end, &A::one()) {
2809-
(hint, Some(hint))
2810-
} else {
2811-
(0, None)
2786+
match Step::steps_between(&self.start, &self.end, &A::one()) {
2787+
Some(hint) => (hint, Some(hint)),
2788+
None => (0, None)
28122789
}
28132790
}
28142791
}
@@ -2899,13 +2876,8 @@ pub fn iterate<T, F>(seed: T, f: F) -> Iterate<T, F> where
28992876
let &mut (ref mut f, ref mut val, ref mut first) = st;
29002877
if *first {
29012878
*first = false;
2902-
} else {
2903-
match val.take() {
2904-
Some(x) => {
2905-
*val = Some((*f)(x))
2906-
}
2907-
None => {}
2908-
}
2879+
} else if let Some(x) = val.take() {
2880+
*val = Some((*f)(x))
29092881
}
29102882
val.clone()
29112883
}

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

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

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

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

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

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
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
1516
// ignore-windows failing on win32 bot
1617
// ignore-freebsd: gdb package too new
1718
// ignore-tidy-linelength

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

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

1516
#[path = "../compile-fail"]
1617
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) -lstdc++
11+
$(CC) bar.c -lfoo -o $(call RUN_BINFILE,bar) $(EXTRAFLAGS) $(EXTRACXXFLAGS)
1212
$(call RUN,bar)
1313
rm $(call STATICLIB,foo*)
1414
$(call RUN,bar)

0 commit comments

Comments
 (0)