Make language clearer (#2383)

This commit is contained in:
Dominik Maier 2024-07-12 13:04:49 +02:00 committed by GitHub
parent fa4241f4f8
commit d4101a671c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 16 additions and 16 deletions

View File

@ -83,7 +83,7 @@ impl Tokens {
let mut head = 0;
loop {
if head >= size {
// Sanity Check
// Make double sure this is not completely off
assert!(head == size);
break;
}

View File

@ -243,11 +243,11 @@ pub mod macros {
#[macro_export]
macro_rules! require_index_tracking {
($name: literal, $obs: ident) => {
struct SanityCheck<O: $crate::observers::CanTrack> {
struct TrackingEnabledCheck<O: $crate::observers::CanTrack> {
phantom: ::core::marker::PhantomData<O>,
}
impl<O: $crate::observers::CanTrack> SanityCheck<O> {
impl<O: $crate::observers::CanTrack> TrackingEnabledCheck<O> {
#[rustfmt::skip]
const MESSAGE: &'static str = {
const LINE_OFFSET: usize = line!().ilog10() as usize + 2;
@ -263,7 +263,7 @@ pub mod macros {
SPACING, "| ",
)
};
const TRACKING_SANITY: bool = {
const TRACKING_ENABLED: bool = {
if !O::INDICES {
panic!("{}", Self::MESSAGE)
} else {
@ -272,13 +272,13 @@ pub mod macros {
};
#[inline(always)]
fn check_sanity() {
if !Self::TRACKING_SANITY {
fn check_enabled() {
if !Self::TRACKING_ENABLED {
unreachable!("{}", Self::MESSAGE);
}
}
}
SanityCheck::<$obs>::check_sanity(); // check that tracking is enabled for this map
TrackingEnabledCheck::<$obs>::check_enabled(); // check that tracking is enabled for this map
};
}
@ -306,11 +306,11 @@ pub mod macros {
#[macro_export]
macro_rules! require_novelties_tracking {
($name: literal, $obs: ident) => {
struct SanityCheck<O: $crate::observers::CanTrack> {
struct TrackingEnabledCheck<O: $crate::observers::CanTrack> {
phantom: ::core::marker::PhantomData<O>,
}
impl<O: $crate::observers::CanTrack> SanityCheck<O> {
impl<O: $crate::observers::CanTrack> TrackingEnabledCheck<O> {
#[rustfmt::skip]
const MESSAGE: &'static str = {
const LINE_OFFSET: usize = line!().ilog10() as usize + 2;
@ -327,7 +327,7 @@ pub mod macros {
SPACING, "| ",
)
};
const TRACKING_SANITY: bool = {
const TRACKING_ENABLED: bool = {
if !O::NOVELTIES {
panic!("{}", Self::MESSAGE)
} else {
@ -336,13 +336,13 @@ pub mod macros {
};
#[inline(always)]
fn check_sanity() {
if !Self::TRACKING_SANITY {
fn check_enabled() {
if !Self::TRACKING_ENABLED {
unreachable!("{}", Self::MESSAGE);
}
}
}
SanityCheck::<$obs>::check_sanity(); // check that tracking is enabled for this map
TrackingEnabledCheck::<$obs>::check_enabled(); // check that tracking is enabled for this map
};
}
}

View File

@ -202,7 +202,7 @@ impl CoverageRuntime {
//
// Since we also need to spill some registers in order to update our
// coverage map, in the event of a long branch, we can simply re-use
// these spilt registers. This, however, means we need to retard the
// these spilt registers. This, however, means we need to reset the
// code writer so that we can overwrite the so-called "restoration
// prologue".
#[cfg(target_arch = "aarch64")]

View File

@ -430,7 +430,7 @@ pub fn build(
);
}
assert!(output_lib.is_file()); // Sanity check
assert!(output_lib.is_file()); // Make sure this isn't very very wrong
/*
let mut objects = vec![];

View File

@ -78,7 +78,7 @@ use walkdir::{DirEntry, WalkDir};
use which::which;
async fn run_cargo_fmt(path: PathBuf, is_check: bool, verbose: bool) -> io::Result<()> {
// Sanity Check
// Make sure we parse the correct file
assert_eq!(path.file_name().unwrap().to_str().unwrap(), "Cargo.toml");
let task_str = if is_check { "Checking" } else { "Formatting" };