Skip to content

Commit 90d5d09

Browse files
committed
---
yaml --- r: 208187 b: refs/heads/snap-stage3 c: 7129b25 h: refs/heads/master i: 208185: d2c61f3 208183: 857cc87 v: v3
1 parent a8e4531 commit 90d5d09

File tree

9 files changed

+53
-19
lines changed

9 files changed

+53
-19
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 38a97becdf3e6a6157f6f7ec2d98ade8d8edc193
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: bf06163ea7f41a54e7ef96ac9c5dfcd626299926
4+
refs/heads/snap-stage3: 7129b259491690c4a159ff3d799457aeb05587a6
55
refs/heads/try: 7b4ef47b7805a402d756fb8157101f64880a522f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/configure

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ err() {
1919
exit 1
2020
}
2121

22+
run() {
23+
msg "$@"
24+
"$@"
25+
}
26+
2227
need_ok() {
2328
if [ $? -ne 0 ]
2429
then
@@ -36,8 +41,7 @@ need_cmd() {
3641
make_dir() {
3742
if [ ! -d $1 ]
3843
then
39-
msg "mkdir -p $1"
40-
mkdir -p $1
44+
run mkdir -p $1
4145
fi
4246
}
4347

@@ -46,8 +50,7 @@ copy_if_changed() {
4650
then
4751
msg "leaving $2 unchanged"
4852
else
49-
msg "cp $1 $2"
50-
cp -f $1 $2
53+
run cp -f $1 $2
5154
chmod u-w $2 # make copied artifact read-only
5255
fi
5356
}
@@ -57,8 +60,7 @@ move_if_changed() {
5760
then
5861
msg "leaving $2 unchanged"
5962
else
60-
msg "mv $1 $2"
61-
mv -f $1 $2
63+
run mv -f $1 $2
6264
chmod u-w $2 # make moved artifact read-only
6365
fi
6466
}
@@ -733,6 +735,20 @@ then
733735
probe CFG_JAVAC javac
734736
fi
735737

738+
# the valgrind rpass tests will fail if you don't have a valgrind, but they're
739+
# only disabled if you opt out.
740+
if [ -z "$CFG_VALGRIND" ]
741+
then
742+
# If the user has explicitly asked for valgrind tests, then fail
743+
if [ -n "$CFG_ENABLE_VALGRIND" ] && [ -n "$CFG_ENABLE_VALGRIND_PROVIDED" ]
744+
then
745+
err "No valgrind present, but valgrind tests explicitly requested"
746+
else
747+
CFG_DISABLE_VALGRIND_RPASS=1
748+
putvar CFG_DISABLE_VALGRIND_RPASS
749+
fi
750+
fi
751+
736752
if [ ! -z "$CFG_GDB" ]
737753
then
738754
# Store GDB's version

branches/snap-stage3/mk/dist.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ PKG_FILES := \
5252
doc \
5353
driver \
5454
etc \
55+
error-index-generator \
5556
$(foreach crate,$(CRATES),lib$(crate)) \
5657
libcollectionstest \
5758
libcoretest \

branches/snap-stage3/mk/main.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ ifndef CFG_DISABLE_VALGRIND_RPASS
195195
$(info cfg: valgrind-rpass command set to $(CFG_VALGRIND))
196196
CFG_VALGRIND_RPASS :=$(CFG_VALGRIND)
197197
else
198+
$(info cfg: disabling valgrind run-pass tests)
198199
CFG_VALGRIND_RPASS :=
199200
endif
200201

branches/snap-stage3/src/libcollections/slice.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
#![stable(feature = "rust1", since = "1.0.0")]
8181

8282
use alloc::boxed::Box;
83-
use core::convert::AsRef;
8483
use core::clone::Clone;
8584
use core::cmp::Ordering::{self, Greater, Less};
8685
use core::cmp::{self, Ord, PartialEq};
@@ -1024,25 +1023,25 @@ pub trait SliceConcatExt<T: ?Sized> {
10241023
fn connect(&self, sep: &T) -> Self::Output;
10251024
}
10261025

1027-
impl<T: Clone, V: AsRef<[T]>> SliceConcatExt<T> for [V] {
1026+
impl<T: Clone, V: Borrow<[T]>> SliceConcatExt<T> for [V] {
10281027
type Output = Vec<T>;
10291028

10301029
fn concat(&self) -> Vec<T> {
1031-
let size = self.iter().fold(0, |acc, v| acc + v.as_ref().len());
1030+
let size = self.iter().fold(0, |acc, v| acc + v.borrow().len());
10321031
let mut result = Vec::with_capacity(size);
10331032
for v in self {
1034-
result.push_all(v.as_ref())
1033+
result.push_all(v.borrow())
10351034
}
10361035
result
10371036
}
10381037

10391038
fn connect(&self, sep: &T) -> Vec<T> {
1040-
let size = self.iter().fold(0, |acc, v| acc + v.as_ref().len());
1039+
let size = self.iter().fold(0, |acc, v| acc + v.borrow().len());
10411040
let mut result = Vec::with_capacity(size + self.len());
10421041
let mut first = true;
10431042
for v in self {
10441043
if first { first = false } else { result.push(sep.clone()) }
1045-
result.push_all(v.as_ref())
1044+
result.push_all(v.borrow())
10461045
}
10471046
result
10481047
}

branches/snap-stage3/src/libcollections/str.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ use core::str::pattern::Pattern;
5959
use core::str::pattern::{Searcher, ReverseSearcher, DoubleEndedSearcher};
6060
use rustc_unicode::str::{UnicodeStr, Utf16Encoder};
6161

62-
use core::convert::AsRef;
6362
use vec_deque::VecDeque;
6463
use borrow::{Borrow, ToOwned};
6564
use string::String;
@@ -83,7 +82,7 @@ pub use core::str::pattern;
8382
Section: Creating a string
8483
*/
8584

86-
impl<S: AsRef<str>> SliceConcatExt<str> for [S] {
85+
impl<S: Borrow<str>> SliceConcatExt<str> for [S] {
8786
type Output = String;
8887

8988
fn concat(&self) -> String {
@@ -92,11 +91,11 @@ impl<S: AsRef<str>> SliceConcatExt<str> for [S] {
9291
}
9392

9493
// `len` calculation may overflow but push_str will check boundaries
95-
let len = self.iter().map(|s| s.as_ref().len()).sum();
94+
let len = self.iter().map(|s| s.borrow().len()).sum();
9695
let mut result = String::with_capacity(len);
9796

9897
for s in self {
99-
result.push_str(s.as_ref())
98+
result.push_str(s.borrow())
10099
}
101100

102101
result
@@ -115,7 +114,7 @@ impl<S: AsRef<str>> SliceConcatExt<str> for [S] {
115114
// this is wrong without the guarantee that `self` is non-empty
116115
// `len` calculation may overflow but push_str but will check boundaries
117116
let len = sep.len() * (self.len() - 1)
118-
+ self.iter().map(|s| s.as_ref().len()).sum::<usize>();
117+
+ self.iter().map(|s| s.borrow().len()).sum::<usize>();
119118
let mut result = String::with_capacity(len);
120119
let mut first = true;
121120

@@ -125,7 +124,7 @@ impl<S: AsRef<str>> SliceConcatExt<str> for [S] {
125124
} else {
126125
result.push_str(sep);
127126
}
128-
result.push_str(s.as_ref());
127+
result.push_str(s.borrow());
129128
}
130129
result
131130
}

branches/snap-stage3/src/libcollections/string.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,14 @@ impl AsRef<str> for String {
10571057
}
10581058
}
10591059

1060+
#[stable(feature = "rust1", since = "1.0.0")]
1061+
impl AsRef<[u8]> for String {
1062+
#[inline]
1063+
fn as_ref(&self) -> &[u8] {
1064+
self.as_bytes()
1065+
}
1066+
}
1067+
10601068
#[stable(feature = "rust1", since = "1.0.0")]
10611069
impl<'a> From<&'a str> for String {
10621070
#[cfg(not(test))]

branches/snap-stage3/src/libcore/num/wrapping.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ macro_rules! wrapping_impl {
123123
impl Not for Wrapping<$t> {
124124
type Output = Wrapping<$t>;
125125

126+
#[inline(always)]
126127
fn not(self) -> Wrapping<$t> {
127128
Wrapping(!self.0)
128129
}

branches/snap-stage3/src/libcore/str/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use self::pattern::{Searcher, ReverseSearcher, DoubleEndedSearcher};
2121
use char::CharExt;
2222
use clone::Clone;
2323
use cmp::{self, Eq};
24+
use convert::AsRef;
2425
use default::Default;
2526
use fmt;
2627
use iter::ExactSizeIterator;
@@ -1842,6 +1843,14 @@ impl StrExt for str {
18421843
fn parse<T: FromStr>(&self) -> Result<T, T::Err> { FromStr::from_str(self) }
18431844
}
18441845

1846+
#[stable(feature = "rust1", since = "1.0.0")]
1847+
impl AsRef<[u8]> for str {
1848+
#[inline]
1849+
fn as_ref(&self) -> &[u8] {
1850+
self.as_bytes()
1851+
}
1852+
}
1853+
18451854
/// Pluck a code point out of a UTF-8-like byte slice and return the
18461855
/// index of the next code point.
18471856
#[inline]

0 commit comments

Comments
 (0)