rustc doesn't seem to understand ~const bounds on associated types #88655
Labels
A-associated-items
Area: Associated items (types, constants & functions)
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
A-trait-system
Area: Trait system
C-bug
Category: This is a bug.
F-const_trait_impl
`#![feature(const_trait_impl)]`
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code (playground]:
I expected to see this happen:
ShouldBeInferred::should_infer
should understand thatT::AssocTrait: ~const ConstableTrait
andself.a.foo()
is a const-fn.Instead, this happened:
The compiler doesn't seem to infer the
T::AssocTrait: ~const ConstableTrait
bound gives an errorself.a.foo()
is not callable in a constant context.I might be misunderstanding the purpose of
~const
bounds on associated types. Please correct me if I am :)Also great work so far on
const fn
. It's really starting to shine :)Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: