about summary refs log tree commit diff
path: root/tests/ui/consts
diff options
context:
space:
mode:
authorEvgenii Zheltonozhskii <zheltonozhskiy@gmail.com>2025-09-12 12:39:31 +0300
committerEvgenii Zheltonozhskii <zheltonozhskiy@gmail.com>2025-09-12 12:39:31 +0300
commitff9b1c1d285821fabe3cbf904fc407d62d95fbdc (patch)
tree03074c880ddea836894b59a24bd0ffb8f690e774 /tests/ui/consts
parent8e2ed71effd5f81bff319c0c7adaca42084e2a71 (diff)
downloadrust-ff9b1c1d285821fabe3cbf904fc407d62d95fbdc.tar.gz
rust-ff9b1c1d285821fabe3cbf904fc407d62d95fbdc.zip
Constify Eq, Ord, PartialOrd
Diffstat (limited to 'tests/ui/consts')
-rw-r--r--tests/ui/consts/const_cmp_type_id.rs5
-rw-r--r--tests/ui/consts/const_cmp_type_id.stderr8
-rw-r--r--tests/ui/consts/fn_trait_refs.rs3
-rw-r--r--tests/ui/consts/fn_trait_refs.stderr22
4 files changed, 5 insertions, 33 deletions
diff --git a/tests/ui/consts/const_cmp_type_id.rs b/tests/ui/consts/const_cmp_type_id.rs
index ff44876c5c4..dc0701d3b1d 100644
--- a/tests/ui/consts/const_cmp_type_id.rs
+++ b/tests/ui/consts/const_cmp_type_id.rs
@@ -9,8 +9,7 @@ fn main() {
         assert!(TypeId::of::<u8>() == TypeId::of::<u8>());
         assert!(TypeId::of::<()>() != TypeId::of::<u8>());
         let _a = TypeId::of::<u8>() < TypeId::of::<u16>();
-        //~^ ERROR: cannot call non-const operator in constants
-        // can't assert `_a` because it is not deterministic
-        // FIXME(const_trait_impl) make it pass
+        //~^ ERROR: the trait bound `TypeId: const PartialOrd` is not satisfied
+        // FIXME(const_trait_impl) make it pass; requires const comparison of pointers (#53020)
     }
 }
diff --git a/tests/ui/consts/const_cmp_type_id.stderr b/tests/ui/consts/const_cmp_type_id.stderr
index 05b94caef79..62a1677c0d9 100644
--- a/tests/ui/consts/const_cmp_type_id.stderr
+++ b/tests/ui/consts/const_cmp_type_id.stderr
@@ -1,13 +1,9 @@
-error[E0015]: cannot call non-const operator in constants
+error[E0277]: the trait bound `TypeId: const PartialOrd` is not satisfied
   --> $DIR/const_cmp_type_id.rs:11:18
    |
 LL |         let _a = TypeId::of::<u8>() < TypeId::of::<u16>();
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: impl defined here, but it is not `const`
-  --> $SRC_DIR/core/src/any.rs:LL:COL
-   = note: calls in constants are limited to constant functions, tuple structs and tuple variants
 
 error: aborting due to 1 previous error
 
-For more information about this error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/consts/fn_trait_refs.rs b/tests/ui/consts/fn_trait_refs.rs
index e475c0a1b6f..e4a62e18c7b 100644
--- a/tests/ui/consts/fn_trait_refs.rs
+++ b/tests/ui/consts/fn_trait_refs.rs
@@ -1,6 +1,5 @@
-//@ known-bug: #110395
+//@ check-pass
 
-#![feature(const_fn_trait_ref_impls)]
 #![feature(fn_traits)]
 #![feature(unboxed_closures)]
 #![feature(const_trait_impl)]
diff --git a/tests/ui/consts/fn_trait_refs.stderr b/tests/ui/consts/fn_trait_refs.stderr
deleted file mode 100644
index bbe0714801c..00000000000
--- a/tests/ui/consts/fn_trait_refs.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0635]: unknown feature `const_fn_trait_ref_impls`
-  --> $DIR/fn_trait_refs.rs:3:12
-   |
-LL | #![feature(const_fn_trait_ref_impls)]
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0277]: the trait bound `(i32, i32, i32): const PartialEq` is not satisfied
-  --> $DIR/fn_trait_refs.rs:71:17
-   |
-LL |         assert!(test_one == (1, 1, 1));
-   |                 ^^^^^^^^^^^^^^^^^^^^^
-
-error[E0277]: the trait bound `(i32, i32): const PartialEq` is not satisfied
-  --> $DIR/fn_trait_refs.rs:74:17
-   |
-LL |         assert!(test_two == (2, 2));
-   |                 ^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 3 previous errors
-
-Some errors have detailed explanations: E0277, E0635.
-For more information about an error, try `rustc --explain E0277`.