Commit 058e2d2
committed
Auto merge of rust-lang#14925 - viktorlott:inline-const-expr-as-static-str, r=HKalbasi
feat: inline const as literal
Assist: inline_const_as_literal
Evaluate and inline const variable as literal.
```rust
const STRING: &str = "Hello, World!";
fn something() -> &'static str {
STR$0ING
}
```
->
```rust
const STRING: &str = "Hello, World!";
fn something() -> &'static str {
"Hello, World!"
}
```File tree
5 files changed
+754
-2
lines changed- crates
- hir/src
- ide-assists/src
- handlers
- tests
5 files changed
+754
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3494 | 3494 | | |
3495 | 3495 | | |
3496 | 3496 | | |
| 3497 | + | |
| 3498 | + | |
| 3499 | + | |
| 3500 | + | |
| 3501 | + | |
| 3502 | + | |
| 3503 | + | |
| 3504 | + | |
3497 | 3505 | | |
3498 | 3506 | | |
3499 | 3507 | | |
| |||
0 commit comments