Skip to content

Commit 921ba5a

Browse files
committed
Don't use NoSend/NoSync in tests
1 parent 094397a commit 921ba5a

19 files changed

+59
-41
lines changed

src/test/compile-fail/issue-17718-static-sync.rs

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

11-
use std::marker;
11+
#![feature(optin_builtin_traits)]
1212

13-
struct Foo { marker: marker::NoSync }
13+
use std::marker::Sync;
14+
15+
struct Foo;
16+
impl !Sync for Foo {}
1417

1518
static FOO: usize = 3;
16-
static BAR: Foo = Foo { marker: marker::NoSync };
19+
static BAR: Foo = Foo;
1720
//~^ ERROR: the trait `core::marker::Sync` is not implemented
1821

1922
fn main() {}

src/test/compile-fail/issue-7013.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,4 @@ struct A {
3535
fn main() {
3636
let a = A {v: box B{v: None} as Box<Foo+Send>};
3737
//~^ ERROR the trait `core::marker::Send` is not implemented
38-
//~^^ ERROR the trait `core::marker::Send` is not implemented
3938
}

src/test/compile-fail/kindck-nonsendable-1.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ fn main() {
1919
let x = Rc::new(3us);
2020
bar(move|| foo(x));
2121
//~^ ERROR `core::marker::Send` is not implemented
22-
//~^^ ERROR `core::marker::Send` is not implemented
2322
}
2423

src/test/compile-fail/marker-no-send.rs

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

11+
// ignore-stage1
12+
// ignore-stage2
13+
// ignore-stage3
14+
1115
use std::marker;
1216

1317
fn foo<P:Send>(p: P) { }

src/test/compile-fail/marker-no-share.rs

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

11+
// ignore-stage1
12+
// ignore-stage2
13+
// ignore-stage3
14+
1115
use std::marker;
1216

1317
fn foo<P: Sync>(p: P) { }

src/test/compile-fail/mutable-enum-indirect.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@
1111
// Tests that an `&` pointer to something inherently mutable is itself
1212
// to be considered mutable.
1313

14-
use std::marker;
14+
#![feature(optin_builtin_traits)]
1515

16-
enum Foo { A(marker::NoSync) }
16+
use std::marker::Sync;
17+
18+
struct NoSync;
19+
impl !Sync for NoSync {}
20+
21+
enum Foo { A(NoSync) }
1722

1823
fn bar<T: Sync>(_: T) {}
1924

2025
fn main() {
21-
let x = Foo::A(marker::NoSync);
26+
let x = Foo::A(NoSync);
2227
bar(&x); //~ ERROR the trait `core::marker::Sync` is not implemented
2328
}

src/test/compile-fail/no-send-res-ports.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ fn main() {
3737

3838
Thread::spawn(move|| {
3939
//~^ ERROR `core::marker::Send` is not implemented
40-
//~^^ ERROR `core::marker::Send` is not implemented
4140
let y = x;
4241
println!("{:?}", y);
4342
});

src/test/compile-fail/no_send-enum.rs

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

11-
use std::marker;
11+
#![feature(optin_builtin_traits)]
12+
13+
use std::marker::Send;
14+
15+
struct NoSend;
16+
impl !Send for NoSend {}
1217

1318
enum Foo {
14-
A(marker::NoSend)
19+
A(NoSend)
1520
}
1621

1722
fn bar<T: Send>(_: T) {}
1823

1924
fn main() {
20-
let x = Foo::A(marker::NoSend);
25+
let x = Foo::A(NoSend);
2126
bar(x);
2227
//~^ ERROR `core::marker::Send` is not implemented
2328
}

src/test/compile-fail/no_send-rc.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@ fn main() {
1616
let x = Rc::new(5is);
1717
bar(x);
1818
//~^ ERROR `core::marker::Send` is not implemented
19-
//~^^ ERROR `core::marker::Send` is not implemented
2019
}

src/test/compile-fail/no_send-struct.rs

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

11-
use std::marker;
11+
#![feature(optin_builtin_traits)]
12+
13+
use std::marker::Send;
1214

1315
struct Foo {
1416
a: isize,
15-
ns: marker::NoSend
1617
}
1718

19+
impl !Send for Foo {}
20+
1821
fn bar<T: Send>(_: T) {}
1922

2023
fn main() {
21-
let x = Foo { a: 5, ns: marker::NoSend };
24+
let x = Foo { a: 5 };
2225
bar(x);
2326
//~^ ERROR the trait `core::marker::Send` is not implemented
2427
}

0 commit comments

Comments
 (0)