1
Fork 0
Commit graph

3 commits

Author SHA1 Message Date
Albert Larsan
cf2dff2b1e
Move /src/test to /tests 2023-01-11 09:32:08 +00:00
Ayaz Hafiz
0c02f8aea9
fixup! Provide suggestion to convert numeric op LHS rather than unwrapping RHS 2020-06-11 09:04:27 -07:00
Ayaz Hafiz
e243f62317
Provide suggestion to convert numeric op LHS rather than unwrapping RHS
Given a code

```rust
fn foo(x: u8, y: u32) -> bool {
    x > y
}
fn main() {}
```

it could be more helpful to provide a suggestion to do "u32::from(x)"
rather than "y.try_into().unwrap()", since the latter may panic.

We do this by passing the LHS of a binary expression up the stack into
the coercion checker.

Closes #73145
2020-06-11 09:04:24 -07:00