Skip to content

Commit cff514a

Browse files
committed
---
yaml --- r: 159639 b: refs/heads/auto c: 3391ddd h: refs/heads/master i: 159637: 8d78e31 159635: b6fb79a 159631: 47c9d88 v: v3
1 parent 26e37a2 commit cff514a

Some content is hidden

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

76 files changed

+977
-971
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: 4c30cb25642d2cd4b228554e768068ba07504797
13+
refs/heads/auto: 3391ddda114f4b01440b028aa677af152a8675c8
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/compiletest/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
use std::from_str::FromStr;
1112
use std::fmt;
12-
use std::str::FromStr;
1313
use regex::Regex;
1414

1515
#[deriving(Clone, PartialEq)]

branches/auto/src/compiletest/compiletest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern crate regex;
2222
use std::os;
2323
use std::io;
2424
use std::io::fs;
25-
use std::str::FromStr;
25+
use std::from_str::FromStr;
2626
use getopts::{optopt, optflag, reqopt};
2727
use common::Config;
2828
use common::{Pretty, DebugInfoGdb, DebugInfoLldb, Codegen};

branches/auto/src/compiletest/header.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ use common::Config;
1212
use common;
1313
use util;
1414

15+
use std::from_str::FromStr;
16+
1517
pub struct TestProps {
1618
// Lines that should be expected, in order, on standard out
1719
pub error_patterns: Vec<String> ,
@@ -351,8 +353,8 @@ pub fn gdb_version_to_int(version_string: &str) -> int {
351353
panic!("{}", error_string);
352354
}
353355

354-
let major: int = from_str(components[0]).expect(error_string);
355-
let minor: int = from_str(components[1]).expect(error_string);
356+
let major: int = FromStr::from_str(components[0]).expect(error_string);
357+
let minor: int = FromStr::from_str(components[1]).expect(error_string);
356358

357359
return major * 1000 + minor;
358360
}
@@ -362,6 +364,6 @@ pub fn lldb_version_to_int(version_string: &str) -> int {
362364
"Encountered LLDB version string with unexpected format: {}",
363365
version_string);
364366
let error_string = error_string.as_slice();
365-
let major: int = from_str(version_string).expect(error_string);
367+
let major: int = FromStr::from_str(version_string).expect(error_string);
366368
return major;
367369
}

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ pass-by-reference. Basically, languages can make two choices (this is made
133133
up syntax, it's not Rust):
134134

135135
```{notrust,ignore}
136-
func foo(x) {
136+
fn foo(x) {
137137
x = 5
138138
}
139139
140-
func main() {
140+
fn main() {
141141
i = 1
142142
foo(i)
143143
// what is the value of i here?
@@ -153,11 +153,11 @@ So what do pointers have to do with this? Well, since pointers point to a
153153
location in memory...
154154

155155
```{notrust,ignore}
156-
func foo(&int x) {
156+
fn foo(&int x) {
157157
*x = 5
158158
}
159159
160-
func main() {
160+
fn main() {
161161
i = 1
162162
foo(&i)
163163
// what is the value of i here?
@@ -192,13 +192,13 @@ When you combine pointers and functions, it's easy to accidentally invalidate
192192
the memory the pointer is pointing to. For example:
193193

194194
```{notrust,ignore}
195-
func make_pointer(): &int {
195+
fn make_pointer(): &int {
196196
x = 5;
197197
198198
return &x;
199199
}
200200
201-
func main() {
201+
fn main() {
202202
&int i = make_pointer();
203203
*i = 5; // uh oh!
204204
}
@@ -214,11 +214,11 @@ issue. Two pointers are said to alias when they point at the same location
214214
in memory. Like this:
215215

216216
```{notrust,ignore}
217-
func mutate(&int i, int j) {
217+
fn mutate(&int i, int j) {
218218
*i = j;
219219
}
220220
221-
func main() {
221+
fn main() {
222222
x = 5;
223223
y = &x;
224224
z = &x; //y and z are aliased

branches/auto/src/doc/reference.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2653,10 +2653,9 @@ An expression may have two roles: it always produces a *value*, and it may have
26532653
value, and has effects during *evaluation*. Many expressions contain
26542654
sub-expressions (operands). The meaning of each kind of expression dictates
26552655
several things:
2656-
2657-
* Whether or not to evaluate the sub-expressions when evaluating the expression
2658-
* The order in which to evaluate the sub-expressions
2659-
* How to combine the sub-expressions' values to obtain the value of the expression
2656+
* Whether or not to evaluate the sub-expressions when evaluating the
2657+
* expression The order in which to evaluate the sub-expressions How to
2658+
* combine the sub-expressions' values to obtain the value of the expression.
26602659

26612660
In this way, the structure of expressions dictates the structure of execution.
26622661
Blocks are just another kind of expression, so blocks, statements, expressions,
@@ -3108,10 +3107,11 @@ then the expression completes.
31083107
Some examples of call expressions:
31093108

31103109
```
3110+
# use std::from_str::FromStr;
31113111
# fn add(x: int, y: int) -> int { 0 }
31123112
31133113
let x: int = add(1, 2);
3114-
let pi: Option<f32> = from_str("3.14");
3114+
let pi: Option<f32> = FromStr::from_str("3.14");
31153115
```
31163116

31173117
### Lambda expressions

branches/auto/src/etc/snapshot.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,7 @@ def full_snapshot_name(date, rev, platform, hsh):
7575

7676

7777
def get_kernel(triple):
78-
t = triple.split('-')
79-
if len(t) == 2:
80-
os_name = t[1]
81-
else:
82-
os_name = t[2]
78+
os_name = triple.split('-')[2]
8379
if os_name == "windows":
8480
return "winnt"
8581
if os_name == "darwin":

branches/auto/src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ syn keyword rustTrait RawPtr
105105
syn keyword rustTrait Buffer Writer Reader Seek
106106
syn keyword rustTrait Str StrVector StrSlice
107107
syn keyword rustTrait IntoMaybeOwned StrAllocating UnicodeStrSlice
108-
syn keyword rustTrait ToString IntoString
108+
syn keyword rustTrait ToString IntoStr
109109
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
110110
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
111111
syn keyword rustTrait Tuple9 Tuple10 Tuple11 Tuple12

branches/auto/src/liballoc/rc.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ pub struct Rc<T> {
179179
_noshare: marker::NoSync
180180
}
181181

182+
#[stable]
182183
impl<T> Rc<T> {
183184
/// Constructs a new reference-counted pointer.
184-
#[stable]
185185
pub fn new(value: T) -> Rc<T> {
186186
unsafe {
187187
Rc {
@@ -200,7 +200,9 @@ impl<T> Rc<T> {
200200
}
201201
}
202202
}
203+
}
203204

205+
impl<T> Rc<T> {
204206
/// Downgrades the reference-counted pointer to a weak reference.
205207
#[experimental = "Weak pointers may not belong in this module"]
206208
pub fn downgrade(&self) -> Weak<T> {

branches/auto/src/libcollections/str.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ pub use core::str::{CharSplitsN, AnyLines, MatchIndices, StrSplits};
7373
pub use core::str::{Utf16CodeUnits, eq_slice, is_utf8, is_utf16, Utf16Items};
7474
pub use core::str::{Utf16Item, ScalarValue, LoneSurrogate, utf16_items};
7575
pub use core::str::{truncate_utf16_at_nul, utf8_char_width, CharRange};
76-
pub use core::str::{FromStr, from_str};
7776
pub use core::str::{Str, StrPrelude};
7877
pub use unicode::str::{UnicodeStrPrelude, Words, Graphemes, GraphemeIndices};
7978

branches/auto/src/libcollections/string.rs

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use core::raw::Slice as RawSlice;
2525
use hash;
2626
use slice::CloneSliceAllocPrelude;
2727
use str;
28-
use str::{CharRange, FromStr, StrAllocating, MaybeOwned, Owned};
28+
use str::{CharRange, StrAllocating, MaybeOwned, Owned};
2929
use str::Slice as MaybeOwnedSlice; // So many `Slice`s...
3030
use vec::{DerefVec, Vec, as_vec};
3131

@@ -795,33 +795,6 @@ pub fn as_string<'a>(x: &'a str) -> DerefString<'a> {
795795
DerefString { x: as_vec(x.as_bytes()) }
796796
}
797797

798-
impl FromStr for String {
799-
#[inline]
800-
fn from_str(s: &str) -> Option<String> {
801-
Some(String::from_str(s))
802-
}
803-
}
804-
805-
/// Trait for converting a type to a string, consuming it in the process.
806-
pub trait IntoString {
807-
/// Consume and convert to a string.
808-
fn into_string(self) -> String;
809-
}
810-
811-
/// A generic trait for converting a value to a string
812-
pub trait ToString {
813-
/// Converts the value of `self` to an owned string
814-
fn to_string(&self) -> String;
815-
}
816-
817-
impl<T: fmt::Show> ToString for T {
818-
fn to_string(&self) -> String {
819-
let mut buf = Vec::<u8>::new();
820-
let _ = format_args!(|args| fmt::write(&mut buf, args), "{}", self);
821-
String::from_utf8(buf).unwrap()
822-
}
823-
}
824-
825798
/// Unsafe operations
826799
#[unstable = "waiting on raw module conventions"]
827800
pub mod raw {
@@ -887,7 +860,7 @@ mod tests {
887860

888861
use str;
889862
use str::{Str, StrPrelude, Owned};
890-
use super::{as_string, String, ToString};
863+
use super::{as_string, String};
891864
use vec::Vec;
892865
use slice::CloneSliceAllocPrelude;
893866

@@ -1191,28 +1164,6 @@ mod tests {
11911164
assert_eq!("oob", s[1..4]);
11921165
}
11931166

1194-
#[test]
1195-
fn test_simple_types() {
1196-
assert_eq!(1i.to_string(), "1".to_string());
1197-
assert_eq!((-1i).to_string(), "-1".to_string());
1198-
assert_eq!(200u.to_string(), "200".to_string());
1199-
assert_eq!(2u8.to_string(), "2".to_string());
1200-
assert_eq!(true.to_string(), "true".to_string());
1201-
assert_eq!(false.to_string(), "false".to_string());
1202-
assert_eq!(().to_string(), "()".to_string());
1203-
assert_eq!(("hi".to_string()).to_string(), "hi".to_string());
1204-
}
1205-
1206-
#[test]
1207-
fn test_vectors() {
1208-
let x: Vec<int> = vec![];
1209-
assert_eq!(x.to_string(), "[]".to_string());
1210-
assert_eq!((vec![1i]).to_string(), "[1]".to_string());
1211-
assert_eq!((vec![1i, 2, 3]).to_string(), "[1, 2, 3]".to_string());
1212-
assert!((vec![vec![], vec![1i], vec![1i, 1]]).to_string() ==
1213-
"[[], [1], [1, 1]]".to_string());
1214-
}
1215-
12161167
#[bench]
12171168
fn bench_with_capacity(b: &mut Bencher) {
12181169
b.iter(|| {

branches/auto/src/libcollections/tree/set.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,9 @@ impl<T: Ord> TreeSet<T> {
504504
/// # Example
505505
///
506506
/// ```
507-
/// use std::collections::TreeSet;
507+
/// use std::collections::BTreeSet;
508508
///
509-
/// let mut set = TreeSet::new();
509+
/// let mut set = BTreeSet::new();
510510
///
511511
/// assert_eq!(set.insert(2i), true);
512512
/// assert_eq!(set.insert(2i), false);
@@ -522,9 +522,9 @@ impl<T: Ord> TreeSet<T> {
522522
/// # Example
523523
///
524524
/// ```
525-
/// use std::collections::TreeSet;
525+
/// use std::collections::BTreeSet;
526526
///
527-
/// let mut set = TreeSet::new();
527+
/// let mut set = BTreeSet::new();
528528
///
529529
/// set.insert(2i);
530530
/// assert_eq!(set.remove(&2), true);

branches/auto/src/libcollections/vec.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,7 @@ impl<T> Vec<T> {
645645
/// assert!(vec.capacity() >= 3);
646646
/// ```
647647
#[stable]
648+
#[unstable = "matches collection reform specification, waiting for dust to settle"]
648649
pub fn shrink_to_fit(&mut self) {
649650
if mem::size_of::<T>() == 0 { return }
650651

@@ -1652,13 +1653,6 @@ impl<T> Vec<T> {
16521653
}
16531654
}
16541655

1655-
impl<'a> fmt::FormatWriter for Vec<u8> {
1656-
fn write(&mut self, buf: &[u8]) -> fmt::Result {
1657-
self.push_all(buf);
1658-
Ok(())
1659-
}
1660-
}
1661-
16621656
#[cfg(test)]
16631657
mod tests {
16641658
extern crate test;

branches/auto/src/libcore/any.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ use intrinsics::TypeId;
8888
#[stable]
8989
pub trait Any: 'static {
9090
/// Get the `TypeId` of `self`
91-
#[stable]
9291
fn get_type_id(&self) -> TypeId;
9392
}
9493

@@ -118,6 +117,7 @@ pub trait AnyRefExt<'a> {
118117
#[stable]
119118
impl<'a> AnyRefExt<'a> for &'a Any {
120119
#[inline]
120+
#[stable]
121121
fn is<T: 'static>(self) -> bool {
122122
// Get TypeId of the type this function is instantiated with
123123
let t = TypeId::of::<T>();
@@ -130,6 +130,7 @@ impl<'a> AnyRefExt<'a> for &'a Any {
130130
}
131131

132132
#[inline]
133+
#[unstable = "naming conventions around acquiring references may change"]
133134
fn downcast_ref<T: 'static>(self) -> Option<&'a T> {
134135
if self.is::<T>() {
135136
unsafe {
@@ -158,6 +159,7 @@ pub trait AnyMutRefExt<'a> {
158159
#[stable]
159160
impl<'a> AnyMutRefExt<'a> for &'a mut Any {
160161
#[inline]
162+
#[unstable = "naming conventions around acquiring references may change"]
161163
fn downcast_mut<T: 'static>(self) -> Option<&'a mut T> {
162164
if self.is::<T>() {
163165
unsafe {

0 commit comments

Comments
 (0)