Skip to content

Commit 064bed0

Browse files
committed
Parse and feature gate raw address of expressions
1 parent a8efd31 commit 064bed0

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

src/librustc_parse/parser/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ impl<'a> Parser<'a> {
592592
}
593593
}
594594

595-
/// Parse `& mut? <expr>` or `& raw [ const | mut ] <expr>`
595+
/// Parse `& mut? <expr>` or `& raw [ const | mut ] <expr>`.
596596
fn parse_address_of(&mut self, lo: Span) -> PResult<'a, (Span, ExprKind)> {
597597
self.expect_and()?;
598598
let (k, m) = if self.check_keyword(kw::Raw)

src/libsyntax/feature_gate/active.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -520,13 +520,16 @@ declare_features! (
520520
/// Allows using the `efiapi` ABI.
521521
(active, abi_efiapi, "1.40.0", Some(65815), None),
522522

523+
/// Allows `&raw const $place_expr` and `&raw mut $place_expr` expressions.
524+
(active, raw_ref_op, "1.41.0", Some(64490), None),
525+
523526
/// Allows diverging expressions to fall back to `!` rather than `()`.
524527
(active, never_type_fallback, "1.41.0", Some(65992), None),
525528

526529
/// Allows using the `#[register_attr]` attribute.
527530
(active, register_attr, "1.41.0", Some(66080), None),
528531

529-
/// Allows using the `#[register_attr]` attribute.
532+
/// Allows using the `#[register_tool]` attribute.
530533
(active, register_tool, "1.41.0", Some(66079), None),
531534

532535
/// Allows the use of `if` and `match` in constants.

src/libsyntax/feature_gate/check.rs

+1
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,7 @@ pub fn check_crate(krate: &ast::Crate,
866866
gate_all!(generators, "yield syntax is experimental");
867867
gate_all!(or_patterns, "or-patterns syntax is experimental");
868868
gate_all!(const_extern_fn, "`const extern fn` definitions are unstable");
869+
gate_all!(raw_ref_op, "raw address of syntax is experimental");
869870

870871
// All uses of `gate_all!` below this point were added in #65742,
871872
// and subsequently disabled (with the non-early gating readded).

src/libsyntax_pos/symbol.rs

+2
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ symbols! {
9898
Auto: "auto",
9999
Catch: "catch",
100100
Default: "default",
101+
Raw: "raw",
101102
Union: "union",
102103
}
103104

@@ -546,6 +547,7 @@ symbols! {
546547
RangeToInclusive,
547548
raw_dylib,
548549
raw_identifiers,
550+
raw_ref_op,
549551
Ready,
550552
reason,
551553
recursion_limit,

0 commit comments

Comments
 (0)