diff options
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/const-eval-span.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/const-fn-destructuring-arg.rs | 18 | ||||
| -rw-r--r-- | src/test/compile-fail/const-fn-stability-calls-2.rs | 2 |
3 files changed, 20 insertions, 2 deletions
diff --git a/src/test/compile-fail/const-eval-span.rs b/src/test/compile-fail/const-eval-span.rs index 8e9209916f3..3e75afcda6d 100644 --- a/src/test/compile-fail/const-eval-span.rs +++ b/src/test/compile-fail/const-eval-span.rs @@ -14,7 +14,7 @@ struct S(i32); const CONSTANT: S = S(0); -//~^ ERROR: constant evaluation error: unsupported constant expr +//~^ ERROR: constant evaluation error: non-constant path in constant expression [E0080] enum E { V = CONSTANT, diff --git a/src/test/compile-fail/const-fn-destructuring-arg.rs b/src/test/compile-fail/const-fn-destructuring-arg.rs new file mode 100644 index 00000000000..1642c041067 --- /dev/null +++ b/src/test/compile-fail/const-fn-destructuring-arg.rs @@ -0,0 +1,18 @@ +// 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. + +// test that certain things are disallowed in const fn signatures + +#![feature(const_fn)] + +// no destructuring +const fn i((a, b): (u32, u32)) -> u32 { a + b } //~ ERROR: E0022 + +fn main() {} diff --git a/src/test/compile-fail/const-fn-stability-calls-2.rs b/src/test/compile-fail/const-fn-stability-calls-2.rs index dd9a415311e..59e0db7b355 100644 --- a/src/test/compile-fail/const-fn-stability-calls-2.rs +++ b/src/test/compile-fail/const-fn-stability-calls-2.rs @@ -17,5 +17,5 @@ extern crate const_fn_lib; use const_fn_lib::foo; fn main() { - let x: [usize; foo()] = []; //~ ERROR unsupported constant expr + let x: [usize; foo()] = []; //~ ERROR non-constant path in constant expr } |
