Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 0 additions & 2 deletions library/coretests/tests/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ fn test_convert() {
assert!(char::try_from(0xFFFF_FFFF_u32).is_err());
}

/* FIXME(#110395)
#[test]
const fn test_convert_const() {
assert!(u32::from('a') == 0x61);
Expand All @@ -31,7 +30,6 @@ const fn test_convert_const() {
assert!(char::from(b'a') == 'a');
assert!(char::from(b'\xFF') == '\u{FF}');
}
*/

#[test]
fn test_from_str() {
Expand Down
2 changes: 0 additions & 2 deletions library/coretests/tests/convert.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* FIXME(#110395)
#[test]
fn convert() {
const fn from(x: i32) -> i32 {
Expand All @@ -15,4 +14,3 @@ fn convert() {
const BAR: Vec<String> = into(Vec::new());
assert_eq!(BAR, Vec::<String>::new());
}
*/
2 changes: 2 additions & 0 deletions library/coretests/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
#![feature(const_deref)]
#![feature(const_destruct)]
#![feature(const_eval_select)]
#![feature(const_from)]
#![feature(const_ops)]
#![feature(const_option_ops)]
#![feature(const_ref_cell)]
#![feature(const_result_trait_fn)]
#![feature(const_trait_impl)]
Expand Down
2 changes: 0 additions & 2 deletions library/coretests/tests/nonzero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,11 @@ fn nonzero_const() {
const ONE: Option<NonZero<u8>> = NonZero::new(1);
assert!(ONE.is_some());

/* FIXME(#110395)
const FROM_NONZERO_U8: u8 = u8::from(NONZERO_U8);
assert_eq!(FROM_NONZERO_U8, 5);

const NONZERO_CONVERT: NonZero<u32> = NonZero::<u32>::from(NONZERO_U8);
assert_eq!(NONZERO_CONVERT.get(), 5);
*/
}

#[test]
Expand Down
2 changes: 0 additions & 2 deletions library/coretests/tests/num/const_from.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* FIXME(#110395)
#[test]
fn from() {
use core::convert::TryFrom;
Expand All @@ -24,4 +23,3 @@ fn from() {
const I16_FROM_U16: Result<i16, TryFromIntError> = i16::try_from(1u16);
assert_eq!(I16_FROM_U16, Ok(1i16));
}
*/
2 changes: 0 additions & 2 deletions library/coretests/tests/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ fn test_and() {
assert_eq!(x.and(Some(2)), None);
assert_eq!(x.and(None::<isize>), None);

/* FIXME(#110395)
const FOO: Option<isize> = Some(1);
const A: Option<isize> = FOO.and(Some(2));
const B: Option<isize> = FOO.and(None);
Expand All @@ -99,7 +98,6 @@ fn test_and() {
const D: Option<isize> = BAR.and(None);
assert_eq!(C, None);
assert_eq!(D, None);
*/
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/traits/const-traits/const-and-non-const-impl.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
//@ known-bug: #110395

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regressions in here has been fixed in #133237 but this label hasn't been updated

#![feature(const_trait_impl, const_ops)]

pub struct Int(i32);

impl const std::ops::Add for i32 {
//~^ ERROR only traits defined in the current crate can be implemented for primitive types
type Output = Self;

fn add(self, rhs: Self) -> Self {
Expand All @@ -21,6 +20,7 @@ impl std::ops::Add for Int {
}

impl const std::ops::Add for Int {
//~^ ERROR conflicting implementations of trait
type Output = Self;

fn add(self, rhs: Self) -> Self {
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/traits/const-traits/const-and-non-const-impl.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `Add` for type `Int`
--> $DIR/const-and-non-const-impl.rs:23:1
--> $DIR/const-and-non-const-impl.rs:22:1
|
LL | impl std::ops::Add for Int {
| -------------------------- first implementation here
Expand All @@ -8,7 +8,7 @@ LL | impl const std::ops::Add for Int {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Int`

error[E0117]: only traits defined in the current crate can be implemented for primitive types
--> $DIR/const-and-non-const-impl.rs:7:1
--> $DIR/const-and-non-const-impl.rs:5:1
|
LL | impl const std::ops::Add for i32 {
| ^^^^^^^^^^^-------------^^^^^---
Expand Down
Loading