rust/compiler/rustc_borrowck/src
Jacob Pratt fc4f71db68
Rollup merge of #133130 - dianne:fix-133118, r=compiler-errors
`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.
2024-11-17 22:30:49 -05:00
..
constraints Reduce visibilities. 2024-11-04 15:43:45 +11:00
diagnostics suggest_borrow_generic_arg: instantiate clauses properly 2024-11-17 18:09:36 -08:00
polonius various fixes for naked_asm! implementation 2024-10-06 19:00:09 +02:00
region_infer Get rid of check_opaque_type_well_formed 2024-11-08 03:46:27 +00:00
type_check Auto merge of #132580 - compiler-errors:globs, r=Noratrieb 2024-11-05 08:30:56 +00:00
util Add warn(unreachable_pub) to rustc_borrowck. 2024-08-16 08:46:57 +10:00
borrow_set.rs Reduce visibilities. 2024-11-04 15:43:45 +11:00
borrowck_errors.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
consumers.rs Avoid Rc in BodyWithBorrowckFacts. 2024-10-04 16:48:16 +10:00
dataflow.rs Replace BorrowckResults with Borrowck. 2024-11-05 10:18:01 +11:00
def_use.rs Rollup merge of #126013 - nnethercote:unreachable_pub, r=Urgau 2024-08-27 00:41:57 +02:00
facts.rs Dogfood feature(file_buffered) 2024-09-24 14:25:16 -07:00
lib.rs Remove ResultsVisitable. 2024-11-05 10:18:03 +11:00
location.rs Remove #[macro_use] extern crate tracing from rustc_borrowck. 2024-08-30 17:14:53 +10:00
member_constraints.rs Remove #[macro_use] extern crate tracing from rustc_borrowck. 2024-08-30 17:14:53 +10:00
nll.rs fix clippy::clone_on_ref_ptr for compiler 2024-10-28 18:05:08 +03:00
path_utils.rs compiler: Replace rustc_target with _abi in _borrowck 2024-11-02 20:31:47 -07:00
place_ext.rs Remove #[macro_use] extern crate tracing from rustc_borrowck. 2024-08-30 17:14:53 +10:00
places_conflict.rs update rustc_borrowck::places_conflict doc-comment 2024-10-10 10:33:29 +03:00
prefixes.rs Remove unnecessary continue. 2024-11-04 17:36:25 +11:00
renumber.rs Fix some pub(crate) that were undetected bc of instrument 2024-10-04 14:02:09 -04:00
session_diagnostics.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
universal_regions.rs ty::BrK -> ty::BoundRegionKind::K 2024-11-04 04:45:52 +00:00
used_muts.rs Remove unnecessary lifetimes in dataflow structs. 2024-09-09 16:14:18 +10:00