Skip to content

Commit 603fcdf

Browse files
committed
---
yaml --- r: 172841 b: refs/heads/try c: ad7e33e h: refs/heads/master i: 172839: e846a86 v: v3
1 parent 28fe3fb commit 603fcdf

File tree

6 files changed

+14
-5
lines changed

6 files changed

+14
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 170c4399e614fe599c3d41306b3429ca8b3b68c6
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 5b3cd3900ceda838f5798c30ab96ceb41f962534
5-
refs/heads/try: dd074ab4eedcb08ca8a1861fc1e62f125e23fa8b
5+
refs/heads/try: ad7e33efee023822bd63fa6f942c25582ef12a1e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libcore/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
#![feature(simd, unsafe_destructor, slicing_syntax)]
6464
#![feature(unboxed_closures)]
6565
#![allow(unknown_features)] #![feature(int_uint)]
66+
#![feature(on_unimplemented)]
6667
#![deny(missing_docs)]
6768

6869
#[macro_use]

branches/try/src/librustc/middle/traits/error_reporting.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,8 @@ pub fn report_selection_error<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
181181
let custom_note = report_on_unimplemented(infcx, &*trait_ref.0,
182182
obligation.cause.span);
183183
if let Some(s) = custom_note {
184-
infcx.tcx.sess.span_note(
185-
obligation.cause.span,
186-
s.as_slice());
184+
infcx.tcx.sess.span_note(obligation.cause.span,
185+
s.as_slice());
187186
}
188187
}
189188
}

branches/try/src/libsyntax/feature_gate.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
7171
("visible_private_types", Active),
7272
("slicing_syntax", Active),
7373
("box_syntax", Active),
74+
("on_unimplemented", Active),
7475

7576
("if_let", Accepted),
7677
("while_let", Accepted),
@@ -249,6 +250,10 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
249250
self.gate_feature("linkage", i.span,
250251
"the `linkage` attribute is experimental \
251252
and not portable across platforms")
253+
} else if attr.name() == "rustc_on_unimplemented" {
254+
self.gate_feature("on_unimplemented", i.span,
255+
"the `#[rustc_on_unimplemented]` attribute \
256+
is an experimental feature")
252257
}
253258
}
254259
match i.node {

branches/try/src/test/compile-fail/on-unimplemented-bad-anno.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
// except according to those terms.
1010
// ignore-tidy-linelength
1111

12-
#[allow(unused)]
12+
#![feature(on_unimplemented)]
13+
14+
#![allow(unused)]
1315

1416
#[rustc_on_unimplemented = "test error `{Self}` with `{Bar}` `{Baz}` `{Quux}`"]
1517
trait Foo<Bar, Baz, Quux>{}

branches/try/src/test/compile-fail/on-unimplemented.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
// except according to those terms.
1010
// ignore-tidy-linelength
1111

12+
#![feature(on_unimplemented)]
13+
1214
#[rustc_on_unimplemented = "test error `{Self}` with `{Bar}` `{Baz}` `{Quux}`"]
1315
trait Foo<Bar, Baz, Quux>{}
1416

0 commit comments

Comments
 (0)