]> git.proxmox.com Git - rustc.git/blame - src/test/compile-fail/feature-gate-box-expr.rs
Imported Upstream version 1.3.0+dfsg1
[rustc.git] / src / test / compile-fail / feature-gate-box-expr.rs
CommitLineData
1a4d82fc
JJ
1// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
10
c1a9b12d
SL
11// Check that `box EXPR` is feature-gated.
12//
13// See also feature-gate-placement-expr.rs
14//
15// (Note that the two tests are separated since the checks appear to
16// be performed at distinct phases, with an abort_if_errors call
17// separating them.)
1a4d82fc 18
c1a9b12d 19fn main() {
85aaf69f 20 let x = box 'c'; //~ ERROR box expression syntax is experimental
1a4d82fc
JJ
21 println!("x: {}", x);
22
85aaf69f 23 let x = box () 'c'; //~ ERROR box expression syntax is experimental
c1a9b12d 24 //~^ WARN deprecated syntax
1a4d82fc
JJ
25 println!("x: {}", x);
26}