]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/min_const_fn/min_const_fn_dyn.stderr
b6445329db383e7dcfd28088b43b9a575a1a2f56
[rust.git] / src / test / ui / consts / min_const_fn / min_const_fn_dyn.stderr
1 error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
2   --> $DIR/min_const_fn_dyn.rs:9:5
3    |
4 LL |     x.0.field;
5    |     ^^^^^^^^^
6    |
7    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
8    = help: add #![feature(const_fn)] to the crate attributes to enable
9
10 error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable
11   --> $DIR/min_const_fn_dyn.rs:12:66
12    |
13 LL | const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) }
14    |                                                                  ^^
15    |
16    = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563
17    = help: add #![feature(const_fn)] to the crate attributes to enable
18
19 warning[E0716]: temporary value dropped while borrowed
20   --> $DIR/min_const_fn_dyn.rs:12:67
21    |
22 LL | const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) }
23    |                                                                  -^    - temporary value is freed at the end of this statement
24    |                                                                  ||
25    |                                                                  |creates a temporary which is freed while still in use
26    |                                                                  cast requires that borrow lasts for `'static`
27    |
28    = warning: this error has been downgraded to a warning for backwards compatibility with previous releases
29    = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
30
31 error: aborting due to 2 previous errors
32
33 Some errors have detailed explanations: E0716, E0723.
34 For more information about an error, try `rustc --explain E0716`.