Skip to content

Commit 84a61d1

Browse files
committed
---
yaml --- r: 208190 b: refs/heads/snap-stage3 c: ee06263 h: refs/heads/master v: v3
1 parent a6203d7 commit 84a61d1

Some content is hidden

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

70 files changed

+386
-268
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: 95400c51c31877ea4699adc051477edccb5cfbca
4+
refs/heads/snap-stage3: ee06263f9227c75a3e0df6997bb0bb203c2efa65
55
refs/heads/try: 7b4ef47b7805a402d756fb8157101f64880a522f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/AUTHORS.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,6 @@ Luke Francl <[email protected]>
518518
Luke Metz <[email protected]>
519519
Luke Steensen <[email protected]>
520520
Luqman Aden <[email protected]>
521-
Łukasz Niemier <[email protected]>
522521
Magnus Auvinen <[email protected]>
523522
Mahmut Bulut <[email protected]>
524523
Makoto Nakashima <[email protected]>
@@ -998,4 +997,5 @@ xales <[email protected]>
998997
999998
1000999
1000+
Łukasz Niemier <[email protected]>
10011001

branches/snap-stage3/configure

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

22-
run() {
23-
msg "$@"
24-
"$@"
25-
}
26-
2722
need_ok() {
2823
if [ $? -ne 0 ]
2924
then
@@ -41,7 +36,8 @@ need_cmd() {
4136
make_dir() {
4237
if [ ! -d $1 ]
4338
then
44-
run mkdir -p $1
39+
msg "mkdir -p $1"
40+
mkdir -p $1
4541
fi
4642
}
4743

@@ -50,7 +46,8 @@ copy_if_changed() {
5046
then
5147
msg "leaving $2 unchanged"
5248
else
53-
run cp -f $1 $2
49+
msg "cp $1 $2"
50+
cp -f $1 $2
5451
chmod u-w $2 # make copied artifact read-only
5552
fi
5653
}
@@ -60,7 +57,8 @@ move_if_changed() {
6057
then
6158
msg "leaving $2 unchanged"
6259
else
63-
run mv -f $1 $2
60+
msg "mv $1 $2"
61+
mv -f $1 $2
6462
chmod u-w $2 # make moved artifact read-only
6563
fi
6664
}
@@ -735,20 +733,6 @@ then
735733
probe CFG_JAVAC javac
736734
fi
737735

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-
752736
if [ ! -z "$CFG_GDB" ]
753737
then
754738
# Store GDB's version
@@ -860,7 +844,7 @@ then
860844
CFG_OSX_GCC_VERSION=$("$CFG_GCC" --version 2>&1 | grep "Apple LLVM version")
861845
if [ $? -eq 0 ]
862846
then
863-
step_msg "on OS X >=10.9, forcing use of clang"
847+
step_msg "on OS X 10.9, forcing use of clang"
864848
CFG_ENABLE_CLANG=1
865849
else
866850
if [ $("$CFG_GCC" --version 2>&1 | grep -c ' 4\.[0-6]') -ne 0 ]; then

branches/snap-stage3/mk/dist.mk

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

branches/snap-stage3/mk/main.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ 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)
199198
CFG_VALGRIND_RPASS :=
200199
endif
201200

branches/snap-stage3/src/doc/grammar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ view_item : extern_crate_decl | use_decl ;
329329

330330
```antlr
331331
extern_crate_decl : "extern" "crate" crate_name
332-
crate_name: ident | ( ident "as" ident )
332+
crate_name: ident | ( string_lit as ident )
333333
```
334334

335335
##### Use declarations

branches/snap-stage3/src/doc/reference.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -752,10 +752,11 @@ provided in the `extern_crate_decl`.
752752
The external crate is resolved to a specific `soname` at compile time, and a
753753
runtime linkage requirement to that `soname` is passed to the linker for
754754
loading at runtime. The `soname` is resolved at compile time by scanning the
755-
compiler's library path and matching the optional `crateid` provided against
756-
the `crateid` attributes that were declared on the external crate when it was
757-
compiled. If no `crateid` is provided, a default `name` attribute is assumed,
758-
equal to the `ident` given in the `extern_crate_decl`.
755+
compiler's library path and matching the optional `crateid` provided as a
756+
string literal against the `crateid` attributes that were declared on the
757+
external crate when it was compiled. If no `crateid` is provided, a default
758+
`name` attribute is assumed, equal to the `ident` given in the
759+
`extern_crate_decl`.
759760

760761
Three examples of `extern crate` declarations:
761762

branches/snap-stage3/src/doc/trpl/guessing-game.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,11 @@ rand="0.3.0"
358358
The `[dependencies]` section of `Cargo.toml` is like the `[package]` section:
359359
everything that follows it is part of it, until the next section starts.
360360
Cargo uses the dependencies section to know what dependencies on external
361-
crates you have, and what versions you require. In this case, we’ve used version `0.3.0`.
362-
Cargo understands [Semantic Versioning][semver], which is a standard for writing version
363-
numbers. If we wanted to use the latest version we could use `*` or we could use a range
364-
of versions. [Cargo’s documentation][cargodoc] contains more details.
361+
crates you have, and what versions you require. In this case, we’ve used `*`,
362+
which means that we’ll use the latest version of `rand`. Cargo understands
363+
[Semantic Versioning][semver], which is a standard for writing version
364+
numbers. If we wanted a specific version or range of versions, we could be
365+
more specific here. [Cargo’s documentation][cargodoc] contains more details.
365366

366367
[semver]: http://semver.org
367368
[cargodoc]: http://doc.crates.io/crates-io.html
@@ -409,7 +410,7 @@ $ cargo build
409410
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
410411
```
411412

412-
So, we told Cargo we wanted any `0.3.x` version of `rand`, and so it fetched the latest
413+
So, we told Cargo we wanted any version of `rand`, and so it fetched the latest
413414
version at the time this was written, `v0.3.8`. But what happens when next
414415
week, version `v0.3.9` comes out, with an important bugfix? While getting
415416
bugfixes is important, what if `0.3.9` contains a regression that breaks our

branches/snap-stage3/src/doc/trpl/lifetimes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ fn main() {
116116
}
117117
```
118118

119-
[structs]: structs.html
119+
[struct]: structs.html
120120

121121
As you can see, `struct`s can also have lifetimes. In a similar way to functions,
122122

branches/snap-stage3/src/doc/trpl/method-syntax.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ circle to any arbitrary size.
129129

130130
# Static methods
131131

132-
You can also define static methods that do not take a `self` parameter. Here’s a
132+
You can also define methods that do not take a `self` parameter. Here’s a
133133
pattern that’s very common in Rust code:
134134

135135
```
@@ -188,7 +188,7 @@ struct CircleBuilder {
188188
189189
impl CircleBuilder {
190190
fn new() -> CircleBuilder {
191-
CircleBuilder { x: 0.0, y: 0.0, radius: 1.0, }
191+
CircleBuilder { x: 0.0, y: 0.0, radius: 0.0, }
192192
}
193193
194194
fn x(&mut self, coordinate: f64) -> &mut CircleBuilder {

branches/snap-stage3/src/doc/trpl/mutability.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ safety, and the mechanism by which Rust guarantees it, the
8585
> You may have one or the other of these two kinds of borrows, but not both at
8686
> the same time:
8787
>
88-
> * one or more references (`&T`) to a resource.
88+
> * 0 to N references (`&T`) to a resource.
8989
> * exactly one mutable reference (`&mut T`)
9090
9191
[ownership]: ownership.html

branches/snap-stage3/src/doc/trpl/ownership.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This guide is one of three presenting Rust’s ownership system. This is one of
44
Rust’s most unique and compelling features, with which Rust developers should
55
become quite acquainted. Ownership is how Rust achieves its largest goal,
6-
memory safety. There are a few distinct concepts, each with its own
6+
memory safety. The there are a few distinct concepts, each with its own
77
chapter:
88

99
* ownership, which you’re reading now.
@@ -59,7 +59,6 @@ deterministically, at the end of the scope.
5959

6060
[vect]: ../std/vec/struct.Vec.html
6161
[heap]: the-stack-and-the-heap.html
62-
[bindings]: variable-bindings.html
6362

6463
# Move semantics
6564

@@ -123,7 +122,7 @@ let v2 = v;
123122

124123
The first line creates some data for the vector on the [stack][sh], `v`. The
125124
vector’s data, however, is stored on the [heap][sh], and so it contains a
126-
pointer to that data. When we move `v` to `v2`, it creates a copy of that pointer,
125+
pointer to that data. When we move `v` to `v2`, it creates a copy of that data,
127126
for `v2`. Which would mean two pointers to the contents of the vector on the
128127
heap. That would be a problem: it would violate Rust’s safety guarantees by
129128
introducing a data race. Therefore, Rust forbids using `v` after we’ve done the

branches/snap-stage3/src/doc/trpl/references-and-borrowing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This guide is one of three presenting Rust’s ownership system. This is one of
44
Rust’s most unique and compelling features, with which Rust developers should
55
become quite acquainted. Ownership is how Rust achieves its largest goal,
6-
memory safety. There are a few distinct concepts, each with its own
6+
memory safety. The there are a few distinct concepts, each with its own
77
chapter:
88

99
* [ownership][ownership], ownership, the key concept

branches/snap-stage3/src/doc/trpl/traits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Here’s the error:
192192
```text
193193
error: type `std::fs::File` does not implement any method in scope named `write`
194194
195-
let result = f.write(b"whatever");
195+
let result = f.write(bwhatever);
196196
^~~~~~~~~~~~~~~~~~
197197
```
198198

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

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

8282
use alloc::boxed::Box;
83+
use core::convert::AsRef;
8384
use core::clone::Clone;
8485
use core::cmp::Ordering::{self, Greater, Less};
8586
use core::cmp::{self, Ord, PartialEq};
@@ -1023,25 +1024,25 @@ pub trait SliceConcatExt<T: ?Sized> {
10231024
fn connect(&self, sep: &T) -> Self::Output;
10241025
}
10251026

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

10291030
fn concat(&self) -> Vec<T> {
1030-
let size = self.iter().fold(0, |acc, v| acc + v.borrow().len());
1031+
let size = self.iter().fold(0, |acc, v| acc + v.as_ref().len());
10311032
let mut result = Vec::with_capacity(size);
10321033
for v in self {
1033-
result.push_all(v.borrow())
1034+
result.push_all(v.as_ref())
10341035
}
10351036
result
10361037
}
10371038

10381039
fn connect(&self, sep: &T) -> Vec<T> {
1039-
let size = self.iter().fold(0, |acc, v| acc + v.borrow().len());
1040+
let size = self.iter().fold(0, |acc, v| acc + v.as_ref().len());
10401041
let mut result = Vec::with_capacity(size + self.len());
10411042
let mut first = true;
10421043
for v in self {
10431044
if first { first = false } else { result.push(sep.clone()) }
1044-
result.push_all(v.borrow())
1045+
result.push_all(v.as_ref())
10451046
}
10461047
result
10471048
}

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ 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;
6263
use vec_deque::VecDeque;
6364
use borrow::{Borrow, ToOwned};
6465
use string::String;
@@ -82,7 +83,7 @@ pub use core::str::pattern;
8283
Section: Creating a string
8384
*/
8485

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

8889
fn concat(&self) -> String {
@@ -91,11 +92,11 @@ impl<S: Borrow<str>> SliceConcatExt<str> for [S] {
9192
}
9293

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

9798
for s in self {
98-
result.push_str(s.borrow())
99+
result.push_str(s.as_ref())
99100
}
100101

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

@@ -124,7 +125,7 @@ impl<S: Borrow<str>> SliceConcatExt<str> for [S] {
124125
} else {
125126
result.push_str(sep);
126127
}
127-
result.push_str(s.borrow());
128+
result.push_str(s.as_ref());
128129
}
129130
result
130131
}

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,14 +1057,6 @@ 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-
10681060
#[stable(feature = "rust1", since = "1.0.0")]
10691061
impl<'a> From<&'a str> for String {
10701062
#[cfg(not(test))]

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ impl<T> Vec<T> {
647647
// zero-size types consume no memory, so we can't rely on the
648648
// address space running out
649649
self.len = self.len.checked_add(1).expect("length overflow");
650-
mem::forget(value);
650+
unsafe { mem::forget(value); }
651651
return
652652
}
653653

@@ -994,7 +994,7 @@ impl<T> Vec<T> {
994994
num_u: 0,
995995
marker: PhantomData,
996996
};
997-
mem::forget(vec);
997+
unsafe { mem::forget(vec); }
998998

999999
while pv.num_t != 0 {
10001000
unsafe {

branches/snap-stage3/src/libcore/intrinsics.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ extern "rust-intrinsic" {
232232
pub fn uninit<T>() -> T;
233233

234234
/// Moves a value out of scope without running drop glue.
235+
///
236+
/// `forget` is unsafe because the caller is responsible for
237+
/// ensuring the argument is deallocated already.
238+
#[stable(feature = "rust1", since = "1.0.0")]
235239
pub fn forget<T>(_: T) -> ();
236240

237241
/// Unsafely transforms a value of one type into a value of another type.

0 commit comments

Comments
 (0)