Skip to content

Commit 95b5a08

Browse files
authored
Rollup merge of #143803 - RalfJung:const-trait-tracking, r=compiler-errors
New tracking issues for const_ops and const_cmp Let's do a clean start with new tracking issues to avoid mixing things up with the previous constification. I assume the fact that the `PartialEq` *trait* and *impls* used different feature names was a mistake (the feature name on the impl is entirely irrelevant anyway). Part of #143800, #143802 r? ``@oli-obk``
2 parents d607b94 + b94083e commit 95b5a08

18 files changed

+41
-40
lines changed

library/core/src/cmp.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ use crate::ops::ControlFlow;
248248
)]
249249
#[rustc_diagnostic_item = "PartialEq"]
250250
#[const_trait]
251-
#[rustc_const_unstable(feature = "const_trait_impl", issue = "67792")]
251+
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
252252
pub trait PartialEq<Rhs: PointeeSized = Self>: PointeeSized {
253253
/// Tests for `self` and `other` values to be equal, and is used by `==`.
254254
#[must_use]
@@ -1809,7 +1809,7 @@ mod impls {
18091809
macro_rules! partial_eq_impl {
18101810
($($t:ty)*) => ($(
18111811
#[stable(feature = "rust1", since = "1.0.0")]
1812-
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
1812+
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
18131813
impl const PartialEq for $t {
18141814
#[inline]
18151815
fn eq(&self, other: &Self) -> bool { *self == *other }
@@ -2017,7 +2017,7 @@ mod impls {
20172017
// & pointers
20182018

20192019
#[stable(feature = "rust1", since = "1.0.0")]
2020-
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
2020+
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
20212021
impl<A: PointeeSized, B: PointeeSized> const PartialEq<&B> for &A
20222022
where
20232023
A: ~const PartialEq<B>,
@@ -2089,7 +2089,7 @@ mod impls {
20892089
// &mut pointers
20902090

20912091
#[stable(feature = "rust1", since = "1.0.0")]
2092-
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
2092+
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
20932093
impl<A: PointeeSized, B: PointeeSized> const PartialEq<&mut B> for &mut A
20942094
where
20952095
A: ~const PartialEq<B>,
@@ -2159,7 +2159,7 @@ mod impls {
21592159
impl<A: PointeeSized> Eq for &mut A where A: Eq {}
21602160

21612161
#[stable(feature = "rust1", since = "1.0.0")]
2162-
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
2162+
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
21632163
impl<A: PointeeSized, B: PointeeSized> const PartialEq<&mut B> for &A
21642164
where
21652165
A: ~const PartialEq<B>,
@@ -2175,7 +2175,7 @@ mod impls {
21752175
}
21762176

21772177
#[stable(feature = "rust1", since = "1.0.0")]
2178-
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
2178+
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
21792179
impl<A: PointeeSized, B: PointeeSized> const PartialEq<&B> for &mut A
21802180
where
21812181
A: ~const PartialEq<B>,

library/core/src/ops/arith.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
/// ```
6666
#[lang = "add"]
6767
#[stable(feature = "rust1", since = "1.0.0")]
68-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
68+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
6969
#[rustc_on_unimplemented(
7070
on(all(Self = "{integer}", Rhs = "{float}"), message = "cannot add a float to an integer",),
7171
on(all(Self = "{float}", Rhs = "{integer}"), message = "cannot add an integer to a float",),
@@ -96,7 +96,7 @@ pub trait Add<Rhs = Self> {
9696
macro_rules! add_impl {
9797
($($t:ty)*) => ($(
9898
#[stable(feature = "rust1", since = "1.0.0")]
99-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
99+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
100100
impl const Add for $t {
101101
type Output = $t;
102102

@@ -179,7 +179,7 @@ add_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f16 f32 f64 f128
179179
/// ```
180180
#[lang = "sub"]
181181
#[stable(feature = "rust1", since = "1.0.0")]
182-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
182+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
183183
#[rustc_on_unimplemented(
184184
message = "cannot subtract `{Rhs}` from `{Self}`",
185185
label = "no implementation for `{Self} - {Rhs}`",
@@ -208,7 +208,7 @@ pub trait Sub<Rhs = Self> {
208208
macro_rules! sub_impl {
209209
($($t:ty)*) => ($(
210210
#[stable(feature = "rust1", since = "1.0.0")]
211-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
211+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
212212
impl const Sub for $t {
213213
type Output = $t;
214214

@@ -313,7 +313,7 @@ sub_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f16 f32 f64 f128
313313
/// ```
314314
#[lang = "mul"]
315315
#[stable(feature = "rust1", since = "1.0.0")]
316-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
316+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
317317
#[diagnostic::on_unimplemented(
318318
message = "cannot multiply `{Self}` by `{Rhs}`",
319319
label = "no implementation for `{Self} * {Rhs}`"
@@ -341,7 +341,7 @@ pub trait Mul<Rhs = Self> {
341341
macro_rules! mul_impl {
342342
($($t:ty)*) => ($(
343343
#[stable(feature = "rust1", since = "1.0.0")]
344-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
344+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
345345
impl const Mul for $t {
346346
type Output = $t;
347347

@@ -450,7 +450,7 @@ mul_impl! { usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 f16 f32 f64 f128
450450
/// ```
451451
#[lang = "div"]
452452
#[stable(feature = "rust1", since = "1.0.0")]
453-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
453+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
454454
#[diagnostic::on_unimplemented(
455455
message = "cannot divide `{Self}` by `{Rhs}`",
456456
label = "no implementation for `{Self} / {Rhs}`"
@@ -484,7 +484,7 @@ macro_rules! div_impl_integer {
484484
///
485485
#[doc = $panic]
486486
#[stable(feature = "rust1", since = "1.0.0")]
487-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
487+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
488488
impl const Div for $t {
489489
type Output = $t;
490490

@@ -505,7 +505,7 @@ div_impl_integer! {
505505
macro_rules! div_impl_float {
506506
($($t:ty)*) => ($(
507507
#[stable(feature = "rust1", since = "1.0.0")]
508-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
508+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
509509
impl const Div for $t {
510510
type Output = $t;
511511

@@ -556,7 +556,7 @@ div_impl_float! { f16 f32 f64 f128 }
556556
/// ```
557557
#[lang = "rem"]
558558
#[stable(feature = "rust1", since = "1.0.0")]
559-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
559+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
560560
#[diagnostic::on_unimplemented(
561561
message = "cannot calculate the remainder of `{Self}` divided by `{Rhs}`",
562562
label = "no implementation for `{Self} % {Rhs}`"
@@ -590,7 +590,7 @@ macro_rules! rem_impl_integer {
590590
///
591591
#[doc = $panic]
592592
#[stable(feature = "rust1", since = "1.0.0")]
593-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
593+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
594594
impl const Rem for $t {
595595
type Output = $t;
596596

@@ -626,7 +626,7 @@ macro_rules! rem_impl_float {
626626
/// assert_eq!(x % y, remainder);
627627
/// ```
628628
#[stable(feature = "rust1", since = "1.0.0")]
629-
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
629+
#[rustc_const_unstable(feature = "const_ops", issue = "143802")]
630630
impl const Rem for $t {
631631
type Output = $t;
632632

tests/ui/const-generics/issues/issue-90318.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![feature(const_type_id)]
22
#![feature(generic_const_exprs)]
3-
#![feature(const_trait_impl)]
3+
#![feature(const_trait_impl, const_cmp)]
44
#![feature(core_intrinsics)]
55
#![allow(incomplete_features)]
66

tests/ui/consts/const_cmp_type_id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ compile-flags: -Znext-solver
2-
#![feature(const_type_id, const_trait_impl)]
2+
#![feature(const_type_id, const_trait_impl, const_cmp)]
33

44
use std::any::TypeId;
55

tests/ui/consts/const_transmute_type_id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(const_type_id, const_trait_impl)]
1+
#![feature(const_type_id, const_trait_impl, const_cmp)]
22

33
use std::any::TypeId;
44

tests/ui/consts/const_transmute_type_id2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ normalize-stderr: "0x(ff)+" -> "<u128::MAX>"
22

3-
#![feature(const_type_id, const_trait_impl)]
3+
#![feature(const_type_id, const_trait_impl, const_cmp)]
44

55
use std::any::TypeId;
66

tests/ui/consts/const_transmute_type_id3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(const_type_id, const_trait_impl)]
1+
#![feature(const_type_id, const_trait_impl, const_cmp)]
22

33
use std::any::TypeId;
44

tests/ui/consts/const_transmute_type_id4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(const_type_id, const_trait_impl)]
1+
#![feature(const_type_id, const_trait_impl, const_cmp)]
22

33
use std::any::TypeId;
44

tests/ui/consts/issue-73976-monomorphic.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#![feature(const_type_id)]
99
#![feature(const_type_name)]
1010
#![feature(const_trait_impl)]
11+
#![feature(const_cmp)]
1112

1213
use std::any::{self, TypeId};
1314

tests/ui/consts/issue-90870.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#![allow(dead_code)]
44

55
const fn f(a: &u8, b: &u8) -> bool {
6-
//~^ HELP: add `#![feature(const_trait_impl)]` to the crate attributes to enable
7-
//~| HELP: add `#![feature(const_trait_impl)]` to the crate attributes to enable
8-
//~| HELP: add `#![feature(const_trait_impl)]` to the crate attributes to enable
6+
//~^ HELP: add `#![feature(const_cmp)]` to the crate attributes to enable
7+
//~| HELP: add `#![feature(const_cmp)]` to the crate attributes to enable
8+
//~| HELP: add `#![feature(const_cmp)]` to the crate attributes to enable
99
a == b
1010
//~^ ERROR: cannot call conditionally-const operator in constant functions
1111
//~| ERROR: `PartialEq` is not yet stable as a const trait

0 commit comments

Comments
 (0)