type aliases dont propagate implied ConstEvaluatable
bounds of rhs
#86259
Labels
A-const-generics
Area: const generics (parameters and arguments)
C-bug
Category: This is a bug.
F-generic_const_exprs
`#![feature(generic_const_exprs)]`
In an attempt to implement array default with const generics, I tried this code:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=700737e7598eca3dc58921f4530627f5
The code seems overall ok, but the compilation failed. After some try, it seems i can workaround this by add another usage of the "complex expression", and this second code snippet compiles:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=d3b02c12306c7e0754020951c84f0cbe
However when the usage code is generic, it still doesn't work:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=d3b02c12306c7e0754020951c84f0cbe
With this third piece of code, I did some debugging, and it seems in the
is_const_evaluatable<'cx, 'tcx>
function, there's a call like this:And there's no corresponding
ConstEvaluatable
bound in it. So it seems the evaluatable analysis is using a wrong or unpopulated "environment bounds"?This and the
const_evaluatable_checked
feature itself is the single blocker for array defaults implementation using const generics. So it would be nice if this can get fixed.cc @rust-lang/wg-const-eval
The text was updated successfully, but these errors were encountered: