Skip to content

Commit 4a7d704

Browse files
committed
---
yaml --- r: 152996 b: refs/heads/try2 c: 7e9bb8b h: refs/heads/master v: v3
1 parent 267343f commit 4a7d704

File tree

28 files changed

+29
-44
lines changed

28 files changed

+29
-44
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 3deb2c1aa6bb255ebe62b294be5e3c580e19bb9b
8+
refs/heads/try2: 7e9bb8be7732e71ba3842291a5ce2a73b1eb36df
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libcollections/str.rs

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ Section: Creating a string
9797
///
9898
/// Returns `Err` with the original vector if the vector contains invalid
9999
/// UTF-8.
100+
///
101+
/// # Example
102+
///
103+
/// ```rust
104+
/// use std::str;
105+
/// let hello_vec = vec![104, 101, 108, 108, 111];
106+
/// let string = str::from_utf8_owned(hello_vec);
107+
/// assert_eq!(string, Ok("hello".to_string()));
108+
/// ```
100109
pub fn from_utf8_owned(vv: Vec<u8>) -> Result<String, Vec<u8>> {
101110
String::from_utf8(vv)
102111
}
@@ -111,22 +120,39 @@ pub fn from_utf8_owned(vv: Vec<u8>) -> Result<String, Vec<u8>> {
111120
///
112121
/// ```rust
113122
/// use std::str;
114-
/// let string = str::from_byte(66u8);
115-
/// assert_eq!(string.as_slice(), "B");
123+
/// let string = str::from_byte(104);
124+
/// assert_eq!(string.as_slice(), "h");
116125
/// ```
117126
pub fn from_byte(b: u8) -> String {
118127
assert!(b < 128u8);
119128
String::from_char(1, b as char)
120129
}
121130

122131
/// Convert a char to a string
132+
///
133+
/// # Example
134+
///
135+
/// ```rust
136+
/// use std::str;
137+
/// let string = str::from_char('b');
138+
/// assert_eq!(string.as_slice(), "b");
139+
/// ```
123140
pub fn from_char(ch: char) -> String {
124141
let mut buf = String::new();
125142
buf.push_char(ch);
126143
buf
127144
}
128145

129146
/// Convert a vector of chars to a string
147+
///
148+
/// # Example
149+
///
150+
/// ```rust
151+
/// use std::str;
152+
/// let chars = ['h', 'e', 'l', 'l', 'o'];
153+
/// let string = str::from_chars(chars);
154+
/// assert_eq!(string.as_slice(), "hello");
155+
/// ```
130156
pub fn from_chars(chs: &[char]) -> String {
131157
chs.iter().map(|c| *c).collect()
132158
}

branches/try2/src/libstd/ascii.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
//! Operations on ASCII strings and characters
1212
13-
#![experimental]
14-
1513
use collections::Collection;
1614
use fmt;
1715
use iter::Iterator;

branches/try2/src/libstd/bitflags.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@
105105
//! - `insert`: inserts the specified flags in-place
106106
//! - `remove`: removes the specified flags in-place
107107
108-
#![experimental]
109108
#![macro_escape]
110109

111110
#[macro_export]

branches/try2/src/libstd/c_vec.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
//! handled correctly, i.e. that allocated memory is eventually freed
3434
//! if necessary.
3535
36-
#![experimental]
37-
3836
use collections::Collection;
3937
use kinds::Send;
4038
use mem;

branches/try2/src/libstd/collections/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
* Collection types.
1313
*/
1414

15-
#![experimental]
16-
1715
pub use core_collections::{Collection, Mutable, Map, MutableMap};
1816
pub use core_collections::{Set, MutableSet, Deque};
1917
pub use core_collections::{Bitv, BitvSet, BTree, DList, EnumSet};

branches/try2/src/libstd/failure.rs

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

11-
#![experimental]
12-
1311
use alloc::owned::Box;
1412
use any::{Any, AnyRefExt};
1513
use fmt;

branches/try2/src/libstd/fmt.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,6 @@ the `}` character is escaped with `}}`.
412412
413413
*/
414414

415-
#![experimental]
416-
417415
use io::Writer;
418416
use io;
419417
use result::{Ok, Err};

branches/try2/src/libstd/from_str.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
//! The `FromStr` trait for types that can be created from strings
1212
13-
#![experimental]
14-
1513
use option::{Option, Some, None};
1614
use string::String;
1715
use str::StrAllocating;

branches/try2/src/libstd/gc.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ collector is task-local so `Gc<T>` is not sendable.
1616
1717
*/
1818

19-
#![experimental]
2019
#![allow(experimental)]
2120

2221
use clone::Clone;

branches/try2/src/libstd/io/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ responding to errors that may occur while attempting to read the numbers.
216216
217217
*/
218218

219-
#![experimental]
220219
#![deny(unused_must_use)]
221220

222221
use char::Char;

branches/try2/src/libstd/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@
9595
//! and `format!`, also available to all Rust code.
9696
9797
#![crate_id = "std#0.11.0-pre"]
98-
#![unstable]
9998
#![comment = "The Rust standard library"]
10099
#![license = "MIT/ASL2"]
101100
#![crate_type = "rlib"]

branches/try2/src/libstd/macros.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
//! library. Each macro is available for use when linking against the standard
1515
//! library.
1616
17-
#![experimental]
1817
#![macro_escape]
1918

2019
/// The entry point for failure of rust tasks.

branches/try2/src/libstd/num/f32.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
//! Operations and constants for 32-bits floats (`f32` type)
1212
13-
#![experimental]
1413
#![allow(missing_doc)]
1514
#![allow(unsigned_negate)]
1615
#![doc(primitive = "f32")]

branches/try2/src/libstd/num/f64.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
//! Operations and constants for 64-bits floats (`f64` type)
1212
13-
#![experimental]
1413
#![allow(missing_doc)]
1514
#![doc(primitive = "f64")]
1615

branches/try2/src/libstd/num/float_macros.rs

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

11-
#![experimental]
1211
#![macro_escape]
1312
#![doc(hidden)]
1413

branches/try2/src/libstd/num/int_macros.rs

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

11-
#![experimental]
1211
#![macro_escape]
1312
#![doc(hidden)]
1413

branches/try2/src/libstd/num/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
//! These are implemented for the primitive numeric types in `std::{u8, u16,
1414
//! u32, u64, uint, i8, i16, i32, i64, int, f32, f64}`.
1515
16-
#![experimental]
1716
#![allow(missing_doc)]
1817

1918
use option::Option;

branches/try2/src/libstd/num/uint_macros.rs

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

11-
#![experimental]
1211
#![macro_escape]
1312
#![doc(hidden)]
1413
#![allow(unsigned_negate)]

branches/try2/src/libstd/os.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
* to write OS-ignorant code by default.
2727
*/
2828

29-
#![experimental]
30-
3129
#![allow(missing_doc)]
3230
#![allow(non_snake_case_functions)]
3331

branches/try2/src/libstd/path/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ println!("path exists: {}", path.exists());
6363
6464
*/
6565

66-
#![experimental]
67-
6866
use collections::Collection;
6967
use c_str::CString;
7068
use clone::Clone;

branches/try2/src/libstd/prelude.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
//! particularly useful standalone functions, like `from_str`, `range`, and
3838
//! `drop`, `spawn`, and `channel`.
3939
40-
#![experimental]
41-
4240
// Reexported core operators
4341
#[doc(no_inline)] pub use kinds::{Copy, Send, Sized, Share};
4442
#[doc(no_inline)] pub use ops::{Add, Sub, Mul, Div, Rem, Neg, Not};

branches/try2/src/libstd/rand/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ println!("{}", tuple)
7373
```
7474
*/
7575

76-
#![experimental]
77-
7876
use cell::RefCell;
7977
use clone::Clone;
8078
use io::IoResult;

branches/try2/src/libstd/rt/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ Several modules in `core` are clients of `rt`:
5151
5252
*/
5353

54-
#![experimental]
55-
5654
// FIXME: this should not be here.
5755
#![allow(missing_doc)]
5856

branches/try2/src/libstd/rtdeps.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
//! the standard library This varies per-platform, but these libraries are
1313
//! necessary for running libstd.
1414
15-
#![experimental]
16-
1715
// All platforms need to link to rustrt
1816
#[link(name = "rust_builtin", kind = "static")]
1917
extern {}

branches/try2/src/libstd/sync/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
//! and/or blocking at all, but rather provide the necessary tools to build
1616
//! other types of concurrent primitives.
1717
18-
#![experimental]
19-
2018
pub use core_sync::{atomics, deque, mpmc_bounded_queue, mpsc_queue, spsc_queue};
2119
pub use core_sync::{Arc, Weak, Mutex, MutexGuard, Condvar, Barrier};
2220
pub use core_sync::{RWLock, RWLockReadGuard, RWLockWriteGuard};

branches/try2/src/libstd/task.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@
9191
//! # }
9292
//! ```
9393
94-
#![experimental]
95-
9694
use any::Any;
9795
use comm::channel;
9896
use io::{Writer, stdio};

branches/try2/src/libstd/to_str.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ The `ToStr` trait for converting to strings
1414
1515
*/
1616

17-
#![experimental]
18-
1917
use fmt;
2018
use string::String;
2119

0 commit comments

Comments
 (0)