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

Checking generic args after late bound region err. #60892

Merged
merged 1 commit into from
May 17, 2019

Conversation

davidtwco
Copy link
Member

Fixes #60622.

This PR fixes an ICE that occurs when a late bound region error is
emitted and that resulted in the rest of the generic arguments of a
function not being checked.

For example, you could specify a generic type parameter T in a function
call foo<'_, T>() to a function that doesn't have a generic type
parameter.

Since an error wasn't emitted from the function, compilation
continued to parts of typeck that didn't expect a generic type argument
in a call for a function that didn't have any generic type arguments.

@rust-highfive
Copy link
Collaborator

r? @oli-obk

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 16, 2019
This commit fixes an ICE that occurs when a late bound region error is
emitted and that resulted in the rest of the generic arguments of a
function not being checked.

For example, you could specify a generic type parameter `T` in a function
call `foo<'_, T>()` to a function that doesn't have a generic type
parameter.

Since an error wasn't emitted from the function, compilation
continued to parts of typeck that didn't expect a generic type argument
in a call for a function that didn't have any generic type arguments.
@oli-obk
Copy link
Contributor

oli-obk commented May 17, 2019

@bors r+

@bors
Copy link
Contributor

bors commented May 17, 2019

📌 Commit bff8a86 has been approved by oli-obk

@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 May 17, 2019
@bors
Copy link
Contributor

bors commented May 17, 2019

⌛ Testing commit bff8a86 with merge 3940146...

bors added a commit that referenced this pull request May 17, 2019
Checking generic args after late bound region err.

Fixes #60622.

This PR fixes an ICE that occurs when a late bound region error is
emitted and that resulted in the rest of the generic arguments of a
function not being checked.

For example, you could specify a generic type parameter `T` in a function
call `foo<'_, T>()` to a function that doesn't have a generic type
parameter.

Since an error wasn't emitted from the function, compilation
continued to parts of typeck that didn't expect a generic type argument
in a call for a function that didn't have any generic type arguments.
@bors
Copy link
Contributor

bors commented May 17, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: oli-obk
Pushing 3940146 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 17, 2019
@bors bors merged commit bff8a86 into rust-lang:master May 17, 2019
@davidtwco davidtwco deleted the issue-60622 branch May 17, 2019 13:09
RalfJung added a commit to RalfJung/rust that referenced this pull request May 30, 2020
…nikomatsakis

Fix ICE with explicit late-bound lifetimes

Rather than returning an explicit late-bound lifetime as a generic argument count mismatch (which is not necessarily true), this PR propagates the presence of explicit late-bound lifetimes.

This avoids an ICE that can occur due to the presence of explicit late-bound lifetimes when building generic substitutions by explicitly ignoring them.

r? @varkor

cc @davidtwco (this removes a check you introduced in rust-lang#60892)

Resolves rust-lang#72278
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiler crash when dealing with Any and Ref
4 participants