mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 13:06:28 +03:00
Fix duplicate const complete after raw
Example
---
```rust
fn main() { let _ = &raw $0 }
```
**Before this PR**
```text
fn main() fn()
bt u32 u32
kw const
kw const
kw crate::
...
```
**After this PR**
```text
fn main() fn()
bt u32 u32
kw const
kw crate::
...
```
This commit is contained in:
@@ -352,7 +352,10 @@ pub(crate) fn complete_expr_path(
|
||||
|
||||
if !in_block_expr {
|
||||
add_keyword("unsafe", "unsafe {\n $0\n}");
|
||||
add_keyword("const", "const {\n $0\n}");
|
||||
if !wants_const_token {
|
||||
// Avoid having two `const` items in `&raw $0`
|
||||
add_keyword("const", "const {\n $0\n}");
|
||||
}
|
||||
}
|
||||
add_keyword("match", "match $1 {\n $0\n}");
|
||||
add_keyword("while", "while $1 {\n $0\n}");
|
||||
|
||||
@@ -628,7 +628,6 @@ fn main() fn()
|
||||
fn main() fn()
|
||||
bt u32 u32
|
||||
kw const
|
||||
kw const
|
||||
kw crate::
|
||||
kw false
|
||||
kw for
|
||||
|
||||
Reference in New Issue
Block a user