mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-01 07:48:45 +00:00
Simplify const reference check
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
parent
8d7a393008
commit
4a0821f332
1 changed files with 1 additions and 1 deletions
|
@ -17,7 +17,7 @@ fn binders_in_pat(
|
||||||
let ident = p.name()?;
|
let ident = p.name()?;
|
||||||
let ismut = p.ref_token().is_none() && p.mut_token().is_some();
|
let ismut = p.ref_token().is_none() && p.mut_token().is_some();
|
||||||
// check for const reference
|
// check for const reference
|
||||||
if !(p.is_simple_ident() && sem.resolve_bind_pat_to_const(p).is_some()) {
|
if sem.resolve_bind_pat_to_const(p).is_none() {
|
||||||
acc.push((ident, ismut));
|
acc.push((ident, ismut));
|
||||||
}
|
}
|
||||||
if let Some(inner) = p.pat() {
|
if let Some(inner) = p.pat() {
|
||||||
|
|
Loading…
Reference in a new issue