Rollup merge of #87770 - BoxyUwU:cec-drop-impl, r=lcnr
permit drop impls with generic constants in where clauses 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 a `Ty` so I added that too... r? ``````@lcnr``````
This commit is contained in:
commit
8bad35095b
2 changed files with 26 additions and 3 deletions
|
|
@ -0,0 +1,16 @@
|
|||
//check-pass
|
||||
#![feature(const_generics, const_evaluatable_checked)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
struct Foo<const N: usize>
|
||||
where
|
||||
[(); N + 1]: ;
|
||||
|
||||
impl<const N: usize> Drop for Foo<N>
|
||||
where
|
||||
[(); N + 1]: ,
|
||||
{
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue