about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src/handle_placeholders.rs
AgeCommit message (Collapse)AuthorLines
2025-09-18Clean up universe evaluation during type test evaluationAmanda Stjerna-7/+3
The logic was, as the removed comments suggest, hackish and meant to implement previous logic that was factored out. The new logic does exactly what the comments say, and is much less surprising.
2025-08-23Simplify SCC annotations somewhatAmanda Stjerna-11/+7
2025-08-22Region inference: Use outlives-static constraints in constraint searchAmanda Stjerna-62/+150
Revise the extra `r: 'static` constraints added upon universe issues to add an explanation, and use that explanation during constraint blame search. This greatly simplifies the region inference logic, which now does not need to reverse-engineer the event that caused a region to outlive 'static.
2025-08-20handle opaque types before region inferencelcnr-8/+4
2025-08-15Auto merge of #142071 - lcnr:revealing-use, r=compiler-errorsbors-0/+4
`apply_member_constraints`: fix placeholder check Checking whether the member region is *an existential region from a higher universe* is just wrong and I am pretty sure we've added that check by accident as the naming was just horribly confusing before rust-lang/rust#140466. I've encountered this issue separately while working on rust-lang/rust#139587, but feel like it's probably easier to separately FCP this change. This allows the following code to compile ```rust trait Proj<'a> { type Assoc; } impl<'a, 'b, F: FnOnce() -> &'b ()> Proj<'a> for F { type Assoc = (); } fn is_proj<F: for<'a> Proj<'a>>(f: F) {} fn define<'a>() -> impl Sized + use<'a> { // This adds a use of `opaque::<'a>` with hidden type `&'unconstrained_b ()`. // 'unconstrained_b is an inference variable from a higher universe as it gets // created inside of the binder of `F: for<'a> Proj<'a>`. This previously // caused us to not apply member constraints. We now do, constraining // it to `'a`. is_proj(define::<'a>); &() } fn main() {} ``` This should not be breaking change, even in theory. Applying member constraints is incomplete in rare circumstances which means that applying them in more cases can cause spurious errors, cc rust-lang/rust#140569/rust-lang/rust#142073. However, as we always skipped these member regions in `apply_member_constraints` the skipped region is guaranteed to cause an error in `check_member_constraints` later on.
2025-08-11remove `from_forall`lcnr-1/+1
2025-08-09Rollup merge of #145115 - lcnr:less-borrowck-tainting, r=compiler-errorsStuart Cook-12/+1
defer opaque type errors, generally greatly reduce tainting fixes the test for rust-lang/rust#135528, does not actually fix that issue properly. This is useful as it causes the migration to rust-lang/rust#139587 to be a lot easier.
2025-08-08borrowck: move error tainting earlierlcnr-12/+1
2025-08-08apply_member_constraints: fix placeholder checklcnr-0/+4
2025-08-06Track names of existentialsAmanda Stjerna-1/+1
2025-06-04Use an enum for SCC representatives, plus other code reviewAmanda Stjerna-0/+348
Co-authored-by: lcnr <rust@lcnr.de>