Skip to content

Commit b655def

Browse files
committed
---
yaml --- r: 185015 b: refs/heads/snap-stage3 c: 7213ef1 h: refs/heads/master i: 185013: 5450386 185011: 95ac77c 185007: ffebcf1 v: v3
1 parent 146d5d5 commit b655def

10 files changed

+270
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: f0f7ca27de6b4e03f30012656dad270cda55a363
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 0be1e430cf8762095178cb8c94a17f1bab32a191
4+
refs/heads/snap-stage3: 7213ef1a8fd3cb7e479d53fdb287c6c612b9fb93
55
refs/heads/try: ccf8fedf1cffcb8f6f3581d53d220039e192fe77
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// ignore-tidy-linelength
12+
13+
#![feature(optin_builtin_traits)]
14+
15+
trait MyTrait {}
16+
17+
impl MyTrait for .. {}
18+
19+
impl MyTrait for .. {}
20+
//~^ ERROR conflicting implementations for trait `MyTrait`
21+
22+
impl MyTrait for (i32, i32) {}
23+
//~^ ERROR implementations for traits providing default implementations are only allowed on
24+
25+
fn main() {}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(optin_builtin_traits)]
12+
13+
trait MyDefaultImpl {}
14+
15+
impl<T> MyDefaultImpl for .. {}
16+
//~^ ERROR default trait implementations are not allowed to have genercis
17+
18+
fn main() {}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(optin_builtin_traits)]
12+
13+
trait MyTrait {}
14+
15+
impl MyTrait for .. {}
16+
17+
struct MyS;
18+
19+
struct MyS2;
20+
21+
impl !MyTrait for MyS2 {}
22+
23+
fn is_mytrait<T: MyTrait>() {}
24+
25+
fn main() {
26+
is_mytrait::<MyS>();
27+
28+
is_mytrait::<(MyS2, MyS)>();
29+
//~^ ERROR the trait `MyTrait` is not implemented for the type `MyS2`
30+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(optin_builtin_traits)]
12+
13+
trait MyTrait {}
14+
15+
impl MyTrait for .. {}
16+
impl<T> !MyTrait for *mut T {}
17+
18+
struct MyS;
19+
20+
struct MyS2;
21+
22+
impl !MyTrait for MyS2 {}
23+
24+
struct MyS3;
25+
26+
fn is_mytrait<T: MyTrait>() {}
27+
28+
fn main() {
29+
is_mytrait::<MyS>();
30+
31+
is_mytrait::<MyS2>();
32+
//~^ ERROR the trait `MyTrait` is not implemented for the type `MyS2`
33+
34+
is_mytrait::<Vec<MyS3>>();
35+
//~^ ERROR the trait `MyTrait` is not implemented for the type `*mut MyS3`
36+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(optin_builtin_traits)]
12+
13+
struct MySendable {
14+
t: *mut u8
15+
}
16+
17+
unsafe impl Send for MySendable {}
18+
19+
struct MyNotSendable {
20+
t: *mut u8
21+
}
22+
23+
impl !Send for MyNotSendable {}
24+
25+
fn is_send<T: Send>() {}
26+
27+
fn main() {
28+
is_send::<MySendable>();
29+
is_send::<MyNotSendable>();
30+
//~^ ERROR the trait `core::marker::Send` is not implemented for the type `MyNotSendable`
31+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// ignore-tidy-linelength
12+
13+
#![feature(optin_builtin_traits)]
14+
15+
use std::marker::Managed;
16+
use std::cell::UnsafeCell;
17+
18+
struct MySync {
19+
t: *mut u8
20+
}
21+
22+
unsafe impl Sync for MySync {}
23+
24+
struct MyNotSync {
25+
t: *mut u8
26+
}
27+
28+
impl !Sync for MyNotSync {}
29+
30+
struct MyTypeWUnsafe {
31+
t: UnsafeCell<u8>
32+
}
33+
34+
struct MyTypeManaged {
35+
t: Managed
36+
}
37+
38+
fn is_sync<T: Sync>() {}
39+
40+
fn main() {
41+
is_sync::<MySync>();
42+
is_sync::<MyNotSync>();
43+
//~^ ERROR the trait `core::marker::Sync` is not implemented for the type `MyNotSync`
44+
45+
is_sync::<MyTypeWUnsafe>();
46+
//~^ ERROR the trait `core::marker::Sync` is not implemented for the type `core::cell::UnsafeCell<u8>`
47+
48+
is_sync::<MyTypeManaged>();
49+
//~^ ERROR the trait `core::marker::Sync` is not implemented for the type `core::marker::Managed`
50+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(optin_builtin_traits)]
12+
13+
trait MyTrait {}
14+
15+
impl MyTrait for .. {}
16+
17+
unsafe trait MyUnsafeTrait {}
18+
19+
unsafe impl MyUnsafeTrait for .. {}
20+
21+
struct ThisImplsTrait;
22+
23+
impl !MyUnsafeTrait for ThisImplsTrait {}
24+
25+
26+
struct ThisImplsUnsafeTrait;
27+
28+
impl !MyTrait for ThisImplsUnsafeTrait {}
29+
30+
fn is_my_trait<T: MyTrait>() {}
31+
fn is_my_unsafe_trait<T: MyUnsafeTrait>() {}
32+
33+
fn main() {
34+
is_my_trait::<ThisImplsTrait>();
35+
is_my_trait::<ThisImplsUnsafeTrait>();
36+
//~^ ERROR the trait `MyTrait` is not implemented for the type `ThisImplsUnsafeTrait`
37+
38+
is_my_unsafe_trait::<ThisImplsTrait>();
39+
//~^ ERROR the trait `MyUnsafeTrait` is not implemented for the type `ThisImplsTrait`
40+
41+
is_my_unsafe_trait::<ThisImplsUnsafeTrait>();
42+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// ignore-tidy-linelength
12+
13+
#![feature(optin_builtin_traits)]
14+
15+
impl Copy for .. {}
16+
//~^ ERROR cannot create default implementations for traits outside the crate they're defined in; define a new trait instead.
17+
18+
fn main() {}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(optin_builtin_traits)]
12+
13+
// pp-exact
14+
15+
trait MyTrait { }
16+
17+
impl MyTrait for .. { }
18+
19+
pub fn main() { }

0 commit comments

Comments
 (0)