Skip to content

Commit ce6a803

Browse files
committed
---
yaml --- r: 228295 b: refs/heads/try c: 92c8a94 h: refs/heads/master i: 228293: 3c03673 228291: 7ca4f47 228287: ec6b52d v: v3
1 parent dfd6b21 commit ce6a803

File tree

24 files changed

+128
-289
lines changed

24 files changed

+128
-289
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: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: aff208033b5cf0ce8d4e7710ba868d2221c30839
4+
refs/heads/try: 92c8a9439b82f56aabb2f42e485e8683e663aaff
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/mk/cfg/i686-unknown-freebsd.mk

Lines changed: 0 additions & 22 deletions
This file was deleted.

branches/try/src/libcollections/str.rs

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ use core::result::Result;
6161
use core::str as core_str;
6262
use core::str::pattern::Pattern;
6363
use core::str::pattern::{Searcher, ReverseSearcher, DoubleEndedSearcher};
64-
use core::mem;
6564
use rustc_unicode::str::{UnicodeStr, Utf16Encoder};
6665

6766
use vec_deque::VecDeque;
@@ -70,7 +69,6 @@ use string::String;
7069
use rustc_unicode;
7170
use vec::Vec;
7271
use slice::SliceConcatExt;
73-
use boxed::Box;
7472

7573
pub use core::str::{FromStr, Utf8Error};
7674
pub use core::str::{Lines, LinesAny, CharRange};
@@ -84,6 +82,10 @@ pub use core::str::{from_utf8_unchecked, ParseBoolError};
8482
pub use rustc_unicode::str::{SplitWhitespace, Words, Graphemes, GraphemeIndices};
8583
pub use core::str::pattern;
8684

85+
/*
86+
Section: Creating a string
87+
*/
88+
8789
impl<S: Borrow<str>> SliceConcatExt<str> for [S] {
8890
type Output = String;
8991

@@ -132,6 +134,10 @@ impl<S: Borrow<str>> SliceConcatExt<str> for [S] {
132134
}
133135
}
134136

137+
/*
138+
Section: Iterators
139+
*/
140+
135141
// Helper functions used for Unicode normalization
136142
fn canonical_sort(comb: &mut [(char, u8)]) {
137143
let len = comb.len();
@@ -376,6 +382,10 @@ impl<'a> Iterator for Utf16Units<'a> {
376382
fn size_hint(&self) -> (usize, Option<usize>) { self.encoder.size_hint() }
377383
}
378384

385+
/*
386+
Section: Misc
387+
*/
388+
379389
// Return the initial codepoint accumulator for the first byte.
380390
// The first byte is special, only want bottom 5 bits for width 2, 4 bits
381391
// for width 3, and 3 bits for width 4
@@ -404,6 +414,15 @@ impl ToOwned for str {
404414
}
405415
}
406416

417+
/*
418+
Section: CowString
419+
*/
420+
421+
/*
422+
Section: Trait implementations
423+
*/
424+
425+
407426
/// Any string that can be represented as a slice.
408427
#[lang = "str"]
409428
#[cfg(not(test))]
@@ -1905,14 +1924,4 @@ impl str {
19051924
pub fn escape_unicode(&self) -> String {
19061925
self.chars().flat_map(|c| c.escape_unicode()).collect()
19071926
}
1908-
1909-
/// Converts the `Box<str>` into a `String` without copying or allocating.
1910-
#[unstable(feature = "box_str",
1911-
reason = "recently added, matches RFC")]
1912-
pub fn into_string(self: Box<str>) -> String {
1913-
unsafe {
1914-
let slice = mem::transmute::<Box<str>, Box<[u8]>>(self);
1915-
String::from_utf8_unchecked(slice.into_vec())
1916-
}
1917-
}
19181927
}

branches/try/src/libcollections/string.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ use borrow::{Cow, IntoCow};
2929
use range::RangeArgument;
3030
use str::{self, FromStr, Utf8Error, Chars};
3131
use vec::{DerefVec, Vec, as_vec};
32-
use boxed::Box;
3332

3433
/// A growable string stored as a UTF-8 encoded buffer.
3534
#[derive(Clone, PartialOrd, Eq, Ord)]
@@ -742,16 +741,6 @@ impl String {
742741
string: self_ptr,
743742
}
744743
}
745-
746-
/// Converts the string into `Box<str>`.
747-
///
748-
/// Note that this will drop any excess capacity.
749-
#[unstable(feature = "box_str",
750-
reason = "recently added, matches RFC")]
751-
pub fn into_boxed_slice(self) -> Box<str> {
752-
let slice = self.vec.into_boxed_slice();
753-
unsafe { mem::transmute::<Box<[u8]>, Box<str>>(slice) }
754-
}
755744
}
756745

757746
impl FromUtf8Error {

branches/try/src/libcollections/vec_deque.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl<T> VecDeque<T> {
108108
ptr::write(self.ptr.offset(off as isize), t);
109109
}
110110

111-
/// Returns true if and only if the buffer is at capacity
111+
/// Returns true iff the buffer is at capacity
112112
#[inline]
113113
fn is_full(&self) -> bool { self.cap - self.len() == 1 }
114114

branches/try/src/libcollectionstest/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#![feature(str_escape)]
4545
#![feature(str_match_indices)]
4646
#![feature(str_utf16)]
47-
#![feature(box_str)]
4847
#![feature(subslice_offset)]
4948
#![feature(test)]
5049
#![feature(unboxed_closures)]

branches/try/src/libcollectionstest/str.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,14 +1746,6 @@ fn to_uppercase() {
17461746
assert_eq!("aéDžßfiᾀ".to_uppercase(), "AÉDŽSSFIἈΙ");
17471747
}
17481748

1749-
#[test]
1750-
fn test_into_string() {
1751-
// The only way to acquire a Box<str> in the first place is through a String, so just
1752-
// test that we can round-trip between Box<str> and String.
1753-
let string = String::from("Some text goes here");
1754-
assert_eq!(string.clone().into_boxed_slice().into_string(), string);
1755-
}
1756-
17571749
mod pattern {
17581750
use std::str::pattern::Pattern;
17591751
use std::str::pattern::{Searcher, ReverseSearcher};

branches/try/src/libcollectionstest/string.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -374,13 +374,6 @@ fn test_extend_ref() {
374374
assert_eq!(&a, "foobar");
375375
}
376376

377-
#[test]
378-
fn test_into_boxed_slice() {
379-
let xs = String::from("hello my name is bob");
380-
let ys = xs.into_boxed_slice();
381-
assert_eq!(&*ys, "hello my name is bob");
382-
}
383-
384377
#[bench]
385378
fn bench_with_capacity(b: &mut Bencher) {
386379
b.iter(|| {

branches/try/src/libcore/fmt/builders.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,6 @@ impl<'a, 'b: 'a> DebugTuple<'a, 'b> {
175175
fn is_pretty(&self) -> bool {
176176
self.fmt.flags() & (1 << (FlagV1::Alternate as usize)) != 0
177177
}
178-
179-
/// Returns the wrapped `Formatter`.
180-
#[unstable(feature = "debug_builder_formatter", reason = "recently added")]
181-
pub fn formatter(&mut self) -> &mut fmt::Formatter<'b> {
182-
&mut self.fmt
183-
}
184178
}
185179

186180
struct DebugInner<'a, 'b: 'a> {

branches/try/src/libcore/fmt/mod.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,19 +1488,20 @@ macro_rules! tuple {
14881488
impl<$($name:Debug),*> Debug for ($($name,)*) {
14891489
#[allow(non_snake_case, unused_assignments)]
14901490
fn fmt(&self, f: &mut Formatter) -> Result {
1491-
let mut builder = f.debug_tuple("");
1491+
try!(write!(f, "("));
14921492
let ($(ref $name,)*) = *self;
14931493
let mut n = 0;
14941494
$(
1495-
builder.field($name);
1495+
if n > 0 {
1496+
try!(write!(f, ", "));
1497+
}
1498+
try!(write!(f, "{:?}", *$name));
14961499
n += 1;
14971500
)*
1498-
14991501
if n == 1 {
1500-
try!(write!(builder.formatter(), ","));
1502+
try!(write!(f, ","));
15011503
}
1502-
1503-
builder.finish()
1504+
write!(f, ")")
15041505
}
15051506
}
15061507
peel! { $($name,)* }

branches/try/src/libcore/num/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ macro_rules! uint_impl {
11261126
acc
11271127
}
11281128

1129-
/// Returns `true` if and only if `self == 2^k` for some `k`.
1129+
/// Returns `true` iff `self == 2^k` for some `k`.
11301130
#[stable(feature = "rust1", since = "1.0.0")]
11311131
#[inline]
11321132
pub fn is_power_of_two(self) -> bool {

branches/try/src/libcore/option.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
//! // The division was valid
4747
//! Some(x) => println!("Result: {}", x),
4848
//! // The division was invalid
49-
//! None => println!("Cannot divide by 0"),
49+
//! None => println!("Cannot divide by 0")
5050
//! }
5151
//! ```
5252
//!
@@ -75,7 +75,7 @@
7575
//! fn check_optional(optional: &Option<Box<i32>>) {
7676
//! match *optional {
7777
//! Some(ref p) => println!("have value {}", p),
78-
//! None => println!("have no value"),
78+
//! None => println!("have no value")
7979
//! }
8080
//! }
8181
//! ```
@@ -95,13 +95,13 @@
9595
//! // Take a reference to the contained string
9696
//! match msg {
9797
//! Some(ref m) => println!("{}", *m),
98-
//! None => (),
98+
//! None => ()
9999
//! }
100100
//!
101101
//! // Remove the contained string, destroying the Option
102102
//! let unwrapped_msg = match msg {
103103
//! Some(m) => m,
104-
//! None => "default message",
104+
//! None => "default message"
105105
//! };
106106
//! ```
107107
//!
@@ -137,7 +137,7 @@
137137
//!
138138
//! match name_of_biggest_animal {
139139
//! Some(name) => println!("the biggest animal is {}", name),
140-
//! None => println!("there are no animals :("),
140+
//! None => println!("there are no animals :(")
141141
//! }
142142
//! ```
143143
@@ -198,7 +198,7 @@ impl<T> Option<T> {
198198
pub fn is_some(&self) -> bool {
199199
match *self {
200200
Some(_) => true,
201-
None => false,
201+
None => false
202202
}
203203
}
204204

@@ -244,7 +244,7 @@ impl<T> Option<T> {
244244
pub fn as_ref<'r>(&'r self) -> Option<&'r T> {
245245
match *self {
246246
Some(ref x) => Some(x),
247-
None => None,
247+
None => None
248248
}
249249
}
250250

@@ -265,7 +265,7 @@ impl<T> Option<T> {
265265
pub fn as_mut<'r>(&'r mut self) -> Option<&'r mut T> {
266266
match *self {
267267
Some(ref mut x) => Some(x),
268-
None => None,
268+
None => None
269269
}
270270
}
271271

@@ -376,7 +376,7 @@ impl<T> Option<T> {
376376
pub fn unwrap_or(self, def: T) -> T {
377377
match self {
378378
Some(x) => x,
379-
None => def,
379+
None => def
380380
}
381381
}
382382

@@ -394,7 +394,7 @@ impl<T> Option<T> {
394394
pub fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
395395
match self {
396396
Some(x) => x,
397-
None => f(),
397+
None => f()
398398
}
399399
}
400400

@@ -420,7 +420,7 @@ impl<T> Option<T> {
420420
pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Option<U> {
421421
match self {
422422
Some(x) => Some(f(x)),
423-
None => None,
423+
None => None
424424
}
425425
}
426426

@@ -464,7 +464,7 @@ impl<T> Option<T> {
464464
pub fn map_or_else<U, D: FnOnce() -> U, F: FnOnce(T) -> U>(self, default: D, f: F) -> U {
465465
match self {
466466
Some(t) => f(t),
467-
None => default(),
467+
None => default()
468468
}
469469
}
470470

@@ -637,7 +637,7 @@ impl<T> Option<T> {
637637
pub fn or(self, optb: Option<T>) -> Option<T> {
638638
match self {
639639
Some(_) => self,
640-
None => optb,
640+
None => optb
641641
}
642642
}
643643

@@ -659,7 +659,7 @@ impl<T> Option<T> {
659659
pub fn or_else<F: FnOnce() -> Option<T>>(self, f: F) -> Option<T> {
660660
match self {
661661
Some(_) => self,
662-
None => f(),
662+
None => f()
663663
}
664664
}
665665

@@ -736,7 +736,7 @@ impl<T: Default> Option<T> {
736736
pub fn unwrap_or_default(self) -> T {
737737
match self {
738738
Some(x) => x,
739-
None => Default::default(),
739+
None => Default::default()
740740
}
741741
}
742742
}

0 commit comments

Comments
 (0)