diff options
| author | bors <bors@rust-lang.org> | 2017-03-02 20:10:40 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-03-02 20:10:40 +0000 |
| commit | c0b7112ba246d96f253ba845d91f36c0b7398e42 (patch) | |
| tree | 2eb615b585a9039247b1c1f8589dd0941c75d1dc /src/libsyntax | |
| parent | 5907ed63d329daefcd1680813d57e5ca00cd2fc2 (diff) | |
| parent | ba39e5d905dc5a32c1156db780635612deeb2bd0 (diff) | |
| download | rust-c0b7112ba246d96f253ba845d91f36c0b7398e42.tar.gz rust-c0b7112ba246d96f253ba845d91f36c0b7398e42.zip | |
Auto merge of #40216 - frewsxcv:rollup, r=frewsxcv
Rollup of 7 pull requests - Successful merges: #39832, #40104, #40110, #40117, #40129, #40139, #40166 - Failed merges:
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/abi.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 38 |
2 files changed, 33 insertions, 7 deletions
diff --git a/src/libsyntax/abi.rs b/src/libsyntax/abi.rs index 42f3aa5ffd6..30641515a41 100644 --- a/src/libsyntax/abi.rs +++ b/src/libsyntax/abi.rs @@ -25,6 +25,7 @@ pub enum Abi { SysV64, PtxKernel, Msp430Interrupt, + X86Interrupt, // Multiplatform / generic ABIs Rust, @@ -59,6 +60,7 @@ const AbiDatas: &'static [AbiData] = &[ AbiData {abi: Abi::SysV64, name: "sysv64", generic: false }, AbiData {abi: Abi::PtxKernel, name: "ptx-kernel", generic: false }, AbiData {abi: Abi::Msp430Interrupt, name: "msp430-interrupt", generic: false }, + AbiData {abi: Abi::X86Interrupt, name: "x86-interrupt", generic: false }, // Cross-platform ABIs AbiData {abi: Abi::Rust, name: "Rust", generic: true }, diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index c2b72edb66c..6eb7d449f26 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -77,12 +77,19 @@ macro_rules! declare_features { }; ($((removed, $feature: ident, $ver: expr, $issue: expr),)+) => { - /// Represents features which has since been removed (it was once Active) + /// Represents unstable features which have since been removed (it was once Active) const REMOVED_FEATURES: &'static [(&'static str, &'static str, Option<u32>)] = &[ $((stringify!($feature), $ver, $issue)),+ ]; }; + ($((stable_removed, $feature: ident, $ver: expr, $issue: expr),)+) => { + /// Represents stable features which have since been removed (it was once Accepted) + const STABLE_REMOVED_FEATURES: &'static [(&'static str, &'static str, Option<u32>)] = &[ + $((stringify!($feature), $ver, $issue)),+ + ]; + }; + ($((accepted, $feature: ident, $ver: expr, $issue: expr),)+) => { /// Those language feature has since been Accepted (it was once Active) const ACCEPTED_FEATURES: &'static [(&'static str, &'static str, Option<u32>)] = &[ @@ -330,6 +337,9 @@ declare_features! ( // Used to identify crates that contain sanitizer runtimes // rustc internal (active, sanitizer_runtime, "1.17.0", None), + + // `extern "x86-interrupt" fn()` + (active, abi_x86_interrupt, "1.17.0", Some(40180)), ); declare_features! ( @@ -352,6 +362,10 @@ declare_features! ( ); declare_features! ( + (stable_removed, no_stack_check, "1.0.0", None), +); + +declare_features! ( (accepted, associated_types, "1.0.0", None), // allow overloading augmented assignment operations like `a += b` (accepted, augmented_assignments, "1.8.0", Some(28235)), @@ -505,9 +519,6 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG not yet settled", cfg_fn!(structural_match))), - // Not used any more, but we can't feature gate it - ("no_stack_check", Normal, Ungated), - ("plugin", CrateLevel, Gated(Stability::Unstable, "plugin", "compiler plugins are experimental \ @@ -763,6 +774,11 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG "attribute proc macros are currently unstable", cfg_fn!(proc_macro))), + ("proc_macro", Normal, Gated(Stability::Unstable, + "proc_macro", + "function-like proc macros are currently unstable", + cfg_fn!(proc_macro))), + ("rustc_derive_registrar", Normal, Gated(Stability::Unstable, "rustc_derive_registrar", "used internally by rustc", @@ -909,8 +925,10 @@ fn find_lang_feature_issue(feature: &str) -> Option<u32> { // assert!(issue.is_some()) issue } else { - // search in Accepted or Removed features - match ACCEPTED_FEATURES.iter().chain(REMOVED_FEATURES).find(|t| t.0 == feature) { + // search in Accepted, Removed, or Stable Removed features + let found = ACCEPTED_FEATURES.iter().chain(REMOVED_FEATURES).chain(STABLE_REMOVED_FEATURES) + .find(|t| t.0 == feature); + match found { Some(&(_, _, issue)) => issue, None => panic!("Feature `{}` is not declared anywhere", feature), } @@ -1036,6 +1054,10 @@ impl<'a> PostExpansionVisitor<'a> { gate_feature_post!(&self, abi_msp430_interrupt, span, "msp430-interrupt ABI is experimental and subject to change"); }, + Abi::X86Interrupt => { + gate_feature_post!(&self, abi_x86_interrupt, span, + "x86-interrupt ABI is experimental and subject to change"); + }, // Stable Abi::Cdecl | Abi::Stdcall | @@ -1444,7 +1466,9 @@ pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute]) -> F feature_checker.collect(&features, mi.span); } else if let Some(&(_, _, _)) = REMOVED_FEATURES.iter() - .find(|& &(n, _, _)| name == n) { + .find(|& &(n, _, _)| name == n) + .or_else(|| STABLE_REMOVED_FEATURES.iter() + .find(|& &(n, _, _)| name == n)) { span_err!(span_handler, mi.span, E0557, "feature has been removed"); } else if let Some(&(_, _, _)) = ACCEPTED_FEATURES.iter() |
