From a61490c5bdf8f3bad54d374130b6808dc6ea31d7 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Tue, 9 Jun 2015 14:57:28 +0200 Subject: [PATCH] revert back to the old syntax while landing the protocol alone. --- src/liballoc/boxed.rs | 6 ++++-- src/test/compile-fail/feature-gate-box-expr.rs | 2 +- src/test/debuginfo/box.rs | 5 ++++- src/test/run-pass/new-box-syntax.rs | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index e22c73861ce30..107c4decedc38 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -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; /// } /// ``` diff --git a/src/test/compile-fail/feature-gate-box-expr.rs b/src/test/compile-fail/feature-gate-box-expr.rs index a0183d5f73c36..dee28176e60d6 100644 --- a/src/test/compile-fail/feature-gate-box-expr.rs +++ b/src/test/compile-fail/feature-gate-box-expr.rs @@ -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); } diff --git a/src/test/debuginfo/box.rs b/src/test/debuginfo/box.rs index f7deb05522ee2..896b628b4d90f 100644 --- a/src/test/debuginfo/box.rs +++ b/src/test/debuginfo/box.rs @@ -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 } diff --git a/src/test/run-pass/new-box-syntax.rs b/src/test/run-pass/new-box-syntax.rs index 40216bf4a652b..63496816c8c48 100644 --- a/src/test/run-pass/new-box-syntax.rs +++ b/src/test/run-pass/new-box-syntax.rs @@ -27,7 +27,7 @@ struct Structure { } pub fn main() { - // XXX + // FIXME (#22181) put back when new placement-in syntax is supported // let x: Box = in HEAP { 2 }; let y: Box = box 2; let b: Box = box () (1 + 2);