Skip to content

Commit ee38de5

Browse files
committed
Remove uses of box_syntax in rustc and tools
1 parent fe93911 commit ee38de5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

example/alloc_example.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(start, box_syntax, core_intrinsics, alloc_error_handler, lang_items)]
1+
#![feature(start, core_intrinsics, alloc_error_handler, lang_items)]
22
#![no_std]
33

44
extern crate alloc;
@@ -38,7 +38,7 @@ unsafe extern "C" fn _Unwind_Resume() {
3838

3939
#[start]
4040
fn main(_argc: isize, _argv: *const *const u8) -> isize {
41-
let world: Box<&str> = box "Hello World!\0";
41+
let world: Box<&str> = Box::new("Hello World!\0");
4242
unsafe {
4343
puts(*world as *const str as *const u8);
4444
}

example/mini_core_hello_world.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Adapted from https://github.com/sunfishcode/mir2cranelift/blob/master/rust-examples/nocore-hello-world.rs
22

33
#![feature(
4-
no_core, unboxed_closures, start, lang_items, box_syntax, never_type, linkage,
4+
no_core, unboxed_closures, start, lang_items, never_type, linkage,
55
extern_types, thread_local
66
)]
77
#![no_core]
@@ -163,7 +163,7 @@ fn main() {
163163
let ptr: *const u8 = hello as *const [u8] as *const u8;
164164
puts(ptr);
165165

166-
let world: Box<&str> = box "World!\0";
166+
let world: Box<&str> = Box::new("World!\0");
167167
puts(*world as *const str as *const u8);
168168
world as Box<dyn SomeTrait>;
169169

@@ -223,10 +223,10 @@ fn main() {
223223
}
224224
}
225225

226-
let _ = box NoisyDrop {
226+
let _ = Box::new(NoisyDrop {
227227
text: "Boxed outer got dropped!\0",
228228
inner: NoisyDropInner,
229-
} as Box<dyn SomeTrait>;
229+
}) as Box<dyn SomeTrait>;
230230

231231
const FUNC_REF: Option<fn()> = Some(main);
232232
#[allow(unreachable_code)]

example/mod_bench.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(start, box_syntax, core_intrinsics, lang_items)]
1+
#![feature(start, core_intrinsics, lang_items)]
22
#![no_std]
33

44
#[link(name = "c")]

0 commit comments

Comments
 (0)