File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
compiler/rustc_const_eval/src/const_eval Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,9 @@ use rustc_target::abi::{self, Abi};
19
19
use std::borrow::Cow;
20
20
use std::convert::TryInto;
21
21
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, \
24
23
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.";
27
25
28
26
// Returns a pointer to where the result lives
29
27
fn eval_body_using_ecx<'mir, 'tcx>(
@@ -375,7 +373,7 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
375
373
ecx.tcx,
376
374
"it is undefined behavior to use this value",
377
375
|diag| {
378
- diag.note(note_on_undefined_behavior_error() );
376
+ diag.note(NOTE_ON_UNDEFINED_BEHAVIOR_ERROR );
379
377
diag.note(&format!(
380
378
"the raw bytes of the constant ({}",
381
379
display_allocation(
You can’t perform that action at this time.
0 commit comments