Add inline_const feature flag

This commit is contained in:
Santiago Pastorino 2020-09-21 16:10:31 -03:00
parent 6999ff33c9
commit 3c4ad55082
No known key found for this signature in database
GPG Key ID: 8131A24E0C79EFAF
5 changed files with 19 additions and 0 deletions

View File

@ -629,6 +629,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session) {
gate_all!(const_trait_bound_opt_out, "`?const` on trait bounds is experimental");
gate_all!(const_trait_impl, "const trait impls are experimental");
gate_all!(half_open_range_patterns, "half-open range patterns are unstable");
gate_all!(inline_const, "inline-const is experimental");
// All uses of `gate_all!` below this point were added in #65742,
// and subsequently disabled (with the non-early gating readded).

View File

@ -598,6 +598,9 @@ declare_features! (
/// Allows `#[instruction_set(_)]` attribute
(active, isa_attribute, "1.48.0", Some(74727), None),
/// Allow anonymous constants from an inline `const` block
(active, inline_const, "1.49.0", Some(76001), None),
// -------------------------------------------------------------------------
// feature-group-end: actual feature gates
// -------------------------------------------------------------------------

View File

@ -593,6 +593,7 @@ symbols! {
infer_static_outlives_requirements,
inlateout,
inline,
inline_const,
inout,
instruction_set,
intel,

View File

@ -0,0 +1,6 @@
fn main() {
let _ = const {
//~^ ERROR expected expression, found keyword `const`
true
};
}

View File

@ -0,0 +1,8 @@
error: expected expression, found keyword `const`
--> $DIR/feature-gate-inline_const.rs:2:13
|
LL | let _ = const {
| ^^^^^ expected expression
error: aborting due to previous error