Skip to content

Commit 3090b37

Browse files
committed
stabilize raw_ref_op
1 parent 44fb857 commit 3090b37

File tree

50 files changed

+29
-155
lines changed

Some content is hidden

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

50 files changed

+29
-155
lines changed

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
524524
}
525525
}
526526
gate_all!(gen_blocks, "gen blocks are experimental");
527-
gate_all!(raw_ref_op, "raw address of syntax is experimental");
528527
gate_all!(const_trait_impl, "const trait impls are experimental");
529528
gate_all!(
530529
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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ declare_features! (
4242
// feature-group-start: accepted features
4343
// -------------------------------------------------------------------------
4444

45+
// Note that the version indicates when it got *stabilized*.
46+
// When moving an unstable feature here, set the version number to
47+
// `CURRENT-RUSTC-VERSION` with `-` replaced by `_`.
48+
4549
/// Allows `#[target_feature(...)]` on aarch64 platforms
4650
(accepted, aarch64_target_feature, "1.61.0", Some(44839)),
4751
/// Allows using the `efiapi` ABI.
@@ -310,6 +314,8 @@ declare_features! (
310314
(accepted, raw_dylib, "1.71.0", Some(58713)),
311315
/// Allows keywords to be escaped for use as identifiers.
312316
(accepted, raw_identifiers, "1.30.0", Some(48589)),
317+
/// Allows `&raw const $place_expr` and `&raw mut $place_expr` expressions.
318+
(accepted, raw_ref_op, "CURRENT_RUSTC_VERSION", Some(64490)),
313319
/// Allows relaxing the coherence rules such that
314320
/// `impl<T> ForeignTrait<LocalType> for ForeignType<T>` is permitted.
315321
(accepted, re_rebalance_coherence, "1.41.0", Some(55437)),

compiler/rustc_feature/src/removed.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ declare_features! (
3232
// feature-group-start: removed features
3333
// -------------------------------------------------------------------------
3434

35+
// Note that the version indicates when it got *removed*.
36+
// When moving an unstable feature here, set the version number to
37+
// `CURRENT-RUSTC-VERSION` with `-` replaced by `_`.
38+
3539
/// Allows using the `amdgpu-kernel` ABI.
3640
(removed, abi_amdgpu_kernel, "1.77.0", Some(51575), None),
3741
(removed, advanced_slice_patterns, "1.0.0", Some(62254),

compiler/rustc_feature/src/unstable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,6 @@ declare_features! (
571571
(unstable, precise_capturing, "1.79.0", Some(123432)),
572572
/// Allows macro attributes on expressions, statements and non-inline modules.
573573
(unstable, proc_macro_hygiene, "1.30.0", Some(54727)),
574-
/// Allows `&raw const $place_expr` and `&raw mut $place_expr` expressions.
575-
(unstable, raw_ref_op, "1.41.0", Some(64490)),
576574
/// Makes `&` and `&mut` patterns eat only one layer of references in Rust 2024.
577575
(incomplete, ref_pat_eat_one_layer_2024, "1.79.0", Some(123076)),
578576
/// 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
@@ -846,7 +846,7 @@ impl<'a> Parser<'a> {
846846
self.expect_and()?;
847847
let has_lifetime = self.token.is_lifetime() && self.look_ahead(1, |t| t != &token::Colon);
848848
let lifetime = has_lifetime.then(|| self.expect_lifetime()); // For recovery, see below.
849-
let (borrow_kind, mutbl) = self.parse_borrow_modifiers(lo);
849+
let (borrow_kind, mutbl) = self.parse_borrow_modifiers();
850850
let attrs = self.parse_outer_attributes()?;
851851
let expr = if self.token.is_range_separator() {
852852
self.parse_expr_prefix_range(attrs)
@@ -866,13 +866,12 @@ impl<'a> Parser<'a> {
866866
}
867867

868868
/// Parse `mut?` or `raw [ const | mut ]`.
869-
fn parse_borrow_modifiers(&mut self, lo: Span) -> (ast::BorrowKind, ast::Mutability) {
869+
fn parse_borrow_modifiers(&mut self) -> (ast::BorrowKind, ast::Mutability) {
870870
if self.check_keyword(kw::Raw) && self.look_ahead(1, Token::is_mutability) {
871871
// `raw [ const | mut ]`.
872872
let found_raw = self.eat_keyword(kw::Raw);
873873
assert!(found_raw);
874874
let mutability = self.parse_const_or_mut().unwrap();
875-
self.psess.gated_spans.gate(sym::raw_ref_op, lo.to(self.prev_token.span));
876875
(ast::BorrowKind::Raw, mutability)
877876
} else {
878877
// `mut?`

src/tools/cargo

Submodule cargo updated 55 files

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

0 commit comments

Comments
 (0)