const_trait_impl
does not keep track of closures
#119687
Labels
A-closures
Area: Closures (`|…| { … }`)
C-bug
Category: This is a bug.
F-const_trait_impl
`#![feature(const_trait_impl)]`
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.
Uh oh!
There was an error while loading. Please reload this page.
The feature
effects
doesn't track the constness of closures.This currently type-checks but it shouldn't:Update: We (project-const-traits) have decided that we do want the code below to compile. It still holds true that
effects
doesn't track the constness of closures yet but we now plan on removing the need forconst || {}
(and remove the whole featureconst_closures
at some point) and want to rely on effect inference to make it work. Please see this Zulip discussion.However, the following definitely shouldn't compile:
Without
effects
, they get rejected early witherror[E0015]: cannot call non-const closure in constant functions
.See also this Zulip discussion.
The text was updated successfully, but these errors were encountered: