-
Notifications
You must be signed in to change notification settings - Fork 13.3k
trait method calls on ~const
bounded types should not be allowed in generic const exprs
#102498
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
Comments
I think this issue is a good use case for a |
…k-Simulacrum Add a known-bug test for rust-lang#102498 Self-explanatory
…k-Simulacrum Add a known-bug test for rust-lang#102498 Self-explanatory
…k-Simulacrum Add a known-bug test for rust-lang#102498 Self-explanatory
Rollup of 5 pull requests Successful merges: - rust-lang#100451 (Do not panic when a test function returns Result::Err.) - rust-lang#102098 (Use fetch_update in sync::Weak::upgrade) - rust-lang#102538 (Give `def_span` the same SyntaxContext as `span_with_body`.) - rust-lang#102556 (Make `feature(const_btree_len)` implied by `feature(const_btree_new)`) - rust-lang#102566 (Add a known-bug test for rust-lang#102498) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 5 pull requests Successful merges: - rust-lang#100451 (Do not panic when a test function returns Result::Err.) - rust-lang#102098 (Use fetch_update in sync::Weak::upgrade) - rust-lang#102538 (Give `def_span` the same SyntaxContext as `span_with_body`.) - rust-lang#102556 (Make `feature(const_btree_len)` implied by `feature(const_btree_new)`) - rust-lang#102566 (Add a known-bug test for rust-lang#102498) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
I stumbled across this case today - is there a way yet in the const-trait-rewrite to use const-if-const trait methods inside constants? Is one planned (before the rewrite started, this case was supported) or will this require new always-const bounds? |
Under the current implementation this gets rejected with and without Like, Footnotes
|
playground
If we remove the
huh
definition, it compiles. This fix would involve treating caller bounds differently and would probably come with the addition of "alwaysconst
" bounds.This is an interaction with
generic_const_exprs
andconst_trait_impl
, but does not block the stabilization ofgeneric_const_exprs
as this is only allowed if someone enables the featureconst_trait_impl
.The text was updated successfully, but these errors were encountered: