-
Couldn't load subscription status.
- Fork 1.8k
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't haveI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedIssue: The suggestions provided by this Lint cause an ICE/error when applied
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
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't haveI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedIssue: The suggestions provided by this Lint cause an ICE/error when applied