Skip to content

Commit a61490c

Browse files
committed
revert back to the old syntax while landing the protocol alone.
1 parent afd9b94 commit a61490c

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

src/liballoc/boxed.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,21 @@ use core::ops::{Placer, Boxed, Place, InPlace, BoxPlace};
6868
use core::ptr::{Unique};
6969
use core::raw::{TraitObject};
7070

71+
// FIXME (#22181): Put in the new placement-in syntax once that lands.
72+
7173
/// A value that represents the heap. This is the place that the `box`
7274
/// keyword allocates into.
7375
///
7476
/// The following two examples are equivalent:
7577
///
7678
/// ```
77-
/// # #![feature(box_heap)]
79+
/// # #![feature(box_heap, core)]
7880
/// #![feature(box_syntax)]
7981
/// #![feature(placement_in_syntax)]
8082
/// use std::boxed::HEAP;
8183
///
8284
/// fn main() {
83-
/// let foo = in HEAP { 5 };
85+
/// let foo = box (HEAP) { 5 };
8486
/// let foo: Box<_> = box 5;
8587
/// }
8688
/// ```

src/test/compile-fail/feature-gate-box-expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn main() {
2020
let x: Box<_> = box (HEAP) 'c'; //~ ERROR placement-in expression syntax is experimental
2121
println!("x: {}", x);
2222

23-
// XXX
23+
// FIXME (#22181) put back when new placement-in syntax is supported
2424
// let x = in HEAP { 'c' };
2525
// println!("x: {}", x);
2626
}

src/test/debuginfo/box.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,16 @@
3333
#![allow(unused_variables)]
3434
#![feature(box_syntax)]
3535
#![feature(placement_in_syntax)]
36+
// both needed for HEAP use for some reason
37+
#![feature(core, alloc)]
3638
#![omit_gdb_pretty_printer_section]
3739

3840
use std::boxed::HEAP;
3941

4042
fn main() {
4143
let a: Box<_> = box 1;
42-
let b = in HEAP { (2, 3.5f64) };
44+
// FIXME (#22181): Put in the new placement-in syntax once that lands.
45+
let b = box (HEAP) { (2, 3.5f64) };
4346

4447
zzz(); // #break
4548
}

src/test/run-pass/new-box-syntax.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct Structure {
2727
}
2828

2929
pub fn main() {
30-
// XXX
30+
// FIXME (#22181) put back when new placement-in syntax is supported
3131
// let x: Box<isize> = in HEAP { 2 };
3232
let y: Box<isize> = box 2;
3333
let b: Box<isize> = box () (1 + 2);

0 commit comments

Comments
 (0)