Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove the incomplete marker from const closures
  • Loading branch information
oli-obk committed Mar 13, 2026
commit c521b8084fb910e4a809c0611944fc9404138615
2 changes: 1 addition & 1 deletion compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ declare_features! (
/// Allows defining and calling c-variadic functions in const contexts.
(unstable, const_c_variadic, "1.95.0", Some(151787)),
/// Allows `const || {}` closures in const contexts.
(incomplete, const_closures, "1.68.0", Some(106003)),
(unstable, const_closures, "1.68.0", Some(106003)),
/// Allows using `[const] Destruct` bounds and calling drop impls in const contexts.
(unstable, const_destruct, "1.85.0", Some(133214)),
/// Allows `for _ in _` loops in const contexts.
Expand Down
1 change: 0 additions & 1 deletion tests/ui/traits/const-traits/call-const-closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//@ edition:2021

#![feature(const_trait_impl, const_closures)]
#![allow(incomplete_features)]

const trait Bar {
fn foo(&self);
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/traits/const-traits/call-const-closure.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `(): const Bar` is not satisfied
--> $DIR/call-const-closure.rs:16:18
--> $DIR/call-const-closure.rs:15:18
|
LL | (const || ().foo())();
| ^^^
Expand Down
1 change: 0 additions & 1 deletion tests/ui/traits/const-traits/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//@[next] compile-flags: -Znext-solver
//@revisions: next old
#![feature(const_closures, const_trait_impl)]
#![allow(incomplete_features)]

const _: () = {
assert!((const || true)());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(incomplete_features)]
#![feature(const_closures, const_trait_impl)]

const fn create_array<const N: usize>(mut f: impl FnMut(usize) -> u32 + Copy) -> [u32; N] {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `impl FnMut(usize) -> u32 + Copy: [const] FnMut(usize)` is not satisfied
--> $DIR/const-closure-issue-125866-error.rs:8:22
--> $DIR/const-closure-issue-125866-error.rs:7:22
|
LL | array[i] = f(i);
| - ^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@check-pass

#![feature(const_trait_impl, const_closures)]
#![allow(incomplete_features)]

const fn test() -> impl [const] Fn() {
const move || {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@ known-bug: #110395
//@ compile-flags: -Znext-solver
#![feature(const_closures, const_trait_impl)]
#![allow(incomplete_features)]

trait Foo {
fn foo(&self);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: cannot use `const` closures outside of const contexts
--> $DIR/const_closure-const_trait_impl-ice-113381.rs:15:6
--> $DIR/const_closure-const_trait_impl-ice-113381.rs:14:6
|
LL | (const || (()).foo())();
| ^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(const_trait_impl, const_closures, const_cmp)]
#![allow(incomplete_features)]

const fn test() -> impl [const] Fn() {
const move || {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0015]: cannot call non-const function `core::panicking::assert_failed::<&u8, &u8>` in constant functions
--> $DIR/ice-112822-expected-type-for-param.rs:10:17
--> $DIR/ice-112822-expected-type-for-param.rs:9:17
|
LL | assert_eq!(first, &b'f');
| ^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(const_closures, const_trait_impl)]
#![allow(incomplete_features)]

trait Foo {
fn foo(&self);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: cannot use `const` closures outside of const contexts
--> $DIR/non-const-op-const-closure-non-const-outer.rs:15:6
--> $DIR/non-const-op-const-closure-non-const-outer.rs:14:6
|
LL | (const || { (()).foo() })();
| ^^^^^
Expand Down