-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
permit drop impls with generic constants in where clauses #87770
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one nit, apart from that r=me
( | ||
ty::PredicateKind::TypeWellFormedFromEnv(a), | ||
ty::PredicateKind::TypeWellFormedFromEnv(b), | ||
) => relator.relate(predicate.rebind(a), p.rebind(b)).is_ok(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure whether TypeWellFormedFromEnv
can be part of the generic bounds of either the struct decl or the drop impl.
So these should probably be unreachable, cc @jackh726
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we only generate these as part of the lowering proces for Chalk. If these show up anywhere else, it's a bug.
@bors r+ rollup |
📌 Commit fa46715 has been approved by |
permit drop impls with generic constants in where clauses Fixes rust-lang#79248 `==` is not sufficient to check for equality between unevaluated consts which causes the above issue because the const in `[(); N - 1]:` on the impl and the const in `[(); N - 1]:` on the struct def are not seen as equal. Any predicate that can contain an unevaluated const cant use `==` here as it will cause us to incorrectly emit an error. I dont know much about chalk but it seems like we ought to be relating the `TypeWellFormedFromEnv` instead of `==` as it contains a `Ty` so I added that too... r? `````@lcnr`````
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
Fixes #79248
==
is not sufficient to check for equality between unevaluated consts which causes the above issue because the const in[(); N - 1]:
on the impl and the const in[(); N - 1]:
on the struct def are not seen as equal. Any predicate that can contain an unevaluated const cant use==
here as it will cause us to incorrectly emit an error.I dont know much about chalk but it seems like we ought to be relating the
TypeWellFormedFromEnv
instead of==
as it contains aTy
so I added that too...r? @lcnr