rust/compiler/rustc_borrowck/src
bors a707f40107 Auto merge of #95819 - oli-obk:mir_can't_hold_all_these_lifetimes, r=estebank
Enforce Copy bounds for repeat elements while considering lifetimes

fixes https://github.com/rust-lang/rust/issues/95477

this is a breaking change in order to fix a soundness bug.

Before this PR we only checked whether the repeat element type had an `impl Copy`, but not whether that impl also had the appropriate lifetimes. E.g. if the impl was for `YourType<'static>` and not a general `'a`, then copying any type other than a `'static` one should have been rejected, but wasn't.

r? `@lcnr`
2022-04-29 20:00:47 +00:00
..
constraints Make the lifetime accurate which is used in the region constraints part 2022-04-22 20:05:39 +08:00
diagnostics errors: span_suggestion takes impl ToString 2022-04-29 02:05:20 +01:00
region_infer Add an explicit Span field to OutlivesConstraint 2022-04-19 23:42:20 -04:00
type_check Check that repeat expression elements are Copy (ignoring lifetimes) in typeck and that they are Copy (with proper lifetime checks) in borrowck 2022-04-28 09:19:42 +00:00
borrow_set.rs Remove in_band_lifetimes from borrowck 2021-12-15 08:39:21 +01:00
borrowck_errors.rs span: move MultiSpan 2022-04-05 07:01:00 +01:00
constraint_generation.rs Overhaul RegionKind and Region. 2022-02-15 16:08:52 +11:00
consumers.rs Add InferCtxt::with_opaque_type_inference to get_body_with_borrowck_facts 2021-10-06 19:07:56 -07:00
dataflow.rs Add new Deinit statement kind 2022-04-11 08:55:03 -04:00
def_use.rs Add new MutatatingUseContexts for deinit and SetDiscriminant 2022-04-11 09:26:26 -04:00
facts.rs Move the dataflow framework to its own crate. 2021-09-07 19:57:07 +02:00
invalidation.rs Add new Deinit statement kind 2022-04-11 08:55:03 -04:00
lib.rs Add new Deinit statement kind 2022-04-11 08:55:03 -04:00
location.rs add #[rustc_pass_by_value] to more types 2022-03-08 15:39:52 +01:00
member_constraints.rs Remove in_band_lifetimes from borrowck 2021-12-15 08:39:21 +01:00
nll.rs Report opaque type mismatches directly during borrowck of the function instead of within the type_of query. 2022-04-07 13:39:52 +00:00
path_utils.rs Remove in_band_lifetimes from borrowck 2021-12-15 08:39:21 +01:00
place_ext.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
places_conflict.rs 3 - Make more use of let_chains 2022-02-27 11:10:20 -03:00
prefixes.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
renumber.rs Overhaul Const. 2022-02-15 16:19:59 +11:00
universal_regions.rs Store LocalDefId in is_late_bound_map. 2022-04-10 13:36:06 +02:00
used_muts.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00