Skip to content

Commit f90c3b0

Browse files
committed
---
yaml --- r: 182014 b: refs/heads/beta c: ad7e33e h: refs/heads/master v: v3
1 parent e6b6376 commit f90c3b0

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
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: dd074ab4eedcb08ca8a1861fc1e62f125e23fa8b
34+
refs/heads/beta: ad7e33efee023822bd63fa6f942c25582ef12a1e
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: eb836bf767aa1d8d4cba488a9091cde3c0ab4b2f

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