diff options
| author | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2018-08-22 15:56:37 +0200 |
|---|---|---|
| committer | Oliver Schneider <github35764891676564198441@oli-obk.de> | 2018-08-31 08:39:59 +0200 |
| commit | 472ca7159812f8c360697f63454ee7bda1e02570 (patch) | |
| tree | 6a79a67fdb82c6c5619bdada6859aa6598b555b6 /src/libsyntax | |
| parent | 1114ab684fbad001c4e580326d8eb4d8c4e917d3 (diff) | |
| download | rust-472ca7159812f8c360697f63454ee7bda1e02570.tar.gz rust-472ca7159812f8c360697f63454ee7bda1e02570.zip | |
Implement the `min_const_fn` feature gate
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/attr/builtin.rs | 26 | ||||
| -rw-r--r-- | src/libsyntax/attr/mod.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 29 |
3 files changed, 34 insertions, 23 deletions
diff --git a/src/libsyntax/attr/builtin.rs b/src/libsyntax/attr/builtin.rs index ecd52a62eab..3eecdf14a4e 100644 --- a/src/libsyntax/attr/builtin.rs +++ b/src/libsyntax/attr/builtin.rs @@ -107,7 +107,11 @@ pub struct Stability { pub level: StabilityLevel, pub feature: Symbol, pub rustc_depr: Option<RustcDeprecation>, - pub rustc_const_unstable: Option<RustcConstUnstable>, + /// `None` means the function is stable but needs to be allowed by the + /// `min_const_fn` feature + /// `Some` contains the feature gate required to be able to use the function + /// as const fn + pub const_stability: Option<Symbol>, } /// The available stability levels. @@ -141,11 +145,6 @@ pub struct RustcDeprecation { pub reason: Symbol, } -#[derive(RustcEncodable, RustcDecodable, PartialEq, PartialOrd, Clone, Debug, Eq, Hash)] -pub struct RustcConstUnstable { - pub feature: Symbol, -} - /// Check if `attrs` contains an attribute like `#![feature(feature_name)]`. /// This will not perform any "sanity checks" on the form of the attributes. pub fn contains_feature_attr(attrs: &[Attribute], feature_name: &str) -> bool { @@ -176,7 +175,7 @@ fn find_stability_generic<'a, I>(diagnostic: &Handler, let mut stab: Option<Stability> = None; let mut rustc_depr: Option<RustcDeprecation> = None; - let mut rustc_const_unstable: Option<RustcConstUnstable> = None; + let mut rustc_const_unstable: Option<Symbol> = None; 'outer: for attr in attrs_iter { if 