]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/rustc-args-required-const.rs
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / rustc-args-required-const.rs
index 35b43b4c460a428165b4613d94001a227185eb8f..87f979f1b2789230c7b04e95a503bced4a62a5e2 100644 (file)
@@ -1,13 +1,3 @@
-// Copyright 2018 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.
-
 #![feature(rustc_attrs, const_fn)]
 
 #[rustc_args_required_const(0)]
@@ -27,7 +17,8 @@ const fn baz() -> i32 {
 fn main() {
     foo(2);
     foo(2 + 3);
-    foo(baz());
+    const BAZ: i32 = baz();
+    foo(BAZ);
     let a = 4;
     foo(A);
     foo(a); //~ ERROR: argument 1 is required to be a constant