Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 78db9d1

Browse files
committedFeb 12, 2025·
Update tests
1 parent 4f8d6cb commit 78db9d1

File tree

7 files changed

+24
-23
lines changed

7 files changed

+24
-23
lines changed
 

‎tests/ui/traits/const-traits/const-traits-alloc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-pass
2-
#![feature(const_trait_impl)]
2+
#![feature(const_trait_impl, const_default)]
33
#![allow(dead_code)]
44
// alloc::string
55
const STRING: String = Default::default();

‎tests/ui/traits/const-traits/const-traits-core.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//@ run-pass
2-
#![feature(const_trait_impl, ptr_alignment_type, ascii_char, f16, f128, sync_unsafe_cell)]
2+
#![feature(
3+
const_default, const_trait_impl, ptr_alignment_type, ascii_char, f16, f128, sync_unsafe_cell,
4+
)]
35
#![allow(dead_code)]
46
// core::default
57
const UNIT: () = Default::default();

‎tests/ui/traits/const-traits/const_derives/derive-const-use.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ known-bug: #110395
22

3-
#![feature(const_trait_impl, const_cmp, const_default_impls, derive_const)]
3+
#![feature(const_trait_impl, const_cmp, const_default, derive_const)]
44

55
pub struct A;
66

‎tests/ui/traits/const-traits/const_derives/derive-const-use.stderr

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
error[E0635]: unknown feature `const_cmp`
22
--> $DIR/derive-const-use.rs:3:30
33
|
4-
LL | #![feature(const_trait_impl, const_cmp, const_default_impls, derive_const)]
4+
LL | #![feature(const_trait_impl, const_cmp, const_default, derive_const)]
55
| ^^^^^^^^^
66

7-
error[E0635]: unknown feature `const_default_impls`
8-
--> $DIR/derive-const-use.rs:3:41
9-
|
10-
LL | #![feature(const_trait_impl, const_cmp, const_default_impls, derive_const)]
11-
| ^^^^^^^^^^^^^^^^^^^
12-
137
error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]`
148
--> $DIR/derive-const-use.rs:11:12
159
|
@@ -59,7 +53,7 @@ LL | pub struct S((), A);
5953
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
6054
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
6155

62-
error: aborting due to 7 previous errors
56+
error: aborting due to 6 previous errors
6357

6458
Some errors have detailed explanations: E0015, E0635.
6559
For more information about an error, try `rustc --explain E0015`.

‎tests/ui/traits/const-traits/std-impl-gate.gated.stderr

-9
This file was deleted.

‎tests/ui/traits/const-traits/std-impl-gate.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
//@ revisions: stock gated
44
//@[gated] known-bug: #110395
5+
//@[gated] run-pass
56

6-
#![cfg_attr(gated, feature(const_trait_impl, const_default_impls))]
7+
#![cfg_attr(gated, feature(const_trait_impl, const_default))]
78

89
fn non_const_context() -> Vec<usize> {
910
Default::default()
@@ -12,6 +13,7 @@ fn non_const_context() -> Vec<usize> {
1213
const fn const_context() -> Vec<usize> {
1314
Default::default()
1415
//[stock]~^ ERROR cannot call conditionally-const associated function
16+
//[stock]~| ERROR `Default` is not yet stable as a const trait
1517
}
1618

1719
fn main() {
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
error[E0658]: cannot call conditionally-const associated function `<Vec<usize> as Default>::default` in constant functions
2-
--> $DIR/std-impl-gate.rs:13:5
2+
--> $DIR/std-impl-gate.rs:14:5
33
|
44
LL | Default::default()
55
| ^^^^^^^^^^^^^^^^^^
66
|
7+
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
78
= note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
89
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
910
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1011

11-
error: aborting due to 1 previous error
12+
error: `Default` is not yet stable as a const trait
13+
--> $DIR/std-impl-gate.rs:14:5
14+
|
15+
LL | Default::default()
16+
| ^^^^^^^^^^^^^^^^^^
17+
|
18+
help: add `#![feature(const_default)]` to the crate attributes to enable
19+
|
20+
LL + #![feature(const_default)]
21+
|
22+
23+
error: aborting due to 2 previous errors
1224

1325
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)
Please sign in to comment.