Skip to content

Commit 2c122a8

Browse files
committed
Remove uses of box_syntax in rustc and tools
1 parent 7e23d77 commit 2c122a8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

example/alloc_example.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(start, core_intrinsics, alloc_error_handler, box_syntax)]
1+
#![feature(start, core_intrinsics, alloc_error_handler)]
22
#![no_std]
33

44
extern crate alloc;
@@ -29,7 +29,7 @@ fn alloc_error_handler(_: alloc::alloc::Layout) -> ! {
2929

3030
#[start]
3131
fn main(_argc: isize, _argv: *const *const u8) -> isize {
32-
let world: Box<&str> = box "Hello World!\0";
32+
let world: Box<&str> = Box::new("Hello World!\0");
3333
unsafe {
3434
puts(*world as *const str as *const u8);
3535
}

example/mini_core_hello_world.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(no_core, lang_items, never_type, linkage, extern_types, thread_local, box_syntax)]
1+
#![feature(no_core, lang_items, never_type, linkage, extern_types, thread_local)]
22
#![no_core]
33
#![allow(dead_code, non_camel_case_types)]
44

@@ -178,7 +178,7 @@ fn main() {
178178
let ptr: *const i8 = hello as *const [u8] as *const i8;
179179
puts(ptr);
180180

181-
let world: Box<&str> = box "World!\0";
181+
let world: Box<&str> = Box::new("World!\0");
182182
puts(*world as *const str as *const i8);
183183
world as Box<dyn SomeTrait>;
184184

@@ -238,10 +238,10 @@ fn main() {
238238
}
239239
}
240240

241-
let _ = box NoisyDrop {
241+
let _ = Box::new(NoisyDrop {
242242
text: "Boxed outer got dropped!\0",
243243
inner: NoisyDropInner,
244-
} as Box<dyn SomeTrait>;
244+
}) as Box<dyn SomeTrait>;
245245

246246
const FUNC_REF: Option<fn()> = Some(main);
247247
match FUNC_REF {

0 commit comments

Comments
 (0)