Skip to content

Conversation

A4-Tacks
Copy link
Contributor

convert_integer_literal can only convert the first literal,
it is not reasonable to apply it when selected

Example

fn main() {
    $01+1$0;
}

Assist old outputs:

Convert 1 to 0b1
Convert 1 to 0o1
Convert 1 to 0x1
Replace arithmetic with call to checked_*
Replace arithmetic with call to saturating_*
Replace arithmetic with call to wrapping_*
Extract into variable
Extract into constant
Extract into static
Extract into function

Assist this PR outputs:

Replace arithmetic with call to checked_*
Replace arithmetic with call to saturating_*
Replace arithmetic with call to wrapping_*
Extract into variable
Extract into constant
Extract into static
Extract into function

`convert_integer_literal` can only convert the first literal,
it is not reasonable to apply it when selected

Example
---

```rust
fn main() {
    $01+1$0;
}
```

**Assist old outputs**:

```
Convert 1 to 0b1
Convert 1 to 0o1
Convert 1 to 0x1
Replace arithmetic with call to checked_*
Replace arithmetic with call to saturating_*
Replace arithmetic with call to wrapping_*
Extract into variable
Extract into constant
Extract into static
Extract into function
```

**Assist this PR outputs**:

```
Replace arithmetic with call to checked_*
Replace arithmetic with call to saturating_*
Replace arithmetic with call to wrapping_*
Extract into variable
Extract into constant
Extract into static
Extract into function
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 22, 2025
@A4-Tacks A4-Tacks changed the title fix: convert_integer_literal not on selected convert_integer_literal not on selected Aug 22, 2025
@ChayimFriedman2
Copy link
Contributor

Hmm... I think it does make sense to activate it if only the literal is selected. But I guess it doesn't matter a lot.

Thanks!

@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Aug 23, 2025
Merged via the queue into rust-lang:master with commit 413ed5a Aug 23, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 23, 2025
@A4-Tacks A4-Tacks deleted the fix-conv-int-lit-on-selected branch August 24, 2025 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants