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
this could be a `const fn`
for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
`-D clippy::missing-const-for-fn` implied by `-D clippy::nursery`
to override `-D clippy::nursery` add `#[allow(clippy::missing_const_for_fn)]`clippy[Click for full compiler diagnostic](rust-analyzer-diagnostics-view:/diagnostic%20message%20[6]?6#
main.rs(23, 4): make the function `const`: ` const`
Adding const to the fn do_something makes the code not to compile.
Summary
A false positive happens when using a DerefMut and changing the inner deref'ed value.
Might be a duplicate of #14020, but the setup is different.
Reproducer
I tried this code:
while Cargo.toml has the following configuration:
this happened:
Adding const to the
fn do_something
makes the code not to compile.Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: