Effects soundness hole: Non-const assoc fns in const fns accepted if the trait is not #[const_trait]
#125831
Labels
C-bug
Category: This is a bug.
F-effects
`#![feature(effects)]`
PG-const-traits
Project group: Const traits
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
I expected this code to fail, since
impl Not for FlipFlop
is not a constant implementation, butconst fn negating
requires a constant implementation.Instead, this code succeeds with no error, failing if you actually use the method like so:
Giving the following result:
I believe that this code should fail to compile regardless of whether it's used at constant time.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: