Skip to content

Fix check with is_impl_trait_in_trait() before expecting local id - #164318

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Jamesbarford:fix/const-generic-issue-164180
Oct 16, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Jamesbarford:fix/const-generic-issue-164180

Conversation

@Jamesbarford

Copy link
Copy Markdown
Contributor

Fix an ICE when implementing a const generic method with return position impl Trait from another crate RPITIT

r? khyperia

fixes #164180

@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 Oct 14, 2026
Comment thread tests/ui/const-generics/non-local-method-same-ok.rs Outdated
@Jamesbarford
Jamesbarford force-pushed the fix/const-generic-issue-164180 branch from d70508b to 762d20a Compare October 15, 2026 07:08
@khyperia

Copy link
Copy Markdown
Member

Could you add a test where the relevant span is used/printed? The nonlocal case is particularly interesting. For example, the fact that you're taking the def_span of the impl item rather than the param is a bit wonky, and I'd like to see what that does.

Also, adding a comment explaining the situation and how RPITITs can be nonlocal would be nice.

@khyperia khyperia added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 15, 2026
@Jamesbarford
Jamesbarford force-pushed the fix/const-generic-issue-164180 branch from 762d20a to 7b6a940 Compare October 15, 2026 12:21
@Jamesbarford

Copy link
Copy Markdown
Contributor Author

Could you add a test where the relevant span is used/printed? The nonlocal case is particularly interesting. For example, the fact that you're taking the def_span of the impl item rather than the param is a bit wonky, and I'd like to see what that does.

Also, adding a comment explaining the situation and how RPITITs can be nonlocal would be nice.

While the error is perceivably not as polished as some, I would like to think one could almost definitely resolve their problem if they were to encounter.

@khyperia

Copy link
Copy Markdown
Member

Ach. Unfortunately your added test does not actually test what you are changing in this PR, that error message is from a completely different place! Commenting out compare_const_generic_param_types and rerunning the test shows that the error still happens, exact same output.

Oh well though. With the time sensitivity of this issue, it's probably good to merge this now, and look into specifics later. Thanks for looking into this!

@bors r+ rollup

@rust-bors

rust-bors Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 7b6a940 has been approved by khyperia

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 15, 2026
@Jamesbarford

Copy link
Copy Markdown
Contributor Author

Ach. Unfortunately your added test does not actually test what you are changing in this PR, that error message is from a completely different place! Commenting out compare_const_generic_param_types and rerunning the test shows that the error still happens, exact same output.

Oh well though. With the time sensitivity of this issue, it's probably good to merge this now, and look into specifics later. Thanks for looking into this!

@bors r+ rollup

Huh... So essentially all I've done is move the problem?

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 15, 2026
…ue-164180, r=khyperia

Fix check with `is_impl_trait_in_trait()` before expecting local id

Fix an ICE when implementing a const generic method with return position `impl Trait` from another crate `RPITIT`

r? khyperia

fixes rust-lang#164180
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 15, 2026
…ue-164180, r=khyperia

Fix check with `is_impl_trait_in_trait()` before expecting local id

Fix an ICE when implementing a const generic method with return position `impl Trait` from another crate `RPITIT`

r? khyperia

fixes rust-lang#164180
rust-bors Bot pushed a commit that referenced this pull request Oct 15, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #164271 (Add release notes for 1.99.1)
 - #164361 (delegation: map return even if there is no target expression)
 - #162778 (rustdoc: add disambiguators for identically named method in sidebar)
 - #163224 ([rustdoc] Add tabs to settings popover)
 - #164220 (Test the interaction between `--remap-path-prefix` and doctests)
 - #164279 (Make the `documentation` scope a sub-scope of the `object` scope)
 - #164318 (Fix check with `is_impl_trait_in_trait()` before expecting local id)
 - #164360 (Fix(lib/sys): Restore Win7 compilation)
rust-bors Bot pushed a commit that referenced this pull request Oct 16, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #164175 (Drop WC_ERR_INVALID_CHARS from Windows stdio)
 - #164361 (delegation: map return even if there is no target expression)
 - #162778 (rustdoc: add disambiguators for identically named method in sidebar)
 - #163224 ([rustdoc] Add tabs to settings popover)
 - #164220 (Test the interaction between `--remap-path-prefix` and doctests)
 - #164318 (Fix check with `is_impl_trait_in_trait()` before expecting local id)
 - #164360 (Fix(lib/sys): Restore Win7 compilation)
@rust-bors
rust-bors Bot merged commit 8aed807 into rust-lang:main Oct 16, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 16, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 16, 2026
Rollup merge of #164318 - Jamesbarford:fix/const-generic-issue-164180, r=khyperia

Fix check with `is_impl_trait_in_trait()` before expecting local id

Fix an ICE when implementing a const generic method with return position `impl Trait` from another crate `RPITIT`

r? khyperia

fixes #164180
@Jamesbarford
Jamesbarford deleted the fix/const-generic-issue-164180 branch October 27, 2026 08:37
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.

[ICE]: could not compile iroh-blobs (lib)

4 participants