Skip to content

Conversation

@amandasystems
Copy link
Contributor

@amandasystems amandasystems commented Jan 30, 2026

This folds the call to region_from_element into RegionInferenceContext, and simplifies the error variant for this case to only talk about regions as opposed to elements. This is the only case where a RegionElement leaks out of region inference, so now they can be considered internal to region inference (though that currently isn't expressed). It also clarifies the type information on the methods called to emphasise the fact that they only ever use placeholder regions in the diagnostics completely ignore any other element.

It also adds a bunch of FIXMEs to some fishy statements that conjure universes from what seems like arbitrary integers.

This was lifted from #142623.

r? @lcnr

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 30, 2026
@amandasystems amandasystems changed the title Borrowck: simplify diagnostics for placeholders. Borrowck: simplify diagnostics for placeholders Jan 30, 2026
Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rust-log-analyzer

This comment has been minimized.

@amandasystems
Copy link
Contributor Author

r=me after nit

View changes since this review

I should have addressed it now! The test failure seems spurious to me.

@lcnr lcnr closed this Feb 10, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 10, 2026
@lcnr lcnr reopened this Feb 10, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 10, 2026
@lcnr
Copy link
Contributor

lcnr commented Feb 10, 2026

pls squash commits

@bors delegate+

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 10, 2026

✌️ @amandasystems, you can now approve this pull request!

If @lcnr told you to "r=me" after making some further change, then please make that change and post @bors r=lcnr.

This essentially folds the call to `region_from_element` into `RegionInferenceContext`,
and simplifies the error variant for this case. It also clarifies the type
information on the methods called to emphasise the fact that they only ever use
placeholder regions in the diagnostics, and completely ignore any other element.
@amandasystems amandasystems force-pushed the streamline-borrow-error-handling branch from a6d3841 to f53eed5 Compare February 10, 2026 18:40
@amandasystems
Copy link
Contributor Author

@bors r=lcnr

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 10, 2026

📌 Commit f53eed5 has been approved by lcnr

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 10, 2026
Zalathar added a commit to Zalathar/rust that referenced this pull request Feb 11, 2026
…ror-handling, r=lcnr

Borrowck: simplify diagnostics for placeholders

This folds the call to `region_from_element` into `RegionInferenceContext`, and simplifies the error variant for this case to only talk about regions as opposed to elements. This is the only case where a `RegionElement` leaks out of region inference, so now they can be considered internal to region inference (though that currently isn't expressed). It also clarifies the type information on the methods called to emphasise the fact that they only ever use placeholder regions in the diagnostics completely ignore any other element.

It also adds a bunch of FIXMEs to some fishy statements that conjure universes from what seems like arbitrary integers.

This was lifted from rust-lang#142623.

r? @lcnr
Zalathar added a commit to Zalathar/rust that referenced this pull request Feb 11, 2026
…ror-handling, r=lcnr

Borrowck: simplify diagnostics for placeholders

This folds the call to `region_from_element` into `RegionInferenceContext`, and simplifies the error variant for this case to only talk about regions as opposed to elements. This is the only case where a `RegionElement` leaks out of region inference, so now they can be considered internal to region inference (though that currently isn't expressed). It also clarifies the type information on the methods called to emphasise the fact that they only ever use placeholder regions in the diagnostics completely ignore any other element.

It also adds a bunch of FIXMEs to some fishy statements that conjure universes from what seems like arbitrary integers.

This was lifted from rust-lang#142623.

r? @lcnr
Zalathar added a commit to Zalathar/rust that referenced this pull request Feb 12, 2026
…ror-handling, r=lcnr

Borrowck: simplify diagnostics for placeholders

This folds the call to `region_from_element` into `RegionInferenceContext`, and simplifies the error variant for this case to only talk about regions as opposed to elements. This is the only case where a `RegionElement` leaks out of region inference, so now they can be considered internal to region inference (though that currently isn't expressed). It also clarifies the type information on the methods called to emphasise the fact that they only ever use placeholder regions in the diagnostics completely ignore any other element.

It also adds a bunch of FIXMEs to some fishy statements that conjure universes from what seems like arbitrary integers.

This was lifted from rust-lang#142623.

r? @lcnr
rust-bors bot pushed a commit that referenced this pull request Feb 12, 2026
Rollup of 17 pull requests

Successful merges:

 - #142415 (Add note when inherent impl for a alias type defined outside of the crate)
 - #142680 (Fix passing/returning structs with the 64-bit SPARC ABI)
 - #150768 (Don't compute FnAbi for LLVM intrinsics in backends)
 - #151152 (Add FCW for derive helper attributes that will conflict with built-in attributes)
 - #151814 (layout: handle rigid aliases without params)
 - #151863 (Borrowck: simplify diagnostics for placeholders)
 - #152159 (Add note for `?Sized` params in int-ptr casts diag)
 - #152434 (Clarify names of `QueryVTable` functions for "executing" a query)
 - #152478 (Remove tm_factory field from CodegenContext)
 - #152498 (Partially revert "resolve: Update `NameBindingData::vis` in place")
 - #152316 (fix: add continue)
 - #152394 (Correctly check if a macro call is actually a macro call in rustdoc highlighter)
 - #152425 (Port #![test_runner] to the attribute parser)
 - #152481 (Use cg_ssa's produce_final_output_artifacts in cg_clif)
 - #152485 (fix issue#152482)
 - #152495 (Clean up some subdiagnostics)
 - #152502 (Implement `BinaryHeap::from_raw_vec`)
@rust-bors rust-bors bot merged commit e4375da into rust-lang:main Feb 12, 2026
11 checks passed
rust-timer added a commit that referenced this pull request Feb 12, 2026
Rollup merge of #151863 - amandasystems:streamline-borrow-error-handling, r=lcnr

Borrowck: simplify diagnostics for placeholders

This folds the call to `region_from_element` into `RegionInferenceContext`, and simplifies the error variant for this case to only talk about regions as opposed to elements. This is the only case where a `RegionElement` leaks out of region inference, so now they can be considered internal to region inference (though that currently isn't expressed). It also clarifies the type information on the methods called to emphasise the fact that they only ever use placeholder regions in the diagnostics completely ignore any other element.

It also adds a bunch of FIXMEs to some fishy statements that conjure universes from what seems like arbitrary integers.

This was lifted from #142623.

r? @lcnr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants