Fallout from stabilization

This commit is contained in:
Aaron Turon 2015-02-17 15:10:25 -08:00
parent d8f8f7a58c
commit d0de2b46e9
89 changed files with 578 additions and 558 deletions

View file

@ -10,7 +10,7 @@
#![feature(box_syntax)]
use std::thread::Thread;
use std::thread;
fn borrow<F>(v: &isize, f: F) where F: FnOnce(&isize) {
f(v);
@ -19,7 +19,7 @@ fn borrow<F>(v: &isize, f: F) where F: FnOnce(&isize) {
fn box_imm() {
let v = box 3;
let _w = &v;
Thread::spawn(move|| {
thread::spawn(move|| {
println!("v={}", *v);
//~^ ERROR cannot move `v` into closure
});
@ -28,7 +28,7 @@ fn box_imm() {
fn box_imm_explicit() {
let v = box 3;
let _w = &v;
Thread::spawn(move|| {
thread::spawn(move|| {
println!("v={}", *v);
//~^ ERROR cannot move
});

View file

@ -10,7 +10,7 @@
#![feature(box_syntax)]
use std::thread::Thread;
use std::thread;
fn borrow<T>(_: &T) { }
@ -19,7 +19,7 @@ fn different_vars_after_borrows() {
let p1 = &x1;
let x2 = box 2;
let p2 = &x2;
Thread::spawn(move|| {
thread::spawn(move|| {
drop(x1); //~ ERROR cannot move `x1` into closure because it is borrowed
drop(x2); //~ ERROR cannot move `x2` into closure because it is borrowed
});
@ -32,7 +32,7 @@ fn different_vars_after_moves() {
drop(x1);
let x2 = box 2;
drop(x2);
Thread::spawn(move|| {
thread::spawn(move|| {
drop(x1); //~ ERROR capture of moved value: `x1`
drop(x2); //~ ERROR capture of moved value: `x2`
});
@ -41,7 +41,7 @@ fn different_vars_after_moves() {
fn same_var_after_borrow() {
let x = box 1;
let p = &x;
Thread::spawn(move|| {
thread::spawn(move|| {
drop(x); //~ ERROR cannot move `x` into closure because it is borrowed
drop(x); //~ ERROR use of moved value: `x`
});
@ -51,7 +51,7 @@ fn same_var_after_borrow() {
fn same_var_after_move() {
let x = box 1;
drop(x);
Thread::spawn(move|| {
thread::spawn(move|| {
drop(x); //~ ERROR capture of moved value: `x`
drop(x); //~ ERROR use of moved value: `x`
});

View file

@ -9,11 +9,11 @@
// except according to those terms.
use std::sync::mpsc::channel;
use std::thread::Thread;
use std::thread;
fn main() {
let (tx, rx) = channel();
let _t = Thread::spawn(move|| -> () {
let _t = thread::spawn(move|| -> () {
loop {
let tx = tx;
//~^ ERROR: use of moved value: `tx`

View file

@ -9,47 +9,47 @@
// except according to those terms.
use std::{int, i8, i16, i32, i64};
use std::thread::Thread;
use std::thread;
fn main() {
assert!(Thread::scoped(move|| int::MIN / -1).join().is_err());
assert!(thread::spawn(move|| int::MIN / -1).join().is_err());
//~^ ERROR attempted to divide with overflow in a constant expression
assert!(Thread::scoped(move|| i8::MIN / -1).join().is_err());
assert!(thread::spawn(move|| i8::MIN / -1).join().is_err());
//~^ ERROR attempted to divide with overflow in a constant expression
assert!(Thread::scoped(move|| i16::MIN / -1).join().is_err());
assert!(thread::spawn(move|| i16::MIN / -1).join().is_err());
//~^ ERROR attempted to divide with overflow in a constant expression
assert!(Thread::scoped(move|| i32::MIN / -1).join().is_err());
assert!(thread::spawn(move|| i32::MIN / -1).join().is_err());
//~^ ERROR attempted to divide with overflow in a constant expression
assert!(Thread::scoped(move|| i64::MIN / -1).join().is_err());
assert!(thread::spawn(move|| i64::MIN / -1).join().is_err());
//~^ ERROR attempted to divide with overflow in a constant expression
assert!(Thread::scoped(move|| 1is / 0).join().is_err());
assert!(thread::spawn(move|| 1is / 0).join().is_err());
//~^ ERROR attempted to divide by zero in a constant expression
assert!(Thread::scoped(move|| 1i8 / 0).join().is_err());
assert!(thread::spawn(move|| 1i8 / 0).join().is_err());
//~^ ERROR attempted to divide by zero in a constant expression
assert!(Thread::scoped(move|| 1i16 / 0).join().is_err());
assert!(thread::spawn(move|| 1i16 / 0).join().is_err());
//~^ ERROR attempted to divide by zero in a constant expression
assert!(Thread::scoped(move|| 1i32 / 0).join().is_err());
assert!(thread::spawn(move|| 1i32 / 0).join().is_err());
//~^ ERROR attempted to divide by zero in a constant expression
assert!(Thread::scoped(move|| 1i64 / 0).join().is_err());
assert!(thread::spawn(move|| 1i64 / 0).join().is_err());
//~^ ERROR attempted to divide by zero in a constant expression
assert!(Thread::scoped(move|| int::MIN % -1).join().is_err());
assert!(thread::spawn(move|| int::MIN % -1).join().is_err());
//~^ ERROR attempted remainder with overflow in a constant expression
assert!(Thread::scoped(move|| i8::MIN % -1).join().is_err());
assert!(thread::spawn(move|| i8::MIN % -1).join().is_err());
//~^ ERROR attempted remainder with overflow in a constant expression
assert!(Thread::scoped(move|| i16::MIN % -1).join().is_err());
assert!(thread::spawn(move|| i16::MIN % -1).join().is_err());
//~^ ERROR attempted remainder with overflow in a constant expression
assert!(Thread::scoped(move|| i32::MIN % -1).join().is_err());
assert!(thread::spawn(move|| i32::MIN % -1).join().is_err());
//~^ ERROR attempted remainder with overflow in a constant expression
assert!(Thread::scoped(move|| i64::MIN % -1).join().is_err());
assert!(thread::spawn(move|| i64::MIN % -1).join().is_err());
//~^ ERROR attempted remainder with overflow in a constant expression
assert!(Thread::scoped(move|| 1is % 0).join().is_err());
assert!(thread::spawn(move|| 1is % 0).join().is_err());
//~^ ERROR attempted remainder with a divisor of zero in a constant expression
assert!(Thread::scoped(move|| 1i8 % 0).join().is_err());
assert!(thread::spawn(move|| 1i8 % 0).join().is_err());
//~^ ERROR attempted remainder with a divisor of zero in a constant expression
assert!(Thread::scoped(move|| 1i16 % 0).join().is_err());
assert!(thread::spawn(move|| 1i16 % 0).join().is_err());
//~^ ERROR attempted remainder with a divisor of zero in a constant expression
assert!(Thread::scoped(move|| 1i32 % 0).join().is_err());
assert!(thread::spawn(move|| 1i32 % 0).join().is_err());
//~^ ERROR attempted remainder with a divisor of zero in a constant expression
assert!(Thread::scoped(move|| 1i64 % 0).join().is_err());
assert!(thread::spawn(move|| 1i64 % 0).join().is_err());
//~^ ERROR attempted remainder with a divisor of zero in a constant expression
}

View file

@ -30,4 +30,4 @@ pub mod bar {
// #[stable] is not inherited
pub fn unmarked() {}
//~^ ERROR This node does not have a stability attribute
}
}

View file

@ -8,11 +8,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::thread::Thread;
use std::thread;
fn main() {
let x = "Hello world!".to_string();
Thread::spawn(move|| {
thread::spawn(move|| {
println!("{}", x);
});
println!("{}", x); //~ ERROR use of moved value

View file

@ -11,13 +11,13 @@
// error-pattern: use of moved value
use std::sync::Arc;
use std::thread::Thread;
use std::thread;
fn main() {
let v = vec!(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
let arc_v = Arc::new(v);
Thread::spawn(move|| {
thread::spawn(move|| {
assert_eq!((*arc_v)[3], 4);
});

View file

@ -9,13 +9,13 @@
// except according to those terms.
use std::sync::Arc;
use std::thread::Thread;
use std::thread;
fn main() {
let v = vec!(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
let arc_v = Arc::new(v);
Thread::spawn(move|| {
thread::spawn(move|| {
assert_eq!((*arc_v)[3], 4);
});

View file

@ -10,7 +10,7 @@
#![feature(unsafe_destructor)]
use std::thread::Thread;
use std::thread;
use std::rc::Rc;
#[derive(Debug)]
@ -35,7 +35,7 @@ fn main() {
let x = foo(Port(Rc::new(())));
Thread::spawn(move|| {
thread::spawn(move|| {
//~^ ERROR `core::marker::Send` is not implemented
let y = x;
println!("{:?}", y);