Commit c7ed41e
committed
Fix parentheses for missing_unsafe
I seem unable to use `Expr::needs_parens*` to complete it
Example
---
```rust
static mut STATIC_MUT: u8 = 0;
fn foo() -> u8 {
STATIC_MUT$0 * 2
}
```
**Before this PR**:
```rust
static mut STATIC_MUT: u8 = 0;
fn foo() -> u8 {
unsafe { STATIC_MUT } * 2
}
```
**After this PR**:
```rust
static mut STATIC_MUT: u8 = 0;
fn foo() -> u8 {
(unsafe { STATIC_MUT }) * 2
}
```1 parent 7de38d3 commit c7ed41e
File tree
1 file changed
+38
-1
lines changed- src/tools/rust-analyzer/crates/ide-diagnostics/src/handlers
1 file changed
+38
-1
lines changedLines changed: 38 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
54 | 59 | | |
55 | 60 | | |
56 | 61 | | |
| |||
112 | 117 | | |
113 | 118 | | |
114 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
115 | 131 | | |
116 | 132 | | |
117 | 133 | | |
| |||
527 | 543 | | |
528 | 544 | | |
529 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
530 | 567 | | |
531 | 568 | | |
532 | 569 | | |
| |||
0 commit comments