Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic associated consts: Check regions earlier when comparing impl with trait item def #123898

Merged
merged 1 commit into from
Apr 14, 2024

Conversation

fmease
Copy link
Member

@fmease fmease commented Apr 13, 2024

Fixes #123836.

r? compiler-errors or compiler

@fmease fmease added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. F-generic_const_items `#![feature(generic_const_items)]` labels Apr 13, 2024
@compiler-errors
Copy link
Member

r=me

@@ -1886,8 1886,6 @@ fn compare_type_predicate_entailment<'tcx>(
let impl_ty_predicates = tcx.predicates_of(impl_ty.def_id);
let trait_ty_predicates = tcx.predicates_of(trait_ty.def_id);

check_region_bounds_on_impl_item(tcx, impl_ty, trait_ty, false)?;
Copy link
Member Author

Choose a reason for hiding this comment

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

There was no need to move this one out of compare_type_predicate_entailment except consistency with both compare_{method,const}_predicate_entailment which is reason enough imo.

@@ -1763,8 1764,6 @@ fn compare_const_predicate_entailment<'tcx>(
let impl_ct_predicates = tcx.predicates_of(impl_ct.def_id);
let trait_ct_predicates = tcx.predicates_of(trait_ct.def_id);

check_region_bounds_on_impl_item(tcx, impl_ct, trait_ct, false)?;
Copy link
Member Author

Choose a reason for hiding this comment

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

On lifetime param mismatches, we ICE'd in tcx.type_of(trait_ct.def_id).instantiate(tcx, trait_to_impl_args) a few lines further up for obvious reasons. That's on me, I messed that up in the initial GCI PR.

@fmease fmease changed the title Check regions earlier when comparing impl with trait item def Generic associated consts: Check regions earlier when comparing impl with trait item def Apr 13, 2024
@fmease
Copy link
Member Author

fmease commented Apr 13, 2024

@bors r=compiler-errors rollup

@bors
Copy link
Contributor

bors commented Apr 13, 2024

📌 Commit dfbdce0 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors 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 Apr 13, 2024
@rust-lang rust-lang deleted a comment from bors Apr 13, 2024
@rust-lang rust-lang deleted a comment from bors Apr 13, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 14, 2024
…, r=compiler-errors

Generic associated consts: Check regions earlier when comparing impl with trait item def

Fixes rust-lang#123836.

r? compiler-errors or compiler
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 14, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#123651 (Thread local updates for idiomatic examples)
 - rust-lang#123699 (run-make-support: tidy up support library)
 - rust-lang#123779 (OpenBSD fix long socket addresses)
 - rust-lang#123803 (Fix `VecDeque::shrink_to` UB when `handle_alloc_error` unwinds.)
 - rust-lang#123875 (Doc: replace x with y for hexa-decimal fmt)
 - rust-lang#123879 (Add missing `unsafe` to some internal `std` functions)
 - rust-lang#123889 (reduce tidy overheads in run-make checks)
 - rust-lang#123898 (Generic associated consts: Check regions earlier when comparing impl with trait item def)
 - rust-lang#123902 (compiletest: Update rustfix to 0.8.1)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 14, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#123651 (Thread local updates for idiomatic examples)
 - rust-lang#123699 (run-make-support: tidy up support library)
 - rust-lang#123779 (OpenBSD fix long socket addresses)
 - rust-lang#123875 (Doc: replace x with y for hexa-decimal fmt)
 - rust-lang#123879 (Add missing `unsafe` to some internal `std` functions)
 - rust-lang#123889 (reduce tidy overheads in run-make checks)
 - rust-lang#123898 (Generic associated consts: Check regions earlier when comparing impl with trait item def)
 - rust-lang#123902 (compiletest: Update rustfix to 0.8.1)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 20656d9 into rust-lang:master Apr 14, 2024
11 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 14, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 14, 2024
Rollup merge of rust-lang#123898 - fmease:gci-cmp-impl-item-lt-params, r=compiler-errors

Generic associated consts: Check regions earlier when comparing impl with trait item def

Fixes rust-lang#123836.

r? compiler-errors or compiler
@fmease fmease deleted the gci-cmp-impl-item-lt-params branch April 14, 2024 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-generic_const_items `#![feature(generic_const_items)]` 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.

ICE : Region parameter out of range when instantiating in region
4 participants