Skip to content

Commit

Permalink
revert back to the old syntax while landing the protocol alone.
Browse files Browse the repository at this point in the history
  • Loading branch information
pnkfelix committed Jul 16, 2015
1 parent afd9b94 commit a61490c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,21 @@ use core::ops::{Placer, Boxed, Place, InPlace, BoxPlace};
use core::ptr::{Unique};
use core::raw::{TraitObject};

// FIXME (#22181): Put in the new placement-in syntax once that lands.

/// A value that represents the heap. This is the place that the `box`
/// keyword allocates into.
///
/// The following two examples are equivalent:
///
/// ```
/// # #![feature(box_heap)]
/// # #![feature(box_heap, core)]
/// #![feature(box_syntax)]
/// #![feature(placement_in_syntax)]
/// use std::boxed::HEAP;
///
/// fn main() {
/// let foo = in HEAP { 5 };
/// let foo = box (HEAP) { 5 };
/// let foo: Box<_> = box 5;
/// }
/// ```
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/feature-gate-box-expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn main() {
let x: Box<_> = box (HEAP) 'c'; //~ ERROR placement-in expression syntax is experimental
println!("x: {}", x);

// XXX
// FIXME (#22181) put back when new placement-in syntax is supported
// let x = in HEAP { 'c' };
// println!("x: {}", x);
}
5 changes: 4 additions & 1 deletion src/test/debuginfo/box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@
#![allow(unused_variables)]
#![feature(box_syntax)]
#![feature(placement_in_syntax)]
// both needed for HEAP use for some reason
#![feature(core, alloc)]
#![omit_gdb_pretty_printer_section]

use std::boxed::HEAP;

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

zzz(); // #break
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/new-box-syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct Structure {
}

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

0 comments on commit a61490c

Please sign in to comment.