permit drop impls with generic constants in where clauses#87770
Merged
bors merged 2 commits intorust-lang:masterfrom Aug 6, 2021
Merged
permit drop impls with generic constants in where clauses#87770bors merged 2 commits intorust-lang:masterfrom
bors merged 2 commits intorust-lang:masterfrom
Conversation
lcnr
approved these changes
Aug 4, 2021
Contributor
lcnr
left a comment
There was a problem hiding this comment.
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(), |
Contributor
There was a problem hiding this comment.
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
Member
There was a problem hiding this comment.
Yeah, we only generate these as part of the lowering proces for Chalk. If these show up anywhere else, it's a bug.
Contributor
|
@bors r+ rollup |
Collaborator
|
📌 Commit fa46715 has been approved by |
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Aug 6, 2021
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`````
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
16 tasks
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 free
to 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.
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
TypeWellFormedFromEnvinstead of==as it contains aTyso I added that too...r? @lcnr