about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authordianne <diannes.gm@gmail.com>2024-10-23 01:32:12 -0700
committerdianne <diannes.gm@gmail.com>2024-11-13 20:29:40 -0800
commit2ab848060527f50a02cda91b9b8d98df6eb7ceab (patch)
treeff5eb399e3f97cad6db1968aa905ed802e0631ca /compiler/rustc_codegen_llvm/src
parentea37000b565021086c560f3fd881508bfed6f531 (diff)
downloadrust-2ab848060527f50a02cda91b9b8d98df6eb7ceab.tar.gz
rust-2ab848060527f50a02cda91b9b8d98df6eb7ceab.zip
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.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions