Skip to content

Fix next-solver ICE on PointeeSized goals#151962

Merged
rust-bors[bot] merged 3 commits intorust-lang:mainfrom
TaKO8Ki:pointee-sized-next-solver-ice
Mar 2, 2026
Merged

Fix next-solver ICE on PointeeSized goals#151962
rust-bors[bot] merged 3 commits intorust-lang:mainfrom
TaKO8Ki:pointee-sized-next-solver-ice

Conversation

@TaKO8Ki
Copy link
Member

@TaKO8Ki TaKO8Ki commented Feb 1, 2026

Fixes #151957

@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 Feb 1, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 1, 2026

r? @mati865

rustbot has assigned @mati865.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot

This comment has been minimized.

@TaKO8Ki TaKO8Ki force-pushed the pointee-sized-next-solver-ice branch from 5342488 to 5bd2b85 Compare February 1, 2026 18:22
@mati865
Copy link
Member

mati865 commented Feb 3, 2026

@rustbot reroll

@rustbot rustbot assigned SparrowLii and unassigned mati865 Feb 3, 2026
@TaKO8Ki
Copy link
Member Author

TaKO8Ki commented Feb 17, 2026

r? compiler

@rustbot rustbot assigned jieyouxu and unassigned SparrowLii Feb 17, 2026
@jieyouxu
Copy link
Member

r? types

@rustbot rustbot added the T-types Relevant to the types team, which will review and decide on the PR/issue. label Feb 18, 2026
@rustbot rustbot assigned lcnr and unassigned jieyouxu Feb 18, 2026
@theemathas
Copy link
Contributor

theemathas commented Feb 18, 2026

I think this fixes the wrong problem, since the ICE can also occur outside the next-solver. See #151957 (comment)

@rperier
Copy link
Contributor

rperier commented Feb 18, 2026

We should not reach this point, self.predicate_must_hold_modulo_regions(...) should not being called. After investigation, there is a false positive match between PointeeSized from the current crate and core::marker::PointeeSized . The problem being, we could have exactly the same issue with some other traits in core::marker::* (like Unsize . I mean some false positives matches without ICE)

@rust-bors

This comment has been minimized.

<T as PointeeSized>::Undefined: PointeeSized,
//~^ ERROR the trait bound `T: PointeeSized` is not satisfied
//~| ERROR the trait bound `T: PointeeSized` is not satisfied
{}
Copy link
Contributor

Choose a reason for hiding this comment

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

i personally prefer this reproducer as a test #151957 (comment)

trait PointeeSized {}

fn require_trait<T: PointeeSized>() {}

fn main() {
    require_trait::<i32>();
}

please also explain why this errors (and add revisions to test with both solvers)

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.

nit wrt the test, otherwise r=me

View changes since this review

&& trait_name == self.tcx.item_name(def_id)
&& trait_has_same_params(*def_id)
// Skip `PointeeSized` here to avoid creating `PointeeSized` solver obligations during error reporting.
&& !self.tcx.is_lang_item(*def_id, LangItem::PointeeSized)
Copy link
Contributor

Choose a reason for hiding this comment

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

actually, doesn't really matter, but looking at #153100, it would be more correct to consider PointeeSized to always hold, instead of ignoring it. Don't think that's useful information for users, but 🤷

@TaKO8Ki TaKO8Ki force-pushed the pointee-sized-next-solver-ice branch from 5bd2b85 to 16dae9c Compare March 2, 2026 08:48
@rustbot

This comment has been minimized.

@TaKO8Ki TaKO8Ki force-pushed the pointee-sized-next-solver-ice branch from 16dae9c to ca74063 Compare March 2, 2026 09:02
@rustbot
Copy link
Collaborator

rustbot commented Mar 2, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@TaKO8Ki
Copy link
Member Author

TaKO8Ki commented Mar 2, 2026

@bors r=lcnr

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 2, 2026

📌 Commit ca74063 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 Mar 2, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 2, 2026
…ice, r=lcnr

Fix next-solver ICE on PointeeSized goals

Fixes rust-lang#151957
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 2, 2026
…ice, r=lcnr

Fix next-solver ICE on PointeeSized goals

Fixes rust-lang#151957
rust-bors bot pushed a commit that referenced this pull request Mar 2, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #151962 (Fix next-solver ICE on PointeeSized goals)
 - #153161 (Rejig `rustc_with_all_queries!`)
 - #152164 (Lint unused features)
 - #153191 (  don't emit `unused_results` lint for tuples of "trivial" types )
 - #153273 (vec/mod.rs: add missing period in "ie." in docs)
rust-bors bot pushed a commit that referenced this pull request Mar 2, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #151962 (Fix next-solver ICE on PointeeSized goals)
 - #153161 (Rejig `rustc_with_all_queries!`)
 - #152164 (Lint unused features)
 - #153191 (  don't emit `unused_results` lint for tuples of "trivial" types )
 - #153273 (vec/mod.rs: add missing period in "ie." in docs)
rust-bors bot pushed a commit that referenced this pull request Mar 2, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #151962 (Fix next-solver ICE on PointeeSized goals)
 - #153161 (Rejig `rustc_with_all_queries!`)
 - #152164 (Lint unused features)
 - #153191 (  don't emit `unused_results` lint for tuples of "trivial" types )
 - #153273 (vec/mod.rs: add missing period in "ie." in docs)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 2, 2026
…ice, r=lcnr

Fix next-solver ICE on PointeeSized goals

Fixes rust-lang#151957
rust-bors bot pushed a commit that referenced this pull request Mar 2, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #153153 (add tests for thumb interworking)
 - #149328 (Add `String<A>` type with custom allocator parameter)
 - #151780 (Updated slice tests to pass for big endian hosts for `multiple-option-or-permutations.rs`)
 - #151962 (Fix next-solver ICE on PointeeSized goals)
 - #153015 (core: make atomic primitives type aliases of `Atomic<T>`)
 - #153161 (Rejig `rustc_with_all_queries!`)
 - #153191 (  don't emit `unused_results` lint for tuples of "trivial" types )
 - #153273 (vec/mod.rs: add missing period in "ie." in docs)
 - #153292 (tests: codegen-llvm: vec-calloc: do not require the uwtable attribute)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Mar 2, 2026
…ice, r=lcnr

Fix next-solver ICE on PointeeSized goals

Fixes rust-lang#151957
rust-bors bot pushed a commit that referenced this pull request Mar 2, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #153153 (add tests for thumb interworking)
 - #149328 (Add `String<A>` type with custom allocator parameter)
 - #151780 (Updated slice tests to pass for big endian hosts for `multiple-option-or-permutations.rs`)
 - #151962 (Fix next-solver ICE on PointeeSized goals)
 - #153015 (core: make atomic primitives type aliases of `Atomic<T>`)
 - #153161 (Rejig `rustc_with_all_queries!`)
 - #153191 (  don't emit `unused_results` lint for tuples of "trivial" types )
 - #153273 (vec/mod.rs: add missing period in "ie." in docs)
 - #153292 (tests: codegen-llvm: vec-calloc: do not require the uwtable attribute)
 - #153293 (library: std: process: skip tests on Hermit)
 - #153301 (Do not ping kobzol on rustc-dev-guide changes)
rust-bors bot pushed a commit that referenced this pull request Mar 2, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #153153 (add tests for thumb interworking)
 - #151780 (Updated slice tests to pass for big endian hosts for `multiple-option-or-permutations.rs`)
 - #151962 (Fix next-solver ICE on PointeeSized goals)
 - #153015 (core: make atomic primitives type aliases of `Atomic<T>`)
 - #153161 (Rejig `rustc_with_all_queries!`)
 - #153191 (  don't emit `unused_results` lint for tuples of "trivial" types )
 - #153273 (vec/mod.rs: add missing period in "ie." in docs)
 - #153292 (tests: codegen-llvm: vec-calloc: do not require the uwtable attribute)
 - #153293 (library: std: process: skip tests on Hermit)
 - #153301 (Do not ping kobzol on rustc-dev-guide changes)
@rust-bors rust-bors bot merged commit 4a3d3cb into rust-lang:main Mar 2, 2026
11 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 2, 2026
@TaKO8Ki TaKO8Ki deleted the pointee-sized-next-solver-ice branch March 3, 2026 05:31
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. T-types Relevant to the types team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICE: entered unreachable code: PointeeSized is removed during lowering with -Z next-solver=globally and recursive associated type bound

9 participants