Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 1e5337d

Browse files
committed
stabilize raw_ref_op
1 parent 04ba50e commit 1e5337d

File tree

62 files changed

+106
-245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+106
-245
lines changed

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
539539
}
540540
}
541541
gate_all!(gen_blocks, "gen blocks are experimental");
542-
gate_all!(raw_ref_op, "raw address of syntax is experimental");
543542
gate_all!(const_trait_impl, "const trait impls are experimental");
544543
gate_all!(
545544
half_open_range_patterns_in_slices,

compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
extern_types,
77
naked_functions,
88
thread_local,
9-
repr_simd,
10-
raw_ref_op
9+
repr_simd
1110
)]
1211
#![no_core]
1312
#![allow(dead_code, non_camel_case_types, internal_features)]

compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#![feature(
44
no_core, unboxed_closures, start, lang_items, never_type, linkage,
5-
extern_types, thread_local, raw_ref_op
5+
extern_types, thread_local
66
)]
77
#![no_core]
88
#![allow(dead_code, internal_features, non_camel_case_types)]

compiler/rustc_error_codes/src/error_codes/E0745.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ The address of temporary value was taken.
33
Erroneous code example:
44

55
```compile_fail,E0745
6-
# #![feature(raw_ref_op)]
76
fn temp_address() {
87
let ptr = &raw const 2; // error!
98
}
@@ -15,7 +14,6 @@ In this example, `2` is destroyed right after the assignment, which means that
1514
To avoid this error, first bind the temporary to a named local variable:
1615

1716
```
18-
# #![feature(raw_ref_op)]
1917
fn temp_address() {
2018
let val = 2;
2119
let ptr = &raw const val; // ok!

compiler/rustc_feature/src/accepted.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,8 @@ declare_features! (
319319
(accepted, raw_dylib, "1.71.0", Some(58713)),
320320
/// Allows keywords to be escaped for use as identifiers.
321321
(accepted, raw_identifiers, "1.30.0", Some(48589)),
322+
/// Allows `&raw const $place_expr` and `&raw mut $place_expr` expressions.
323+
(accepted, raw_ref_op, "CURRENT_RUSTC_VERSION", Some(64490)),
322324
/// Allows relaxing the coherence rules such that
323325
/// `impl<T> ForeignTrait<LocalType> for ForeignType<T>` is permitted.
324326
(accepted, re_rebalance_coherence, "1.41.0", Some(55437)),

compiler/rustc_feature/src/unstable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,6 @@ declare_features! (
567567
(unstable, precise_capturing, "1.79.0", Some(123432)),
568568
/// Allows macro attributes on expressions, statements and non-inline modules.
569569
(unstable, proc_macro_hygiene, "1.30.0", Some(54727)),
570-
/// Allows `&raw const $place_expr` and `&raw mut $place_expr` expressions.
571-
(unstable, raw_ref_op, "1.41.0", Some(64490)),
572570
/// Makes `&` and `&mut` patterns eat only one layer of references in Rust 2024.
573571
(incomplete, ref_pat_eat_one_layer_2024, "1.79.0", Some(123076)),
574572
/// Makes `&` and `&mut` patterns eat only one layer of references in Rust 2024—structural variant

compiler/rustc_parse/src/parser/expr.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ impl<'a> Parser<'a> {
830830
self.expect_and()?;
831831
let has_lifetime = self.token.is_lifetime() && self.look_ahead(1, |t| t != &token::Colon);
832832
let lifetime = has_lifetime.then(|| self.expect_lifetime()); // For recovery, see below.
833-
let (borrow_kind, mutbl) = self.parse_borrow_modifiers(lo);
833+
let (borrow_kind, mutbl) = self.parse_borrow_modifiers();
834834
let attrs = self.parse_outer_attributes()?;
835835
let expr = if self.token.is_range_separator() {
836836
self.parse_expr_prefix_range(attrs)
@@ -850,13 +850,12 @@ impl<'a> Parser<'a> {
850850
}
851851

852852
/// Parse `mut?` or `raw [ const | mut ]`.
853-
fn parse_borrow_modifiers(&mut self, lo: Span) -> (ast::BorrowKind, ast::Mutability) {
853+
fn parse_borrow_modifiers(&mut self) -> (ast::BorrowKind, ast::Mutability) {
854854
if self.check_keyword(kw::Raw) && self.look_ahead(1, Token::is_mutability) {
855855
// `raw [ const | mut ]`.
856856
let found_raw = self.eat_keyword(kw::Raw);
857857
assert!(found_raw);
858858
let mutability = self.parse_const_or_mut().unwrap();
859-
self.psess.gated_spans.gate(sym::raw_ref_op, lo.to(self.prev_token.span));
860859
(ast::BorrowKind::Raw, mutability)
861860
} else {
862861
// `mut?`

src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(raw_ref_op)]
21
#![feature(strict_provenance)]
32
use std::ptr;
43

src/tools/miri/tests/fail/function_calls/return_pointer_aliasing.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@revisions: stack tree none
22
//@[tree]compile-flags: -Zmiri-tree-borrows
33
//@[none]compile-flags: -Zmiri-disable-stacked-borrows
4-
#![feature(raw_ref_op)]
54
#![feature(core_intrinsics)]
65
#![feature(custom_mir)]
76

src/tools/miri/tests/fail/function_calls/return_pointer_aliasing2.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// This does need an aliasing model.
22
//@revisions: stack tree
33
//@[tree]compile-flags: -Zmiri-tree-borrows
4-
#![feature(raw_ref_op)]
54
#![feature(core_intrinsics)]
65
#![feature(custom_mir)]
76

0 commit comments

Comments
 (0)