Skip to content

Commit 4fbac29

Browse files
Rollup merge of #87179 - fee1-dead:active-const-impl, r=oli-obk
Mark `const_trait_impl` as active See [this zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/implementation.20path.20for.20const.20trait.20impls). r? ``@oli-obk``
2 parents 7c5cabe + 8841a42 commit 4fbac29

38 files changed

+24
-47
lines changed

compiler/rustc_feature/src/active.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ declare_features! (
534534
(active, bindings_after_at, "1.41.0", Some(65490), None),
535535

536536
/// Allows `impl const Trait for T` syntax.
537-
(incomplete, const_trait_impl, "1.42.0", Some(67792), None),
537+
(active, const_trait_impl, "1.42.0", Some(67792), None),
538538

539539
/// Allows `T: ?const Trait` syntax in bounds.
540540
(incomplete, const_trait_bound_opt_out, "1.42.0", Some(67794), None),

src/test/ui/consts/const-float-classify.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#![feature(const_float_bits_conv)]
66
#![feature(const_float_classify)]
77
#![feature(const_trait_impl)]
8-
#![allow(incomplete_features)]
98

109
// Don't promote
1110
const fn nop<T>(x: T) -> T { x }

src/test/ui/consts/rustc-impl-const-stability.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// build-pass
22

33
#![crate_type = "lib"]
4-
#![allow(incomplete_features)]
54
#![feature(staged_api)]
65
#![feature(const_trait_impl)]
76
#![stable(feature = "foo", since = "1.0.0")]

src/test/ui/rfc-2632-const-trait-impl/assoc-type.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// FIXME: This test should fail since, within a const impl of `Foo`, the bound on `Foo::Bar` should
44
// require a const impl of `Add` for the associated type.
55

6-
#![allow(incomplete_features)]
76
#![feature(const_trait_impl)]
87

98
struct NonConstAdd(i32);

src/test/ui/rfc-2632-const-trait-impl/attr-misuse.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(const_trait_impl)]
2-
#![allow(incomplete_features)]
32

43
#[default_method_body_is_const] //~ ERROR attribute should be applied
54
trait A {

src/test/ui/rfc-2632-const-trait-impl/attr-misuse.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: attribute should be applied to a trait method with body
2-
--> $DIR/attr-misuse.rs:4:1
2+
--> $DIR/attr-misuse.rs:3:1
33
|
44
LL | #[default_method_body_is_const]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -13,15 +13,15 @@ LL | | }
1313
| |_- not a trait method or missing a body
1414

1515
error: attribute should be applied to a trait method with body
16-
--> $DIR/attr-misuse.rs:13:1
16+
--> $DIR/attr-misuse.rs:12:1
1717
|
1818
LL | #[default_method_body_is_const]
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020
LL | fn main() {}
2121
| ------------ not a trait method or missing a body
2222

2323
error: attribute should be applied to a trait method with body
24-
--> $DIR/attr-misuse.rs:6:5
24+
--> $DIR/attr-misuse.rs:5:5
2525
|
2626
LL | #[default_method_body_is_const]
2727
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/test/ui/rfc-2632-const-trait-impl/auxiliary/cross-crate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(const_trait_impl)]
2-
#![allow(incomplete_features)]
32

43
pub trait MyTrait {
54
fn func(self);

src/test/ui/rfc-2632-const-trait-impl/auxiliary/staged-api.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(const_trait_impl)]
2-
#![allow(incomplete_features)]
32

43
#![feature(staged_api)]
54
#![stable(feature = "rust1", since = "1.0.0")]

src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![allow(incomplete_features)]
21
#![feature(const_trait_impl)]
32

43
pub trait Plus {

src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
2-
--> $DIR/call-const-trait-method-fail.rs:25:5
2+
--> $DIR/call-const-trait-method-fail.rs:24:5
33
|
44
LL | a.plus(b)
55
| ^^^^^^^^^

0 commit comments

Comments
 (0)