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
At first missing_const_for_fn wants me to annotate this test:
#[test]fnselective(){// we set mutation chance to 1 to guarantee itlet swap = Swap::new(1.0);let remove = Remove::new(1.0,1.try_into().unwrap());let combination = Combination::selective().and(swap).and(remove);letmut rng = SmallRng::seed_from_u64(0);letmut array = vec![0_u8,1,2,3,4];
combination.mutate(&mut array,&mut rng);// only the remove mutation ran and removed 2assert_eq!(array,[0,1,3,4]);}
Clippy
error: this could be a `const fn`
--> src/operators/mutation/combination.rs:156:5
|
156 | / fn random() {
157 | | // we set mutation chance to 1 to guarantee it
158 | | let add = Add::new(1.0, None);
159 | |
... |
171 | | assert_eq!(array, [229, 0, 1, 237, 3, 4]);
172 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
= note: `-D clippy::missing-const-for-fn` implied by `-D clippy::nursery`
error: this could be a `const fn`
--> src/operators/mutation/combination.rs:175:5
|
175 | / fn selective() {
176 | | // we set mutation chance to 1 to guarantee it
177 | | let swap = Swap::new(1.0);
178 | |
... |
189 | | assert_eq!(array, [0, 1, 3, 4]);
190 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
error: could not compile `meiosis` due to 2 previous errors
First of, annotating a test with that lint already sounds wrong to me. I figured "okay, I need this to be clippy-clean now" so I simply added the allow to the test and I ended up with the error output you see below. Same result if I add it to the test module itself.
If I figure out how to reduce this I may add a comment later, but I'm rather busy at the moment :/
EDIT: Okay I've tried around a bit and the moment I touch anything or try to remove generic parameters it just doesn't trigger anymore. Am really unsure how to minimize this.
EDIT 2: Currently letting DustMite have a go to see if it can reduce this for me.
EDIT 3: It's still running. Once I get it down to a reasonable level I'll either post the code or a tarball.
Also, apologies if there is already an issue to this, but I tried my best and couldn't find one.
Summary
At first
missing_const_for_fn
wants me to annotate this test:Clippy
First of, annotating a test with that lint already sounds wrong to me. I figured "okay, I need this to be clippy-clean now" so I simply added the
allow
to the test and I ended up with the error output you see below. Same result if I add it to the test module itself.I could not produce a minimal verifiable example as I'm a bit unsure how to do that in this case, however removing
let combination = Combination::selective().and(swap).and(remove);
stops triggering it. The permalink to the file in its current state is here: https://gitlab.com/bit-refined/meiosis/-/blob/d1dda3873a6e64e2f67792075f393ed18dd00315/src/operators/mutation/combination.rs#L177If I figure out how to reduce this I may add a comment later, but I'm rather busy at the moment :/
EDIT: Okay I've tried around a bit and the moment I touch anything or try to remove generic parameters it just doesn't trigger anymore. Am really unsure how to minimize this.
EDIT 2: Currently letting
DustMite
have a go to see if it can reduce this for me.EDIT 3: It's still running. Once I get it down to a reasonable level I'll either post the code or a tarball.
Also, apologies if there is already an issue to this, but I tried my best and couldn't find one.
Version
Error output
Backtrace
The text was updated successfully, but these errors were encountered: