Fix invalid float literal suggestions when recovering an integer
Only suggest adding a zero to integers with a preceding dot when the change will result in a valid floating point literal.
For example, `.0x0` should not be turned into `0.0x0`.
r? nnethercote
Only suggest adding a zero to integers with a preceding dot when the change will
result in a valid floating point literal.
For example, `.0x0` should not be turned into `0.0x0`.
assume MIR types are fully normalized in ascribe_user_type
This FIXME was introduced in c6a17bf8bcfa60c8b0436251d2cf70d8eca4d198 but it should've been restricted to `ascribe_user_type_skip_wf`.
prevents `len_without_is_empty` from yielding positive when `len` takes arguments besides `&self`
Fixes#9520
---
changelog: FP [`len_without_is_empty`]: No longer lints, if `len` as a non-default signature
[#10255](https://github.com/rust-lang/rust-clippy/pull/10255)
<!-- changelog_checked -->
Forward the `Display` implementation for `CrateType` to
`IntoDiagnosticArg` so that it can be used in diagnostic structs.
Signed-off-by: David Wood <david.wood@huawei.com>
Implement `IntoDiagnosticArg` for `&'a T` when `T` implements
`IntoDiagnosticArg` and `Clone`. Makes it easier to write diagnostic
structs that borrow something which implements `IntoDiagnosticArg`.
Signed-off-by: David Wood <david.wood@huawei.com>
Support for emission of notes was added in f8ebc72 but `emit_note` and
`create_note` functions weren't added to `Handler`.
Signed-off-by: David Wood <david.wood@huawei.com>
Rollup of 7 pull requests
Successful merges:
- #107125 (Add and use expect methods to hir.)
- #107172 (Reimplement NormalizeArrayLen based on SsaLocals)
- #107177 (Keep all theme-updating logic together)
- #107424 (Make Vec::clone_from and slice::clone_into share the same code)
- #107455 (use a more descriptive name)
- #107465 (`has_allow_dead_code_or_lang_attr` micro refactor)
- #107469 (Change turbofish context link to an archive link)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
feat: Improve "match to let else" assist
Closes https://github.com/rust-lang/rust-analyzer/issues/13540
Handles complex `let` patterns (rather than just idents), and diverging block expressions have their `{`/`}` stripped to create nicer code.