BurntSushi/quickcheck

Add support for mut bindings in function arguments

Aberta

#269 aberto em 12 de jan. de 2021

 (7 comentários) (0 reação) (0 responsável)Rust (161 forks)github user discovery
enhancementhelp wanted

Métricas do repositório

Stars
 (2.763 estrelas)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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

Guia do colaborador