]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.stderr
Various minor/cosmetic improvements to code
[rust.git] / src / test / ui / consts / const-eval / dont_promote_unstable_const_fn.stderr
1 error: `foo` is not yet stable as a const fn
2   --> $DIR/dont_promote_unstable_const_fn.rs:25:25
3    |
4 LL | const fn bar() -> u32 { foo() } //~ ERROR `foo` is not yet stable as a const fn
5    |                         ^^^^^
6    |
7    = help: add `#![feature(foo)]` to the crate attributes to enable
8
9 error[E0597]: borrowed value does not live long enough
10   --> $DIR/dont_promote_unstable_const_fn.rs:28:28
11    |
12 LL |     let _: &'static u32 = &foo(); //~ ERROR does not live long enough
13    |                            ^^^^^ temporary value does not live long enough
14 LL | }
15    | - temporary value only lives until here
16    |
17    = note: borrowed value must be valid for the static lifetime...
18
19 error[E0597]: borrowed value does not live long enough
20   --> $DIR/dont_promote_unstable_const_fn.rs:32:28
21    |
22 LL |     let _: &'static u32 = &meh(); //~ ERROR does not live long enough
23    |                            ^^^^^ temporary value does not live long enough
24 ...
25 LL | }
26    | - temporary value only lives until here
27    |
28    = note: borrowed value must be valid for the static lifetime...
29
30 error[E0597]: borrowed value does not live long enough
31   --> $DIR/dont_promote_unstable_const_fn.rs:33:26
32    |
33 LL |     let x: &'static _ = &std::time::Duration::from_millis(42).subsec_millis();
34    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
35 LL |     //~^ ERROR does not live long enough
36 LL | }
37    | - temporary value only lives until here
38    |
39    = note: borrowed value must be valid for the static lifetime...
40
41 error: aborting due to 4 previous errors
42
43 For more information about this error, try `rustc --explain E0597`.