]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.rs
1 #![unstable(feature = "humans",
2 reason
= "who ever let humans program computers,
3 we're apparently really bad at it",
6 #![feature(staged_api)]
8 #[stable(feature = "rust1", since = "1.0.0")]
9 #[rustc_const_unstable(feature="foo", issue = "none")]
10 const fn foo() -> u32 { 42 }
12 fn meh() -> u32 { 42 }
14 const fn bar() -> u32 { foo() }
//~ ERROR `foo` is not yet stable as a const fn
17 let _
: &'
static u32 = &foo(); //~ ERROR temporary value dropped while borrowed
21 let _
: &'
static u32 = &meh(); //~ ERROR temporary value dropped while borrowed
22 let x
: &'
static _
= &std
::time
::Duration
::from_millis(42).subsec_millis();
23 //~^ ERROR temporary value dropped while borrowed