Skip to content

fix oversight in the min_const_generics checks #93802

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 1 commit into from
Feb 10, 2022
Merged

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Feb 9, 2022

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 9, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 9, 2022
@lcnr
Copy link
Contributor Author

lcnr commented Feb 9, 2022

One has to try incredibly hard to avoid the current checks. For this to break your code, you need:

  • a trait impl where the trait mentions all used generic parameters, with a self type whose only use generic parameters are in projections <T as Trait<U>>::Assoc (as otherwise T and U would not be bound by the impl)
  • the projection can be normalized even without any bounds on T and U, as these are not provided inside of the anon const.
  • that Self type is used in an anonymous constants

Even one of these three requirements is incredibly unlikely, so I simply consider this to be a bugfix without caring about any potential breakage, cc @nikomatsakis just in case

@nikomatsakis
Copy link
Contributor

seems ok to land as a bug fix and see what the beta crater runs turn up

@BoxyUwU
Copy link
Member

BoxyUwU commented Feb 10, 2022

@bors r+

@bors
Copy link
Collaborator

bors commented Feb 10, 2022

📌 Commit 76c562f has been approved by BoxyUwU

@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 Feb 10, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 10, 2022
…askrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#92670 (add kernel target for RustyHermit)
 - rust-lang#93756 (Support custom options for LLVM build)
 - rust-lang#93802 (fix oversight in the `min_const_generics` checks)
 - rust-lang#93808 (Remove first headings indent)
 - rust-lang#93824 (Stabilize cfg_target_has_atomic)
 - rust-lang#93830 (Refactor sidebar printing code)
 - rust-lang#93843 (kmc-solid: Fix wait queue manipulation errors in the `Condvar` implementation)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f3f41d7 into rust-lang:master Feb 10, 2022
@rustbot rustbot added this to the 1.60.0 milestone Feb 10, 2022
@lcnr lcnr deleted the mcg-woops branch February 10, 2022 15: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. 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.

7 participants