Closed
Description
Summary
#![feature(type_alias_impl_trait)]
type Foo4 = impl Debug;
fn define4(_: Foo4) {
let y: Foo4 = 42;
}
=>
warning: this could be a `const fn`
--> a.rs:28:1
|
28 | / fn define4(_: Foo4) {
29 | | let y: Foo4 = 42;
30 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
help: make the function `const`
|
28 | const fn define4(_: Foo4) {
| +++++
=>
error[E0493]: destructor of `Foo4` cannot be evaluated at compile-time
--> a.rs:28:18
|
28 | const fn define4(_: Foo4) {
| ^ the destructor for this type cannot be evaluated in constant functions
29 | let y: Foo4 = 42;
30 | }
| - value is dropped here
error: aborting due to 1 previous error; 3 warnings emitted