Skip to content

Commit 2272130

Browse files
committed
---
yaml --- r: 172541 b: refs/heads/auto c: ad7e33e h: refs/heads/master i: 172539: cc71234 v: v3
1 parent 09a835d commit 2272130

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
@@ -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: dd074ab4eedcb08ca8a1861fc1e62f125e23fa8b
13+
refs/heads/auto: ad7e33efee023822bd63fa6f942c25582ef12a1e
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

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