Skip to content

Commit b15e718

Browse files
committed
---
yaml --- r: 171197 b: refs/heads/batch c: c062fac h: refs/heads/master i: 171195: ed41259 v: v3
1 parent 01d60bf commit b15e718

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
@@ -29,7 +29,7 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2929
refs/heads/issue-18208-method-dispatch-2: 9e1eae4fb9b6527315b4441cf8a0f5ca911d1671
3030
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
32-
refs/heads/batch: 8b883ab2681e34ef94575f45c6c0e6c2bca23ab7
32+
refs/heads/batch: c062fac835e64c1ebf71da784714de562eac732c
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 496dc4eae7de9d14cd49511a9acfbf5f11ae6c3f
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928

branches/batch/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/batch/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/batch/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/batch/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)