Skip to content

Commit d0de2b4

Browse files
committed
Fallout from stabilization
1 parent d8f8f7a commit d0de2b4

File tree

89 files changed

+578
-558
lines changed

Some content is hidden

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

89 files changed

+578
-558
lines changed

src/compiletest/runtest.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use std::env;
3535
use std::iter::repeat;
3636
use std::str;
3737
use std::string::String;
38-
use std::thread::Thread;
38+
use std::thread;
3939
use std::time::Duration;
4040
use test::MetricMap;
4141

@@ -447,7 +447,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
447447
loop {
448448
//waiting 1 second for gdbserver start
449449
timer::sleep(Duration::milliseconds(1000));
450-
let result = Thread::scoped(move || {
450+
let result = thread::spawn(move || {
451451
tcp::TcpStream::connect("127.0.0.1:5039").unwrap();
452452
}).join();
453453
if result.is_err() {

src/liballoc/arc.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@
3535
//!
3636
//! ```
3737
//! use std::sync::Arc;
38-
//! use std::thread::Thread;
38+
//! use std::thread;
3939
//!
4040
//! let five = Arc::new(5);
4141
//!
4242
//! for _ in 0..10 {
4343
//! let five = five.clone();
4444
//!
45-
//! Thread::spawn(move || {
45+
//! thread::spawn(move || {
4646
//! println!("{:?}", five);
4747
//! });
4848
//! }
@@ -52,14 +52,14 @@
5252
//!
5353
//! ```
5454
//! use std::sync::{Arc, Mutex};
55-
//! use std::thread::Thread;
55+
//! use std::thread;
5656
//!
5757
//! let five = Arc::new(Mutex::new(5));
5858
//!
5959
//! for _ in 0..10 {
6060
//! let five = five.clone();
6161
//!
62-
//! Thread::spawn(move || {
62+
//! thread::spawn(move || {
6363
//! let mut number = five.lock().unwrap();
6464
//!
6565
//! *number += 1;
@@ -95,7 +95,7 @@ use heap::deallocate;
9595
///
9696
/// ```rust
9797
/// use std::sync::Arc;
98-
/// use std::thread::Thread;
98+
/// use std::thread;
9999
///
100100
/// fn main() {
101101
/// let numbers: Vec<_> = (0..100u32).map(|i| i as f32).collect();
@@ -104,7 +104,7 @@ use heap::deallocate;
104104
/// for _ in 0..10 {
105105
/// let child_numbers = shared_numbers.clone();
106106
///
107-
/// Thread::spawn(move || {
107+
/// thread::spawn(move || {
108108
/// let local_numbers = child_numbers.as_slice();
109109
///
110110
/// // Work with the local numbers
@@ -621,7 +621,7 @@ mod tests {
621621
use std::option::Option::{Some, None};
622622
use std::sync::atomic;
623623
use std::sync::atomic::Ordering::{Acquire, SeqCst};
624-
use std::thread::Thread;
624+
use std::thread;
625625
use std::vec::Vec;
626626
use super::{Arc, Weak, weak_count, strong_count};
627627
use std::sync::Mutex;
@@ -648,7 +648,7 @@ mod tests {
648648

649649
let (tx, rx) = channel();
650650

651-
let _t = Thread::spawn(move || {
651+
let _t = thread::spawn(move || {
652652
let arc_v: Arc<Vec<i32>> = rx.recv().unwrap();
653653
assert_eq!((*arc_v)[3], 4);
654654
});

src/libcollections/dlist.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ mod tests {
935935
use prelude::*;
936936
use std::rand;
937937
use std::hash::{self, SipHasher};
938-
use std::thread::Thread;
938+
use std::thread;
939939
use test::Bencher;
940940
use test;
941941

@@ -1284,7 +1284,7 @@ mod tests {
12841284
#[test]
12851285
fn test_send() {
12861286
let n = list_from(&[1,2,3]);
1287-
Thread::scoped(move || {
1287+
thread::spawn(move || {
12881288
check_links(&n);
12891289
let a: &[_] = &[&1,&2,&3];
12901290
assert_eq!(a, n.iter().collect::<Vec<_>>());

src/libcore/atomic.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@
4242
//! ```
4343
//! use std::sync::Arc;
4444
//! use std::sync::atomic::{AtomicUsize, Ordering};
45-
//! use std::thread::Thread;
45+
//! use std::thread;
4646
//!
4747
//! fn main() {
4848
//! let spinlock = Arc::new(AtomicUsize::new(1));
4949
//!
5050
//! let spinlock_clone = spinlock.clone();
51-
//! Thread::spawn(move|| {
51+
//! thread::spawn(move|| {
5252
//! spinlock_clone.store(0, Ordering::SeqCst);
5353
//! });
5454
//!

src/libcore/cell.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,9 @@ impl<T> RefCell<T> {
375375
///
376376
/// ```
377377
/// use std::cell::RefCell;
378-
/// use std::thread::Thread;
378+
/// use std::thread;
379379
///
380-
/// let result = Thread::scoped(move || {
380+
/// let result = thread::spawn(move || {
381381
/// let c = RefCell::new(5);
382382
/// let m = c.borrow_mut();
383383
///
@@ -436,9 +436,9 @@ impl<T> RefCell<T> {
436436
///
437437
/// ```
438438
/// use std::cell::RefCell;
439-
/// use std::thread::Thread;
439+
/// use std::thread;
440440
///
441-
/// let result = Thread::scoped(move || {
441+
/// let result = thread::spawn(move || {
442442
/// let c = RefCell::new(5);
443443
/// let m = c.borrow_mut();
444444
///

src/libcoretest/finally.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![allow(deprecated)]
1212

1313
use core::finally::{try_finally, Finally};
14-
use std::thread::Thread;
14+
use std::thread;
1515

1616
#[test]
1717
fn test_success() {
@@ -22,7 +22,7 @@ fn test_success() {
2222
*i = 10;
2323
},
2424
|i| {
25-
assert!(!Thread::panicking());
25+
assert!(!thread::panicking());
2626
assert_eq!(*i, 10);
2727
*i = 20;
2828
});
@@ -40,7 +40,7 @@ fn test_fail() {
4040
panic!();
4141
},
4242
|i| {
43-
assert!(Thread::panicking());
43+
assert!(thread::panicking());
4444
assert_eq!(*i, 10);
4545
})
4646
}

src/librustdoc/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ fn rust_input(cratefile: &str, externs: core::Externs, matches: &getopts::Matche
365365
let cr = Path::new(cratefile);
366366
info!("starting to run rustc");
367367

368-
let (mut krate, analysis) = std::thread::Thread::scoped(move || {
368+
let (mut krate, analysis) = std::thread::spawn(move || {
369369
use rustc::session::config::Input;
370370

371371
let cr = cr;

src/librustdoc/test.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::old_io::{Command, TempDir};
1515
use std::old_io;
1616
use std::env;
1717
use std::str;
18-
use std::thread::Thread;
18+
use std::thread;
1919
use std::thunk::Thunk;
2020

2121
use std::collections::{HashSet, HashMap};
@@ -142,7 +142,7 @@ fn runtest(test: &str, cratename: &str, libs: SearchPaths,
142142
let w1 = old_io::ChanWriter::new(tx);
143143
let w2 = w1.clone();
144144
let old = old_io::stdio::set_stderr(box w1);
145-
Thread::spawn(move || {
145+
thread::spawn(move || {
146146
let mut p = old_io::ChanReader::new(rx);
147147
let mut err = match old {
148148
Some(old) => {

src/libstd/macros.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ macro_rules! try {
126126
/// # Examples
127127
///
128128
/// ```
129-
/// use std::thread::Thread;
129+
/// use std::thread;
130130
/// use std::sync::mpsc;
131131
///
132132
/// // two placeholder functions for now
@@ -136,8 +136,8 @@ macro_rules! try {
136136
/// let (tx1, rx1) = mpsc::channel();
137137
/// let (tx2, rx2) = mpsc::channel();
138138
///
139-
/// Thread::spawn(move|| { long_running_task(); tx1.send(()).unwrap(); });
140-
/// Thread::spawn(move|| { tx2.send(calculate_the_answer()).unwrap(); });
139+
/// thread::spawn(move|| { long_running_task(); tx1.send(()).unwrap(); });
140+
/// thread::spawn(move|| { tx2.send(calculate_the_answer()).unwrap(); });
141141
///
142142
/// select! (
143143
/// _ = rx1.recv() => println!("the long running task finished first"),

0 commit comments

Comments
 (0)