mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
fc4f71db68
`suggest_borrow_generic_arg`: instantiate clauses properly This simplifies and fixes the way `suggest_borrow_generic_arg` instantiates callees' predicates when testing them to see if a moved argument can instead be borrowed. Previously, it would ICE if the moved argument's type included a region variable, since it was getting passed to a call of `EarlyBinder::instantiate`. This makes the instantiation much more straightforward, which also fixes the ICE. Fixes #133118 This also modifies `tests/ui/moves/moved-value-on-as-ref-arg.rs` to have more useful bounds on the tests for suggestions to borrow `Borrow` and `BorrowMut` arguments. With its old tautological `T: BorrowMut<T>` bound, this fix would make it suggest a shared borrow for that argument. |
||
---|---|---|
.. | ||
constraints | ||
diagnostics | ||
polonius | ||
region_infer | ||
type_check | ||
util | ||
borrow_set.rs | ||
borrowck_errors.rs | ||
consumers.rs | ||
dataflow.rs | ||
def_use.rs | ||
facts.rs | ||
lib.rs | ||
location.rs | ||
member_constraints.rs | ||
nll.rs | ||
path_utils.rs | ||
place_ext.rs | ||
places_conflict.rs | ||
prefixes.rs | ||
renumber.rs | ||
session_diagnostics.rs | ||
universal_regions.rs | ||
used_muts.rs |