]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.stderr
ty: convert `ErrorHandled::Reported` to `ConstKind::Error`.
[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:15:25
3    |
4 LL | const fn bar() -> u32 { foo() }
5    |                         ^^^^^
6    |
7    = help: add `#![feature(foo)]` to the crate attributes to enable
8
9 error[E0716]: temporary value dropped while borrowed
10   --> $DIR/dont_promote_unstable_const_fn.rs:18:28
11    |
12 LL |     let _: &'static u32 = &foo();
13    |            ------------    ^^^^^ creates a temporary which is freed while still in use
14    |            |
15    |            type annotation requires that borrow lasts for `'static`
16 LL | }
17    | - temporary value is freed at the end of this statement
18
19 error[E0716]: temporary value dropped while borrowed
20   --> $DIR/dont_promote_unstable_const_fn.rs:22:28
21    |
22 LL |     let _: &'static u32 = &meh();
23    |            ------------    ^^^^^ creates a temporary which is freed while still in use
24    |            |
25    |            type annotation requires that borrow lasts for `'static`
26 ...
27 LL | }
28    | - temporary value is freed at the end of this statement
29
30 error[E0716]: temporary value dropped while borrowed
31   --> $DIR/dont_promote_unstable_const_fn.rs:23:26
32    |
33 LL |     let x: &'static _ = &std::time::Duration::from_millis(42).subsec_millis();
34    |            ----------    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
35    |            |
36    |            type annotation requires that borrow lasts for `'static`
37 LL |
38 LL | }
39    | - temporary value is freed at the end of this statement
40
41 error: aborting due to 4 previous errors
42
43 For more information about this error, try `rustc --explain E0716`.