rust/compiler/rustc_borrowck
dianne 2ab8480605 Suggest borrowing arguments in generic positions when trait bounds are satisfied
This subsumes the suggestions to borrow arguments with `AsRef`/`Borrow` bounds and those to borrow
arguments with `Fn` and `FnMut` bounds. It works for other traits implemented on references as well,
such as `std::io::Read`, `std::io::Write`, and `core::fmt::Write`.

Incidentally, by making the logic for suggesting borrowing closures general, this removes some
spurious suggestions to mutably borrow `FnMut` closures in assignments, as well as an unhelpful
suggestion to add a `Clone` constraint to an `impl Fn` argument.
2024-11-13 20:29:40 -08:00
..
src Suggest borrowing arguments in generic positions when trait bounds are satisfied 2024-11-13 20:29:40 -08:00
Cargo.toml compiler: Replace rustc_target with _abi in _borrowck 2024-11-02 20:31:47 -07:00
messages.ftl Begin experimental support for pin reborrowing 2024-09-18 12:36:31 -07:00