use const instead of function and make it private
This commit is contained in:
parent
bf45371f26
commit
f791ac6a79
@ -19,11 +19,9 @@ use rustc_target::abi::{self, Abi};
|
|||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::convert::TryInto;
|
use std::convert::TryInto;
|
||||||
|
|
||||||
pub fn note_on_undefined_behavior_error() -> &'static str {
|
const NOTE_ON_UNDEFINED_BEHAVIOR_ERROR: &str = "The rules on what exactly is undefined behavior aren't clear, \
|
||||||
"The rules on what exactly is undefined behavior aren't clear, \
|
|
||||||
so this check might be overzealous. Please open an issue on the rustc \
|
so this check might be overzealous. Please open an issue on the rustc \
|
||||||
repository if you believe it should not be considered undefined behavior."
|
repository if you believe it should not be considered undefined behavior.";
|
||||||
}
|
|
||||||
|
|
||||||
// Returns a pointer to where the result lives
|
// Returns a pointer to where the result lives
|
||||||
fn eval_body_using_ecx<'mir, 'tcx>(
|
fn eval_body_using_ecx<'mir, 'tcx>(
|
||||||
@ -375,7 +373,7 @@ pub fn eval_to_allocation_raw_provider<'tcx>(
|
|||||||
ecx.tcx,
|
ecx.tcx,
|
||||||
"it is undefined behavior to use this value",
|
"it is undefined behavior to use this value",
|
||||||
|diag| {
|
|diag| {
|
||||||
diag.note(note_on_undefined_behavior_error());
|
diag.note(NOTE_ON_UNDEFINED_BEHAVIOR_ERROR);
|
||||||
diag.note(&format!(
|
diag.note(&format!(
|
||||||
"the raw bytes of the constant ({}",
|
"the raw bytes of the constant ({}",
|
||||||
display_allocation(
|
display_allocation(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user