Test that box syntax, both in expressions and patterns, is caught by

feature gate net.

fix typo in my feature-gate-box-expr.rs test.
This commit is contained in:
Felix S. Klock II 2015-01-07 23:03:22 +01:00
parent c52486df31
commit b57b0e0f3a
2 changed files with 37 additions and 0 deletions

View file

@ -0,0 +1,23 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn main() {
use std::boxed::HEAP;
let x = box 'c'; //~ ERROR box expression syntax is experimental in alpha release
println!("x: {}", x);
let x = box () 'c'; //~ ERROR box expression syntax is experimental in alpha release
println!("x: {}", x);
let x = box (HEAP) 'c'; //~ ERROR box expression syntax is experimental in alpha release
println!("x: {}", x);
}

View file

@ -0,0 +1,14 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn main() {
let box x = Box::new('c'); //~ ERROR box pattern syntax is experimental in alpha release
println!("x: {}", x);
}