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
3 changes: 1 addition & 2 deletions tests/ui/const-generics/issues/issue-88119.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ known-bug: #110395
//@ compile-flags: -Znext-solver
//@ check-pass
#![allow(incomplete_features)]
#![feature(const_trait_impl, generic_const_exprs)]

Expand Down
95 changes: 0 additions & 95 deletions tests/ui/const-generics/issues/issue-88119.stderr

This file was deleted.

11 changes: 0 additions & 11 deletions tests/ui/consts/rustc-impl-const-stability.stderr

This file was deleted.

59 changes: 0 additions & 59 deletions tests/ui/specialization/const_trait_impl.stderr

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
//@ known-bug: #110395
#![feature(derive_const)]
#![feature(const_default, derive_const)]

pub struct A;

impl std::fmt::Debug for A {
fn fmt(&self, _: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
panic!()
impl Default for A {
fn default() -> A {
A
}
}

#[derive_const(Debug)]
#[derive_const(Default)]
pub struct S(A);
//~^ ERROR: cannot call non-const associated function

fn main() {}
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
error: const `impl` for trait `Debug` which is not `const`
--> $DIR/derive-const-non-const-type.rs:12:16
error[E0015]: cannot call non-const associated function `<A as Default>::default` in constant functions
--> $DIR/derive-const-non-const-type.rs:12:14
|
LL | #[derive_const(Debug)]
| ^^^^^ this trait is not `const`
|
= note: marking a trait with `const` ensures all default method bodies are `const`
= note: adding a non-const method body in the future would be a breaking change

error[E0015]: cannot call non-const method `Formatter::<'_>::debug_tuple_field1_finish` in constant functions
--> $DIR/derive-const-non-const-type.rs:12:16
|
LL | #[derive_const(Debug)]
| ^^^^^
LL | #[derive_const(Default)]
| ------- in this derive macro expansion
LL | pub struct S(A);
| ^
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants

error: aborting due to 2 previous errors
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0015`.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ compile-flags: -Znext-solver
//@ known-bug: #110395
//@ check-pass

#![crate_type = "lib"]
#![feature(staged_api, const_trait_impl, const_default)]
Expand All @@ -12,8 +11,8 @@ pub struct Data {

#[stable(feature = "potato", since = "1.27.0")]
#[rustc_const_unstable(feature = "data_foo", issue = "none")]
impl const std::fmt::Debug for Data {
fn fmt(&self, _: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
Ok(())
impl const Default for Data {
fn default() -> Data {
Data { _data: 0xbeef }
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Tests that trait bounds on specializing trait impls must be `[const]` if the
// same bound is present on the default impl and is `[const]` there.
//@ known-bug: #110395
// FIXME(const_trait_impl) ^ should error

#![feature(const_trait_impl)]
#![feature(rustc_attrs)]
Expand All @@ -23,9 +21,9 @@ where
default fn bar() {}
}

impl<T> Bar for T
impl<T> Bar for T //~ ERROR conflicting implementations of trait `Bar`
where
T: Foo, //FIXME ~ ERROR missing `[const]` qualifier
T: Foo,
T: Specialize,
{
fn bar() {}
Expand All @@ -42,7 +40,7 @@ where
default fn baz() {}
}

impl<T> const Baz for T //FIXME ~ ERROR conflicting implementations of trait `Baz`
impl<T> const Baz for T //~ ERROR conflicting implementations of trait `Baz`
where
T: Foo,
T: Specialize,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `Bar`
--> $DIR/const-default-bound-non-const-specialized-bound.rs:26:1
--> $DIR/const-default-bound-non-const-specialized-bound.rs:24:1
|
LL | / impl<T> const Bar for T
LL | | where
Expand All @@ -8,19 +8,19 @@ LL | | T: [const] Foo,
...
LL | / impl<T> Bar for T
LL | | where
LL | | T: Foo, //FIXME ~ ERROR missing `[const]` qualifier
LL | | T: Foo,
LL | | T: Specialize,
| |__________________^ conflicting implementation

error[E0119]: conflicting implementations of trait `Baz`
--> $DIR/const-default-bound-non-const-specialized-bound.rs:45:1
--> $DIR/const-default-bound-non-const-specialized-bound.rs:43:1
|
LL | / impl<T> const Baz for T
LL | | where
LL | | T: [const] Foo,
| |___________________- first implementation here
...
LL | / impl<T> const Baz for T //FIXME ~ ERROR conflicting implementations of trait `Baz`
LL | / impl<T> const Baz for T
LL | | where
LL | | T: Foo,
LL | | T: Specialize,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//@ known-bug: #110395

#![feature(const_trait_impl, min_specialization, rustc_attrs)]

use std::fmt::Debug;
//@ check-pass
#![feature(const_trait_impl, const_default, min_specialization, rustc_attrs)]
#![allow(internal_features)]

#[rustc_specialization_trait]
pub const unsafe trait Sup {
Expand Down Expand Up @@ -30,19 +28,19 @@ pub const trait A {
fn a() -> u32;
}

impl<T: [const] Debug> const A for T {
impl<T: [const] Default> const A for T {
default fn a() -> u32 {
2
}
}

impl<T: [const] Debug + [const] Sup> const A for T {
impl<T: [const] Default + [const] Sup> const A for T {
default fn a() -> u32 {
3
}
}

impl<T: [const] Debug + [const] Sub> const A for T {
impl<T: [const] Default + [const] Sub> const A for T {
fn a() -> u32 {
T::foo()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![feature(const_trait_impl, min_specialization, rustc_attrs)]
//@ known-bug: #110395
#![allow(internal_features)]

#[rustc_specialization_trait]
pub const trait Sup {}

Expand All @@ -23,7 +24,7 @@ impl<T: Default + [const] Sup> const A for T {

const fn generic<T: Default>() {
<T as A>::a();
//FIXME ~^ ERROR: the trait bound `T: [const] Sup` is not satisfied
//~^ ERROR: the trait bound `T: [const] A` is not satisfied
}

fn main() {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `T: [const] A` is not satisfied
--> $DIR/specializing-constness-2.rs:25:6
--> $DIR/specializing-constness-2.rs:26:6
|
LL | <T as A>::a();
| ^
Expand Down
Loading