BurntSushi/quickcheck

Add support for mut bindings in function arguments

Open

#269 aperta il 12 gen 2021

Vedi su GitHub
 (7 commenti) (0 reazioni) (0 assegnatari)Rust (161 fork)github user discovery
enhancementhelp wanted

Metriche repository

Star
 (2763 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

I noticed that this works:

fn check_int_slices(v: HashSet<u64>, lens: Vec<usize>) -> bool {
    let mut lens = lens;
    ...
}

but this doesn't:

fn check_int_slices(v: HashSet<u64>, mut lens: Vec<usize>) -> bool {
    ...
}

Error:

error: no rules expected the token `lens`
   --> src/lib.rs:797:50
    |
797 |         fn check_int_slices(v: HashSet<u64>, mut lens: Vec<usize>) -> bool {
    |                                                  ^^^^ no rules expected this token in macro call

Guida contributor