about summary refs log tree commit diff
path: root/tests/ui/consts
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-11-05 20:10:52 +0100
committerGitHub <noreply@github.com>2024-11-05 20:10:52 +0100
commitaa4fe48afe5c2e9062d702e187b7cb366b5aa33e (patch)
tree9ebd6803a69d38577d9bb173a5cd390091457db1 /tests/ui/consts
parentbb50ebfca41c76c2f0a105dcfb25286013da7834 (diff)
parent613f53ef19c94e461428dff1df3db7fe9bed5fb9 (diff)
downloadrust-aa4fe48afe5c2e9062d702e187b7cb366b5aa33e.tar.gz
rust-aa4fe48afe5c2e9062d702e187b7cb366b5aa33e.zip
Rollup merge of #132571 - RalfJung:const_eval_select_macro, r=oli-obk
add const_eval_select macro to reduce redundancy

I played around a bit with a macro to make const_eval_select invocations look a bit nicer and avoid repeating the argument lists. Here's what I got. What do you think?

I didn't apply this everywhere yet because I wanted to gather feedback first.

The second commit moves the macros from https://github.com/rust-lang/rust/pull/132542 into a more sensible place. It didn't seem worth its own PR and would conflict with this PR if done separately.

Cc ``@oli-obk`` ``@saethlin`` ``@tgross35``

try-job: dist-aarch64-msvc
Diffstat (limited to 'tests/ui/consts')
-rw-r--r--tests/ui/consts/const-ptr-is-null.stderr4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/ui/consts/const-ptr-is-null.stderr b/tests/ui/consts/const-ptr-is-null.stderr
index 20e44a1401f..5fd35142818 100644
--- a/tests/ui/consts/const-ptr-is-null.stderr
+++ b/tests/ui/consts/const-ptr-is-null.stderr
@@ -3,7 +3,7 @@ error[E0080]: evaluation of constant value failed
    |
    = note: the evaluated program panicked at 'null-ness of this pointer cannot be determined in const context', $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
    |
-note: inside `std::ptr::const_ptr::<impl *const T>::is_null::const_impl`
+note: inside `std::ptr::const_ptr::<impl *const T>::is_null::compiletime`
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
 note: inside `std::ptr::const_ptr::<impl *const i32>::is_null`
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
@@ -12,7 +12,7 @@ note: inside `MAYBE_NULL`
    |
 LL |     assert!(!ptr.wrapping_sub(512).is_null());
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
+   = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `const_eval_select` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 1 previous error