Skip to content

Commit 2c4bb96

Browse files
committed
---
yaml --- r: 169843 b: refs/heads/auto c: c062fac h: refs/heads/master i: 169841: 7216056 169839: 60889f7 v: v3
1 parent 616ee28 commit 2c4bb96

File tree

6 files changed

+41
-2
lines changed

6 files changed

+41
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 8b883ab2681e34ef94575f45c6c0e6c2bca23ab7
13+
refs/heads/auto: c062fac835e64c1ebf71da784714de562eac732c
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libsyntax/feature_gate.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
8484
// A way to temporarily opt out of the new orphan rules. This will *never* be accepted.
8585
("old_orphan_check", Deprecated),
8686

87+
// OIBIT specific features
88+
("optin_builtin_traits", Active),
89+
8790
// These are used to test this portion of the compiler, they don't actually
8891
// mean anything
8992
("test_accepted_feature", Accepted),
@@ -291,7 +294,17 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
291294
}
292295
}
293296

294-
ast::ItemImpl(_, _, _, _, _, ref items) => {
297+
ast::ItemImpl(_, polarity, _, _, _, ref items) => {
298+
match polarity {
299+
ast::ImplPolarity::Negative => {
300+
self.gate_feature("optin_builtin_traits",
301+
i.span,
302+
"negative trait bounds are not yet fully implemented; \
303+
use marker types for now");
304+
},
305+
_ => {}
306+
}
307+
295308
if attr::contains_name(i.attrs[],
296309
"unsafe_destructor") {
297310
self.gate_feature("unsafe_destructor",
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
use std::kinds::Send;
12+
13+
struct TestType;
14+
15+
trait TestTrait {}
16+
17+
unsafe impl !Send for TestType {}
18+
//~^ ERROR negative trait bounds
19+
20+
fn main() {}

branches/auto/src/test/compile-fail/syntax-trait-polarity.rs

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

11+
#![feature(optin_builtin_traits)]
12+
1113
use std::kinds::Send;
1214

1315
struct TestType;

branches/auto/src/test/pretty/trait-polarity.rs

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

11+
#![feature(optin_builtin_traits)]
12+
1113
// pp-exact
1214

1315
trait UnsafeTrait {

branches/auto/src/test/run-pass/syntax-trait-polarity.rs

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

11+
#![feature(optin_builtin_traits)]
12+
1113
use std::kinds::Send;
1214

1315
struct TestType;

0 commit comments

Comments
 (0)