about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorBoxy <rust@boxyuwu.dev>2025-08-06 13:51:50 +0100
committerBoxy <rust@boxyuwu.dev>2025-08-06 16:55:50 +0100
commit7bc34622f037fedf3cf15c4a6beea1b40494cb2f (patch)
treecef0c0a6a0bb035a176c63b6ac53e5b335cd6390 /tests
parent351e4bd1066a9d89b4d9f06c628ba0733c1850b5 (diff)
downloadrust-7bc34622f037fedf3cf15c4a6beea1b40494cb2f.tar.gz
rust-7bc34622f037fedf3cf15c4a6beea1b40494cb2f.zip
tidy
Diffstat (limited to 'tests')
-rw-r--r--tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-disabled.stderr26
-rw-r--r--tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-enabled.stderr18
-rw-r--r--tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-disabled.stderr28
-rw-r--r--tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-enabled.stderr20
-rw-r--r--tests/run-make/const-trait-stable-toolchain/const-super-trait.rs4
5 files changed, 48 insertions, 48 deletions
diff --git a/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-disabled.stderr b/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-disabled.stderr
index 464208f989e..895558f3b0f 100644
--- a/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-disabled.stderr
+++ b/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-disabled.stderr
@@ -1,20 +1,20 @@
 error: `[const]` is not allowed here
   --> const-super-trait.rs:7:12
    |
-LL | trait Bar: ~const Foo {}
-   |            ^^^^^^
+LL | trait Bar: [const] Foo {}
+   |            ^^^^^^^
    |
 note: this trait is not `const`, so it cannot have `[const]` trait bounds
   --> const-super-trait.rs:7:1
    |
-LL | trait Bar: ~const Foo {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^
+LL | trait Bar: [const] Foo {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0658]: const trait impls are experimental
   --> const-super-trait.rs:7:12
    |
-LL | trait Bar: ~const Foo {}
-   |            ^^^^^^
+LL | trait Bar: [const] Foo {}
+   |            ^^^^^^^
    |
    = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
@@ -23,8 +23,8 @@ LL | trait Bar: ~const Foo {}
 error[E0658]: const trait impls are experimental
   --> const-super-trait.rs:9:17
    |
-LL | const fn foo<T: ~const Bar>(x: &T) {
-   |                 ^^^^^^
+LL | const fn foo<T: [const] Bar>(x: &T) {
+   |                 ^^^^^^^
    |
    = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
@@ -33,8 +33,8 @@ LL | const fn foo<T: ~const Bar>(x: &T) {
 error: `[const]` can only be applied to `const` traits
   --> const-super-trait.rs:7:12
    |
-LL | trait Bar: ~const Foo {}
-   |            ^^^^^^ can't be applied to `Foo`
+LL | trait Bar: [const] Foo {}
+   |            ^^^^^^^ can't be applied to `Foo`
    |
 help: enable `#![feature(const_trait_impl)]` in your crate and mark `Foo` as `const` to allow it to have `const` implementations
    |
@@ -44,12 +44,12 @@ LL | #[const_trait] trait Foo {
 error: `[const]` can only be applied to `const` traits
   --> const-super-trait.rs:9:17
    |
-LL | const fn foo<T: ~const Bar>(x: &T) {
-   |                 ^^^^^^ can't be applied to `Bar`
+LL | const fn foo<T: [const] Bar>(x: &T) {
+   |                 ^^^^^^^ can't be applied to `Bar`
    |
 help: enable `#![feature(const_trait_impl)]` in your crate and mark `Bar` as `const` to allow it to have `const` implementations
    |
-LL | #[const_trait] trait Bar: ~const Foo {}
+LL | #[const_trait] trait Bar: [const] Foo {}
    | ++++++++++++++
 
 error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
diff --git a/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-enabled.stderr b/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-enabled.stderr
index 569e559186f..821ab6fa57c 100644
--- a/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-enabled.stderr
+++ b/tests/run-make/const-trait-stable-toolchain/const-super-trait-nightly-enabled.stderr
@@ -1,20 +1,20 @@
 error: `[const]` is not allowed here
   --> const-super-trait.rs:7:12
    |
-LL | trait Bar: ~const Foo {}
-   |            ^^^^^^
+LL | trait Bar: [const] Foo {}
+   |            ^^^^^^^
    |
 note: this trait is not `const`, so it cannot have `[const]` trait bounds
   --> const-super-trait.rs:7:1
    |
-LL | trait Bar: ~const Foo {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^
+LL | trait Bar: [const] Foo {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: `[const]` can only be applied to `const` traits
   --> const-super-trait.rs:7:12
    |
-LL | trait Bar: ~const Foo {}
-   |            ^^^^^^ can't be applied to `Foo`
+LL | trait Bar: [const] Foo {}
+   |            ^^^^^^^ can't be applied to `Foo`
    |
 help: mark `Foo` as `const` to allow it to have `const` implementations
    |
@@ -24,12 +24,12 @@ LL | #[const_trait] trait Foo {
 error: `[const]` can only be applied to `const` traits
   --> const-super-trait.rs:9:17
    |
-LL | const fn foo<T: ~const Bar>(x: &T) {
-   |                 ^^^^^^ can't be applied to `Bar`
+LL | const fn foo<T: [const] Bar>(x: &T) {
+   |                 ^^^^^^^ can't be applied to `Bar`
    |
 help: mark `Bar` as `const` to allow it to have `const` implementations
    |
-LL | #[const_trait] trait Bar: ~const Foo {}
+LL | #[const_trait] trait Bar: [const] Foo {}
    | ++++++++++++++
 
 error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
diff --git a/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-disabled.stderr b/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-disabled.stderr
index 694e06fb6ea..b39be78e438 100644
--- a/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-disabled.stderr
+++ b/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-disabled.stderr
@@ -1,36 +1,36 @@
 error: `[const]` is not allowed here
  --> const-super-trait.rs:7:12
   |
-7 | trait Bar: ~const Foo {}
-  |            ^^^^^^
+7 | trait Bar: [const] Foo {}
+  |            ^^^^^^^
   |
 note: this trait is not `const`, so it cannot have `[const]` trait bounds
  --> const-super-trait.rs:7:1
   |
-7 | trait Bar: ~const Foo {}
-  | ^^^^^^^^^^^^^^^^^^^^^^^^
+7 | trait Bar: [const] Foo {}
+  | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0658]: const trait impls are experimental
  --> const-super-trait.rs:7:12
   |
-7 | trait Bar: ~const Foo {}
-  |            ^^^^^^
+7 | trait Bar: [const] Foo {}
+  |            ^^^^^^^
   |
   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
 
 error[E0658]: const trait impls are experimental
  --> const-super-trait.rs:9:17
   |
-9 | const fn foo<T: ~const Bar>(x: &T) {
-  |                 ^^^^^^
+9 | const fn foo<T: [const] Bar>(x: &T) {
+  |                 ^^^^^^^
   |
   = note: see issue #143874 <https://github.com/rust-lang/rust/issues/143874> for more information
 
 error: `[const]` can only be applied to `const` traits
  --> const-super-trait.rs:7:12
   |
-7 | trait Bar: ~const Foo {}
-  |            ^^^^^^ can't be applied to `Foo`
+7 | trait Bar: [const] Foo {}
+  |            ^^^^^^^ can't be applied to `Foo`
   |
 note: `Foo` can't be used with `[const]` because it isn't `const`
  --> const-super-trait.rs:3:1
@@ -41,14 +41,14 @@ note: `Foo` can't be used with `[const]` because it isn't `const`
 error: `[const]` can only be applied to `const` traits
  --> const-super-trait.rs:9:17
   |
-9 | const fn foo<T: ~const Bar>(x: &T) {
-  |                 ^^^^^^ can't be applied to `Bar`
+9 | const fn foo<T: [const] Bar>(x: &T) {
+  |                 ^^^^^^^ can't be applied to `Bar`
   |
 note: `Bar` can't be used with `[const]` because it isn't `const`
  --> const-super-trait.rs:7:1
   |
-7 | trait Bar: ~const Foo {}
-  | ^^^^^^^^^^^^^^^^^^^^^
+7 | trait Bar: [const] Foo {}
+  | ^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
   --> const-super-trait.rs:10:7
diff --git a/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-enabled.stderr b/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-enabled.stderr
index 2109f0deb72..30ee5cf6f4b 100644
--- a/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-enabled.stderr
+++ b/tests/run-make/const-trait-stable-toolchain/const-super-trait-stable-enabled.stderr
@@ -1,14 +1,14 @@
 error: `[const]` is not allowed here
  --> const-super-trait.rs:7:12
   |
-7 | trait Bar: ~const Foo {}
-  |            ^^^^^^
+7 | trait Bar: [const] Foo {}
+  |            ^^^^^^^
   |
 note: this trait is not `const`, so it cannot have `[const]` trait bounds
  --> const-super-trait.rs:7:1
   |
-7 | trait Bar: ~const Foo {}
-  | ^^^^^^^^^^^^^^^^^^^^^^^^
+7 | trait Bar: [const] Foo {}
+  | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0554]: `#![feature]` may not be used on the NIGHTLY release channel
  --> const-super-trait.rs:1:30
@@ -19,8 +19,8 @@ error[E0554]: `#![feature]` may not be used on the NIGHTLY release channel
 error: `[const]` can only be applied to `const` traits
  --> const-super-trait.rs:7:12
   |
-7 | trait Bar: ~const Foo {}
-  |            ^^^^^^ can't be applied to `Foo`
+7 | trait Bar: [const] Foo {}
+  |            ^^^^^^^ can't be applied to `Foo`
   |
 note: `Foo` can't be used with `[const]` because it isn't `const`
  --> const-super-trait.rs:3:1
@@ -31,14 +31,14 @@ note: `Foo` can't be used with `[const]` because it isn't `const`
 error: `[const]` can only be applied to `const` traits
  --> const-super-trait.rs:9:17
   |
-9 | const fn foo<T: ~const Bar>(x: &T) {
-  |                 ^^^^^^ can't be applied to `Bar`
+9 | const fn foo<T: [const] Bar>(x: &T) {
+  |                 ^^^^^^^ can't be applied to `Bar`
   |
 note: `Bar` can't be used with `[const]` because it isn't `const`
  --> const-super-trait.rs:7:1
   |
-7 | trait Bar: ~const Foo {}
-  | ^^^^^^^^^^^^^^^^^^^^^
+7 | trait Bar: [const] Foo {}
+  | ^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0015]: cannot call non-const method `<T as Foo>::a` in constant functions
   --> const-super-trait.rs:10:7
diff --git a/tests/run-make/const-trait-stable-toolchain/const-super-trait.rs b/tests/run-make/const-trait-stable-toolchain/const-super-trait.rs
index b2ee96d79f7..2371dfc0e6d 100644
--- a/tests/run-make/const-trait-stable-toolchain/const-super-trait.rs
+++ b/tests/run-make/const-trait-stable-toolchain/const-super-trait.rs
@@ -4,9 +4,9 @@ trait Foo {
     fn a(&self);
 }
 
-trait Bar: ~const Foo {}
+trait Bar: [const] Foo {}
 
-const fn foo<T: ~const Bar>(x: &T) {
+const fn foo<T: [const] Bar>(x: &T) {
     x.a();
 }