Skip to content

explicit_generic_args_with_impl_trait: fix min expected number of generics #87727

New issue

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

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

Already on GitHub? # to your account

Merged
merged 3 commits into from
Aug 6, 2021

Conversation

SkiFire13
Copy link
Contributor

Fixes #87718

The problem was that synth_type_param_count was already subtracted from named_type_param_count, so this ended up being subtracted again. This caused expected_min to overflow, and ultimately resulting in weird and wrong behaviour.

I've also added another test not present in the original issue but caused by the same bug.

@rust-highfive
Copy link
Contributor

r? @Mark-Simulacrum

(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 Aug 3, 2021
@rust-log-analyzer

This comment has been minimized.

@jackh726
Copy link
Member

jackh726 commented Aug 3, 2021

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 3, 2021

📌 Commit e3389be has been approved by jackh726

@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 Aug 3, 2021
@nbdd0121
Copy link
Contributor

nbdd0121 commented Aug 3, 2021

Facepalm, this mistake is so stupid... I really should catch it myself

@jackh726
Copy link
Member

jackh726 commented Aug 3, 2021

Facepalm, this mistake is so stupid... I really should catch it myself

No worries. Mistakes happen. This is why we have nightly and feature gates.

@bors
Copy link
Collaborator

bors commented Aug 5, 2021

⌛ Testing commit e3389be with merge fd11cdfe39c7b025a611f8c4a49114e5a1c2a89b...

@bors
Copy link
Collaborator

bors commented Aug 5, 2021

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 5, 2021
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@SkiFire13
Copy link
Contributor Author

Looks like the auto (dist-i586-gnu-i586-i686-musl, ubuntu-latest-xl) job timed out after it finished all the ui tests. Not sure what might be the problem here.

@jackh726
Copy link
Member

jackh726 commented Aug 5, 2021

@bors retry

@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 Aug 5, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Aug 6, 2021
explicit_generic_args_with_impl_trait: fix min expected number of generics

Fixes rust-lang#87718

The problem was that `synth_type_param_count` was already subtracted from `named_type_param_count`, so this ended up being subtracted again. This caused `expected_min` to overflow, and ultimately resulting in weird and wrong behaviour.

I've also added another test not present in the original issue but caused by the same bug.
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 6, 2021
Rollup of 9 pull requests

Successful merges:

 - rust-lang#87561 (thread set_name haiku implementation.)
 - rust-lang#87715 (Add long error explanation for E0625)
 - rust-lang#87727 (explicit_generic_args_with_impl_trait: fix min expected number of generics)
 - rust-lang#87742 (Validate FFI-safety warnings on naked functions)
 - rust-lang#87756 (Add back -Zno-profiler-runtime)
 - rust-lang#87759 (Re-use std::sealed::Sealed in os/linux/process.)
 - rust-lang#87760 (Promote `aarch64-apple-ios-sim` to Tier 2)
 - rust-lang#87770 (permit drop impls with generic constants in where clauses)
 - rust-lang#87780 (alloc: Use intra doc links for the reserve function)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5b43960 into rust-lang:master Aug 6, 2021
@rustbot rustbot added this to the 1.56.0 milestone Aug 6, 2021
@SkiFire13 SkiFire13 deleted the fix-87718 branch August 6, 2021 07:56
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
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.

ICE: 'assertion failed: num_missing_args > 0', compiler/rustc_typeck/src/structured_errors/wrong_number_of_generic_args.rs:234:17
8 participants