Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ba8cda2

Browse files
committedAug 18, 2021
Auto merge of rust-lang#87781 - est31:remove_box, r=oli-obk
Remove box syntax from compiler and tools Removes box syntax from the compiler and tools. In rust-lang#49733, the future of box syntax is uncertain and the use in the compiler was listed as one of the reasons to keep it. Removal of box syntax [might affect the code generated](rust-lang#49646 (comment)) and slow down the compiler so I'd recommend doing a perf run on this.
2 parents 896f058 + 0f08183 commit ba8cda2

Some content is hidden

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

72 files changed

+549
-505
lines changed
 

‎compiler/rustc_ast/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
99
test(attr(deny(warnings)))
1010
)]
11-
#![feature(box_syntax)]
1211
#![feature(box_patterns)]
1312
#![cfg_attr(bootstrap, feature(const_fn_transmute))]
1413
#![feature(crate_visibility_modifier)]

‎compiler/rustc_ast/src/ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub struct P<T: ?Sized> {
3737
/// Construct a `P<T>` from a `T` value.
3838
#[allow(non_snake_case)]
3939
pub fn P<T: 'static>(value: T) -> P<T> {
40-
P { ptr: box value }
40+
P { ptr: Box::new(value) }
4141
}
4242

4343
impl<T: 'static> P<T> {

0 commit comments

Comments
 (0)