Uh oh!
There was an error while loading. Please reload this page.
Don't ICE when RPITIT captures more method args than trait definition - #130412
Merged
Conversation
rustbot
commented
Sep 15, 2024
Collaborator
| } | ||
| } else { | ||
| let guar = match region.opt_param_def_id(self.tcx, self.tcx.parent(self.def_id)) { | ||
| let guar = match region.opt_param_def_id(self.tcx, self.impl_m_def_id) { |
ContributorAuthor
There was a problem hiding this comment.
This used the def id of the trait, rather than the def id of the impl method. The def id of the impl method is needed here because we're remapping args from the impl method's signature.
jieyouxu
commented
Sep 16, 2024
Member
@bors r+ rollup |
bors
commented
Sep 16, 2024
Collaborator
matthiaskrgr added a commit
to matthiaskrgr/rust
that referenced
this pull request
Sep 16, 2024
…, r=jieyouxu Don't ICE when RPITIT captures more method args than trait definition Make sure we don't ICE when an RPITIT captures more method args than the trait definition, which is not allowed. This was because we were using the wrong def id for error reporting. Due to the default lifetime capture rules of RPITITs (capturing everything in scope), this is only doable if we use precise capturing, which isn't currently allowed for RPITITs anyways but we still end up reaching the relevant codepaths. Fixesrust-lang#129850
jieyouxu
commented
Sep 16, 2024
Member
This comment has been minimized.
This comment has been minimized.
compiler-errorsforce-pushed
the
rpitit-overcapture
branch
from
September 16, 2024 14:57
b53f5ce to
1e9fa7eComparecompiler-errors
commented
Sep 16, 2024
ContributorAuthor
@bors r=jieyouxu |
bors
commented
Sep 16, 2024
Collaborator
bors added a commit
to rust-lang-ci/rust
that referenced
this pull request
Sep 16, 2024
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#123436 (linker: Allow MSVC to use import libraries following the Meson/MinGW convention) - rust-lang#130410 (Don't ICE when generating `Fn` shim for async closure with borrowck error) - rust-lang#130412 (Don't ICE when RPITIT captures more method args than trait definition) - rust-lang#130436 (Ignore reduce-fadd-unordered on SGX platform) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer added a commit
to rust-lang-ci/rust
that referenced
this pull request
Sep 16, 2024
Rollup merge of rust-lang#130412 - compiler-errors:rpitit-overcapture, r=jieyouxu Don't ICE when RPITIT captures more method args than trait definition Make sure we don't ICE when an RPITIT captures more method args than the trait definition, which is not allowed. This was because we were using the wrong def id for error reporting. Due to the default lifetime capture rules of RPITITs (capturing everything in scope), this is only doable if we use precise capturing, which isn't currently allowed for RPITITs anyways but we still end up reaching the relevant codepaths. Fixesrust-lang#129850
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make sure we don't ICE when an RPITIT captures more method args than the trait definition, which is not allowed. This was because we were using the wrong def id for error reporting.
Due to the default lifetime capture rules of RPITITs (capturing everything in scope), this is only doable if we use precise capturing, which isn't currently allowed for RPITITs anyways but we still end up reaching the relevant codepaths.
Fixes#129850