You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[missing_const_for_fn] does not take into account whether receiver is ~const Destruct #10617
missing_const_for_fn does not taike into account whether receiver is ~const Destruct.
Lint Name
missing_const_for_fn
Reproducer
I tried this code:
#![warn(clippy::missing_const_for_fn)]pubstructIdentifier(String);implIdentifier{#[must_use = "If you don't use it, it will drop entire String"]pubfnname(self) -> String{self.0}}
I saw this happen:
warning: this could be a `const fn`
--> src/lib.rs:7:5
|
7 | / pub fn name(self) -> String {
8 | | self.0
9 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
changed the title [-][`missing_const_for_fn`] does not taike into account whether receiver is `~const Destruct`[/-][+][`missing_const_for_fn`] does not take into account whether receiver is `~const Destruct`[/+]on Apr 10, 2023
Activity
[-][`missing_const_for_fn`] does not taike into account whether receiver is `~const Destruct`[/-][+][`missing_const_for_fn`] does not take into account whether receiver is `~const Destruct`[/+]KisaragiEffective commentedon Apr 12, 2023
@rustbot label +I-suggestion-causes-error
Auto merge of #10891 - Centri3:missing_const_for_fn, r=Jarcho