2018-05-19 19:19:20 -05:00
|
|
|
error: `foo` is not yet stable as a const fn
|
2021-04-26 07:53:41 -05:00
|
|
|
--> $DIR/dont_promote_unstable_const_fn.rs:14:25
|
2018-05-19 19:19:20 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | const fn bar() -> u32 { foo() }
|
2018-05-19 19:19:20 -05:00
|
|
|
| ^^^^^
|
|
|
|
|
|
2018-11-26 20:59:49 -06:00
|
|
|
= help: add `#![feature(foo)]` to the crate attributes to enable
|
2018-05-19 19:19:20 -05:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2021-04-26 07:53:41 -05:00
|
|
|
--> $DIR/dont_promote_unstable_const_fn.rs:17:28
|
2018-05-19 19:19:20 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let _: &'static u32 = &foo();
|
2022-10-20 10:43:27 -05:00
|
|
|
| ------------ ^^^^^ creates a temporary value which is freed while still in use
|
2019-04-22 02:40:08 -05:00
|
|
|
| |
|
|
|
|
| type annotation requires that borrow lasts for `'static`
|
2018-05-19 19:19:20 -05:00
|
|
|
LL | }
|
2019-04-22 02:40:08 -05:00
|
|
|
| - temporary value is freed at the end of this statement
|
2018-05-19 19:19:20 -05:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2021-04-26 07:53:41 -05:00
|
|
|
--> $DIR/dont_promote_unstable_const_fn.rs:21:28
|
2018-05-19 19:19:20 -05:00
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let _: &'static u32 = &meh();
|
2022-10-20 10:43:27 -05:00
|
|
|
| ------------ ^^^^^ creates a temporary value which is freed while still in use
|
2019-04-22 02:40:08 -05:00
|
|
|
| |
|
|
|
|
| type annotation requires that borrow lasts for `'static`
|
2018-08-25 08:31:24 -05:00
|
|
|
...
|
|
|
|
LL | }
|
2019-04-22 02:40:08 -05:00
|
|
|
| - temporary value is freed at the end of this statement
|
2018-08-25 08:31:24 -05:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2021-04-26 07:53:41 -05:00
|
|
|
--> $DIR/dont_promote_unstable_const_fn.rs:22:26
|
2018-08-25 08:31:24 -05:00
|
|
|
|
|
2018-05-19 19:19:20 -05:00
|
|
|
LL | let x: &'static _ = &std::time::Duration::from_millis(42).subsec_millis();
|
2022-10-20 10:43:27 -05:00
|
|
|
| ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
|
2019-04-22 02:40:08 -05:00
|
|
|
| |
|
|
|
|
| type annotation requires that borrow lasts for `'static`
|
2019-03-09 06:03:44 -06:00
|
|
|
LL |
|
2018-05-19 19:19:20 -05:00
|
|
|
LL | }
|
2019-04-22 02:40:08 -05:00
|
|
|
| - temporary value is freed at the end of this statement
|
2018-05-19 19:19:20 -05:00
|
|
|
|
2018-08-25 08:31:24 -05:00
|
|
|
error: aborting due to 4 previous errors
|
2018-05-19 19:19:20 -05:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
For more information about this error, try `rustc --explain E0716`.
|