mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-26 14:43:24 +00:00
Feature gate #[rustc_on_unimplemented]
This commit is contained in:
parent
dd074ab4ee
commit
ad7e33efee
@ -63,6 +63,7 @@
|
||||
#![feature(simd, unsafe_destructor, slicing_syntax)]
|
||||
#![feature(unboxed_closures)]
|
||||
#![allow(unknown_features)] #![feature(int_uint)]
|
||||
#![feature(on_unimplemented)]
|
||||
#![deny(missing_docs)]
|
||||
|
||||
#[macro_use]
|
||||
|
@ -181,9 +181,8 @@ pub fn report_selection_error<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
|
||||
let custom_note = report_on_unimplemented(infcx, &*trait_ref.0,
|
||||
obligation.cause.span);
|
||||
if let Some(s) = custom_note {
|
||||
infcx.tcx.sess.span_note(
|
||||
obligation.cause.span,
|
||||
s.as_slice());
|
||||
infcx.tcx.sess.span_note(obligation.cause.span,
|
||||
s.as_slice());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -71,6 +71,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
|
||||
("visible_private_types", Active),
|
||||
("slicing_syntax", Active),
|
||||
("box_syntax", Active),
|
||||
("on_unimplemented", Active),
|
||||
|
||||
("if_let", Accepted),
|
||||
("while_let", Accepted),
|
||||
@ -249,6 +250,10 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
|
||||
self.gate_feature("linkage", i.span,
|
||||
"the `linkage` attribute is experimental \
|
||||
and not portable across platforms")
|
||||
} else if attr.name() == "rustc_on_unimplemented" {
|
||||
self.gate_feature("on_unimplemented", i.span,
|
||||
"the `#[rustc_on_unimplemented]` attribute \
|
||||
is an experimental feature")
|
||||
}
|
||||
}
|
||||
match i.node {
|
||||
|
@ -9,7 +9,9 @@
|
||||
// except according to those terms.
|
||||
// ignore-tidy-linelength
|
||||
|
||||
#[allow(unused)]
|
||||
#![feature(on_unimplemented)]
|
||||
|
||||
#![allow(unused)]
|
||||
|
||||
#[rustc_on_unimplemented = "test error `{Self}` with `{Bar}` `{Baz}` `{Quux}`"]
|
||||
trait Foo<Bar, Baz, Quux>{}
|
||||
|
@ -9,6 +9,8 @@
|
||||
// except according to those terms.
|
||||
// ignore-tidy-linelength
|
||||
|
||||
#![feature(on_unimplemented)]
|
||||
|
||||
#[rustc_on_unimplemented = "test error `{Self}` with `{Bar}` `{Baz}` `{Quux}`"]
|
||||
trait Foo<Bar, Baz, Quux>{}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user