Skip to content

Commit 8700b45

Browse files
committed
Stabilize const_impl_trait as well
1 parent 801be21 commit 8700b45

File tree

9 files changed

+5
-58
lines changed

9 files changed

+5
-58
lines changed

compiler/rustc_const_eval/src/transform/check_consts/check.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> {
356356

357357
match *ty.kind() {
358358
ty::Ref(_, _, hir::Mutability::Mut) => self.check_op(ops::ty::MutRef(kind)),
359-
ty::Opaque(..) => self.check_op(ops::ty::ImplTrait),
360359
_ => {}
361360
}
362361
}

compiler/rustc_const_eval/src/transform/check_consts/ops.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -795,25 +795,4 @@ pub mod ty {
795795
)
796796
}
797797
}
798-
799-
#[derive(Debug)]
800-
pub struct ImplTrait;
801-
impl<'tcx> NonConstOp<'tcx> for ImplTrait {
802-
fn status_in_item(&self, _: &ConstCx<'_, '_>) -> Status {
803-
Status::Unstable(sym::const_impl_trait)
804-
}
805-
806-
fn build_error(
807-
&self,
808-
ccx: &ConstCx<'_, 'tcx>,
809-
span: Span,
810-
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
811-
feature_err(
812-
&ccx.tcx.sess.parse_sess,
813-
sym::const_impl_trait,
814-
span,
815-
&format!("`impl Trait` is not allowed in {}s", ccx.const_kind()),
816-
)
817-
}
818-
}
819798
}

compiler/rustc_feature/src/accepted.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ declare_features! (
100100
(accepted, const_generics_defaults, "1.59.0", Some(44580), None),
101101
/// Allows the use of `if` and `match` in constants.
102102
(accepted, const_if_match, "1.46.0", Some(49146), None),
103+
/// Allows argument and return position `impl Trait` in a `const fn`.
104+
(accepted, const_impl_trait, "1.60.0", Some(77463), None),
103105
/// Allows indexing into constant arrays.
104106
(accepted, const_indexing, "1.26.0", Some(29947), None),
105107
/// Allows let bindings, assignments and destructuring in `const` functions and constants.

compiler/rustc_feature/src/active.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,6 @@ declare_features! (
340340
(active, const_fn_floating_point_arithmetic, "1.48.0", Some(57241), None),
341341
/// Allows `for _ in _` loops in const contexts.
342342
(active, const_for, "1.56.0", Some(87575), None),
343-
/// Allows argument and return position `impl Trait` in a `const fn`.
344-
(active, const_impl_trait, "1.48.0", Some(77463), None),
345343
/// Allows using `&mut` in constant functions.
346344
(active, const_mut_refs, "1.41.0", Some(57349), None),
347345
/// Be more precise when looking for live drops in a const context.

library/core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
#![feature(const_fn_floating_point_arithmetic)]
161161
#![cfg_attr(bootstrap, feature(const_fn_fn_ptr_basics))]
162162
#![cfg_attr(bootstrap, feature(const_fn_trait_bound))]
163-
#![feature(const_impl_trait)]
163+
#![cfg_attr(bootstrap, feature(const_impl_trait))]
164164
#![feature(const_mut_refs)]
165165
#![feature(const_precise_live_drops)]
166166
#![feature(const_refs_to_cell)]

src/test/ui/consts/min_const_fn/min_const_fn_impl_trait.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/test/ui/consts/min_const_fn/min_const_fn_impl_trait.stderr

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/test/ui/type-alias-impl-trait/issue-53096.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(const_impl_trait, rustc_attrs)]
1+
#![feature(rustc_attrs)]
22
#![feature(type_alias_impl_trait)]
33

44
type Foo = impl Fn() -> usize;

src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(const_impl_trait, generators, generator_trait, rustc_attrs)]
1+
#![feature(generators, generator_trait, rustc_attrs)]
22
#![feature(type_alias_impl_trait)]
33

44
use std::ops::Generator;

0 commit comments

Comments
 (0)