1 // Copyright 2018 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.
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.
11 #![feature(attr_literals, rustc_attrs, const_fn)]
13 #[rustc_args_required_const(0)]
17 #[rustc_args_required_const(1)]
18 fn bar(_a: i32, _b: i32) {
23 const fn baz() -> i32 {
33 foo(a); //~ ERROR: argument 1 is required to be a constant
35 bar(a, a); //~ ERROR: argument 2 is required to be a constant