Skip to content

Commit 6404620

Browse files
authored
Rollup merge of rust-lang#98756 - TaKO8Ki:use-const-instead-of-function, r=Dylan-DPC
Use const instead of function and make it private
2 parents c0cf363 + f791ac6 commit 6404620

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

compiler/rustc_const_eval/src/const_eval/eval_queries.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ use rustc_target::abi::{self, Abi};
1919
use std::borrow::Cow;
2020
use std::convert::TryInto;
2121

22-
pub fn note_on_undefined_behavior_error() -> &'static str {
23-
"The rules on what exactly is undefined behavior aren't clear, \
22+
const NOTE_ON_UNDEFINED_BEHAVIOR_ERROR: &str = "The rules on what exactly is undefined behavior aren't clear, \
2423
so this check might be overzealous. Please open an issue on the rustc \
25-
repository if you believe it should not be considered undefined behavior."
26-
}
24+
repository if you believe it should not be considered undefined behavior.";
2725

2826
// Returns a pointer to where the result lives
2927
fn eval_body_using_ecx<'mir, 'tcx>(
@@ -375,7 +373,7 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
375373
ecx.tcx,
376374
"it is undefined behavior to use this value",
377375
|diag| {
378-
diag.note(note_on_undefined_behavior_error());
376+
diag.note(NOTE_ON_UNDEFINED_BEHAVIOR_ERROR);
379377
diag.note(&format!(
380378
"the raw bytes of the constant ({}",
381379
display_allocation(

0 commit comments

Comments
 (0)