Skip to content

Commit a62ce2d

Browse files
committed
---
yaml --- r: 157299 b: refs/heads/auto c: 8384dd9 h: refs/heads/master i: 157297: 1cc278f 157295: 4c610fe v: v3
1 parent ed32ccf commit a62ce2d

Some content is hidden

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

61 files changed

+860
-650
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: f3d72dc6a7d74e37f5f37c67682a0f4ee52a0898
16+
refs/heads/auto: 8384dd93571181047f0461379e7ec49e5305b178
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/mk/llvm.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ endif
3838
# the stamp in the source dir.
3939
$$(LLVM_STAMP_$(1)): $(S)src/rustllvm/llvm-auto-clean-trigger
4040
@$$(call E, make: cleaning llvm)
41-
$(Q)$(MAKE) clean-llvm$(1)
41+
$(Q)$(MAKE) clean-llvm
4242
@$$(call E, make: done cleaning llvm)
4343
touch $$@
4444

branches/auto/src/doc/complement-bugreport.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ release: 0.12.0
4747
```
4848

4949
Finally, if you can run the offending command under gdb, pasting a stack trace can be
50-
useful; to do so, you will need to set a breakpoint on `rust_panic`.
50+
useful; to do so, you will need to set a breakpoint on `rust_fail`.
5151

5252
# I submitted a bug, but nobody has commented on it!
5353

branches/auto/src/doc/guide-lifetimes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ a reference.
5656
fn compute_distance(p1: &Point, p2: &Point) -> f64 {
5757
let x_d = p1.x - p2.x;
5858
let y_d = p1.y - p2.y;
59-
(x_d * x_d + y_d * y_d).sqrt()
59+
sqrt(x_d * x_d + y_d * y_d)
6060
}
6161
~~~
6262

branches/auto/src/doc/reference.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ exposing an API making it possible for it to occur in safe code.
11531153

11541154
* Data races
11551155
* Dereferencing a null/dangling raw pointer
1156-
* Mutating an immutable value/reference without `UnsafeCell`
1156+
* Mutating an immutable value/reference
11571157
* Reads of [undef](http://llvm.org/docs/LangRef.html#undefined-values)
11581158
(uninitialized) memory
11591159
* Breaking the [pointer aliasing
@@ -1166,14 +1166,11 @@ exposing an API making it possible for it to occur in safe code.
11661166
* Using `std::ptr::copy_nonoverlapping_memory` (`memcpy32`/`memcpy64`
11671167
instrinsics) on overlapping buffers
11681168
* Invalid values in primitive types, even in private fields/locals:
1169-
* Dangling/null references or boxes
1169+
* Dangling/null pointers in non-raw pointers, or slices
11701170
* A value other than `false` (0) or `true` (1) in a `bool`
11711171
* A discriminant in an `enum` not included in the type definition
11721172
* A value in a `char` which is a surrogate or above `char::MAX`
11731173
* non-UTF-8 byte sequences in a `str`
1174-
* Unwinding into Rust from foreign code or unwinding from Rust into foreign
1175-
code. Rust's failure system is not compatible with exception handling in
1176-
other languages. Unwinding must be caught and handled at FFI boundaries.
11771174

11781175
##### Behaviour not considered unsafe
11791176

branches/auto/src/doc/rustdoc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ testing this code, the `fib` function will be included (so it can compile).
221221

222222
Running tests often requires some special configuration to filter tests, find
223223
libraries, or try running ignored examples. The testing framework that rustdoc
224-
uses is built on crate `test`, which is also used when you compile crates with
224+
uses is build on crate `test`, which is also used when you compile crates with
225225
rustc's `--test` flag. Extra arguments can be passed to rustdoc's test harness
226226
with the `--test-args` flag.
227227

branches/auto/src/libarena/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,13 @@ impl Arena {
208208
}
209209

210210
#[inline]
211-
fn alloc_copy<T>(&self, op: || -> T) -> &mut T {
211+
fn alloc_copy<T>(&self, op: || -> T) -> &T {
212212
unsafe {
213213
let ptr = self.alloc_copy_inner(mem::size_of::<T>(),
214214
mem::min_align_of::<T>());
215215
let ptr = ptr as *mut T;
216216
ptr::write(&mut (*ptr), op());
217-
return &mut *ptr;
217+
return &*ptr;
218218
}
219219
}
220220

@@ -262,7 +262,7 @@ impl Arena {
262262
}
263263

264264
#[inline]
265-
fn alloc_noncopy<T>(&self, op: || -> T) -> &mut T {
265+
fn alloc_noncopy<T>(&self, op: || -> T) -> &T {
266266
unsafe {
267267
let tydesc = get_tydesc::<T>();
268268
let (ty_ptr, ptr) =
@@ -279,14 +279,14 @@ impl Arena {
279279
// the object is there.
280280
*ty_ptr = bitpack_tydesc_ptr(tydesc, true);
281281

282-
return &mut *ptr;
282+
return &*ptr;
283283
}
284284
}
285285

286286
/// Allocates a new item in the arena, using `op` to initialize the value,
287287
/// and returns a reference to it.
288288
#[inline]
289-
pub fn alloc<T>(&self, op: || -> T) -> &mut T {
289+
pub fn alloc<T>(&self, op: || -> T) -> &T {
290290
unsafe {
291291
if intrinsics::needs_drop::<T>() {
292292
self.alloc_noncopy(op)
@@ -458,12 +458,12 @@ impl<T> TypedArena<T> {
458458

459459
/// Allocates an object in the `TypedArena`, returning a reference to it.
460460
#[inline]
461-
pub fn alloc(&self, object: T) -> &mut T {
461+
pub fn alloc(&self, object: T) -> &T {
462462
if self.ptr == self.end {
463463
self.grow()
464464
}
465465

466-
let ptr: &mut T = unsafe {
466+
let ptr: &T = unsafe {
467467
let ptr: &mut T = mem::transmute(self.ptr);
468468
ptr::write(ptr, object);
469469
self.ptr.set(self.ptr.get().offset(1));

branches/auto/src/libcollections/str.rs

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,6 +1677,40 @@ mod tests {
16771677
assert_eq!(pos, p.len());
16781678
}
16791679

1680+
#[test]
1681+
fn test_split_char_iterator() {
1682+
let data = "\nMäry häd ä little lämb\nLittle lämb\n";
1683+
1684+
let split: Vec<&str> = data.split(' ').collect();
1685+
assert_eq!( split, vec!["\nMäry", "häd", "ä", "little", "lämb\nLittle", "lämb\n"]);
1686+
1687+
let mut rsplit: Vec<&str> = data.split(' ').rev().collect();
1688+
rsplit.reverse();
1689+
assert_eq!(rsplit, vec!["\nMäry", "häd", "ä", "little", "lämb\nLittle", "lämb\n"]);
1690+
1691+
let split: Vec<&str> = data.split(|c: char| c == ' ').collect();
1692+
assert_eq!( split, vec!["\nMäry", "häd", "ä", "little", "lämb\nLittle", "lämb\n"]);
1693+
1694+
let mut rsplit: Vec<&str> = data.split(|c: char| c == ' ').rev().collect();
1695+
rsplit.reverse();
1696+
assert_eq!(rsplit, vec!["\nMäry", "häd", "ä", "little", "lämb\nLittle", "lämb\n"]);
1697+
1698+
// Unicode
1699+
let split: Vec<&str> = data.split('ä').collect();
1700+
assert_eq!( split, vec!["\nM", "ry h", "d ", " little l", "mb\nLittle l", "mb\n"]);
1701+
1702+
let mut rsplit: Vec<&str> = data.split('ä').rev().collect();
1703+
rsplit.reverse();
1704+
assert_eq!(rsplit, vec!["\nM", "ry h", "d ", " little l", "mb\nLittle l", "mb\n"]);
1705+
1706+
let split: Vec<&str> = data.split(|c: char| c == 'ä').collect();
1707+
assert_eq!( split, vec!["\nM", "ry h", "d ", " little l", "mb\nLittle l", "mb\n"]);
1708+
1709+
let mut rsplit: Vec<&str> = data.split(|c: char| c == 'ä').rev().collect();
1710+
rsplit.reverse();
1711+
assert_eq!(rsplit, vec!["\nM", "ry h", "d ", " little l", "mb\nLittle l", "mb\n"]);
1712+
}
1713+
16801714
#[test]
16811715
fn test_splitn_char_iterator() {
16821716
let data = "\nMäry häd ä little lämb\nLittle lämb\n";
@@ -1695,6 +1729,28 @@ mod tests {
16951729
assert_eq!(split, vec!["\nM", "ry h", "d ", " little lämb\nLittle lämb\n"]);
16961730
}
16971731

1732+
#[test]
1733+
fn test_rsplitn_char_iterator() {
1734+
let data = "\nMäry häd ä little lämb\nLittle lämb\n";
1735+
1736+
let mut split: Vec<&str> = data.rsplitn(3, ' ').collect();
1737+
split.reverse();
1738+
assert_eq!(split, vec!["\nMäry häd ä", "little", "lämb\nLittle", "lämb\n"]);
1739+
1740+
let mut split: Vec<&str> = data.rsplitn(3, |c: char| c == ' ').collect();
1741+
split.reverse();
1742+
assert_eq!(split, vec!["\nMäry häd ä", "little", "lämb\nLittle", "lämb\n"]);
1743+
1744+
// Unicode
1745+
let mut split: Vec<&str> = data.rsplitn(3, 'ä').collect();
1746+
split.reverse();
1747+
assert_eq!(split, vec!["\nMäry häd ", " little l", "mb\nLittle l", "mb\n"]);
1748+
1749+
let mut split: Vec<&str> = data.rsplitn(3, |c: char| c == 'ä').collect();
1750+
split.reverse();
1751+
assert_eq!(split, vec!["\nMäry häd ", " little l", "mb\nLittle l", "mb\n"]);
1752+
}
1753+
16981754
#[test]
16991755
fn test_split_char_iterator_no_trailing() {
17001756
let data = "\nMäry häd ä little lämb\nLittle lämb\n";
@@ -1706,6 +1762,19 @@ mod tests {
17061762
assert_eq!(split, vec!["", "Märy häd ä little lämb", "Little lämb"]);
17071763
}
17081764

1765+
#[test]
1766+
fn test_rev_split_char_iterator_no_trailing() {
1767+
let data = "\nMäry häd ä little lämb\nLittle lämb\n";
1768+
1769+
let mut split: Vec<&str> = data.split('\n').rev().collect();
1770+
split.reverse();
1771+
assert_eq!(split, vec!["", "Märy häd ä little lämb", "Little lämb", ""]);
1772+
1773+
let mut split: Vec<&str> = data.split_terminator('\n').rev().collect();
1774+
split.reverse();
1775+
assert_eq!(split, vec!["", "Märy häd ä little lämb", "Little lämb"]);
1776+
}
1777+
17091778
#[test]
17101779
fn test_words() {
17111780
let data = "\n \tMäry häd\tä little lämb\nLittle lämb\n";

branches/auto/src/libcollections/string.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -744,11 +744,6 @@ impl ops::Slice<uint, str> for String {
744744
}
745745
}
746746

747-
#[experimental = "waiting on Deref stabilization"]
748-
impl ops::Deref<str> for String {
749-
fn deref<'a>(&'a self) -> &'a str { self.as_slice() }
750-
}
751-
752747
/// Wrapper type providing a `&String` reference via `Deref`.
753748
#[experimental]
754749
pub struct DerefString<'a> {

0 commit comments

Comments
 (0)