Add inline_const feature flag
This commit is contained in:
parent
6999ff33c9
commit
3c4ad55082
5 changed files with 19 additions and 0 deletions
|
@ -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_bound_opt_out, "`?const` on trait bounds is experimental");
|
||||||
gate_all!(const_trait_impl, "const trait impls are 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!(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,
|
// All uses of `gate_all!` below this point were added in #65742,
|
||||||
// and subsequently disabled (with the non-early gating readded).
|
// and subsequently disabled (with the non-early gating readded).
|
||||||
|
|
|
@ -598,6 +598,9 @@ declare_features! (
|
||||||
/// Allows `#[instruction_set(_)]` attribute
|
/// Allows `#[instruction_set(_)]` attribute
|
||||||
(active, isa_attribute, "1.48.0", Some(74727), None),
|
(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
|
// feature-group-end: actual feature gates
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
|
@ -593,6 +593,7 @@ symbols! {
|
||||||
infer_static_outlives_requirements,
|
infer_static_outlives_requirements,
|
||||||
inlateout,
|
inlateout,
|
||||||
inline,
|
inline,
|
||||||
|
inline_const,
|
||||||
inout,
|
inout,
|
||||||
instruction_set,
|
instruction_set,
|
||||||
intel,
|
intel,
|
||||||
|
|
6
src/test/ui/feature-gate-inline_const.rs
Normal file
6
src/test/ui/feature-gate-inline_const.rs
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
fn main() {
|
||||||
|
let _ = const {
|
||||||
|
//~^ ERROR expected expression, found keyword `const`
|
||||||
|
true
|
||||||
|
};
|
||||||
|
}
|
8
src/test/ui/feature-gate-inline_const.stderr
Normal file
8
src/test/ui/feature-gate-inline_const.stderr
Normal 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
|
||||||
|
|
Loading…
Add table
Reference in a new issue