Make language clearer (#2383)
This commit is contained in:
parent
fa4241f4f8
commit
d4101a671c
@ -83,7 +83,7 @@ impl Tokens {
|
|||||||
let mut head = 0;
|
let mut head = 0;
|
||||||
loop {
|
loop {
|
||||||
if head >= size {
|
if head >= size {
|
||||||
// Sanity Check
|
// Make double sure this is not completely off
|
||||||
assert!(head == size);
|
assert!(head == size);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -243,11 +243,11 @@ pub mod macros {
|
|||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! require_index_tracking {
|
macro_rules! require_index_tracking {
|
||||||
($name: literal, $obs: ident) => {
|
($name: literal, $obs: ident) => {
|
||||||
struct SanityCheck<O: $crate::observers::CanTrack> {
|
struct TrackingEnabledCheck<O: $crate::observers::CanTrack> {
|
||||||
phantom: ::core::marker::PhantomData<O>,
|
phantom: ::core::marker::PhantomData<O>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<O: $crate::observers::CanTrack> SanityCheck<O> {
|
impl<O: $crate::observers::CanTrack> TrackingEnabledCheck<O> {
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
const MESSAGE: &'static str = {
|
const MESSAGE: &'static str = {
|
||||||
const LINE_OFFSET: usize = line!().ilog10() as usize + 2;
|
const LINE_OFFSET: usize = line!().ilog10() as usize + 2;
|
||||||
@ -263,7 +263,7 @@ pub mod macros {
|
|||||||
SPACING, "| ",
|
SPACING, "| ",
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
const TRACKING_SANITY: bool = {
|
const TRACKING_ENABLED: bool = {
|
||||||
if !O::INDICES {
|
if !O::INDICES {
|
||||||
panic!("{}", Self::MESSAGE)
|
panic!("{}", Self::MESSAGE)
|
||||||
} else {
|
} else {
|
||||||
@ -272,13 +272,13 @@ pub mod macros {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn check_sanity() {
|
fn check_enabled() {
|
||||||
if !Self::TRACKING_SANITY {
|
if !Self::TRACKING_ENABLED {
|
||||||
unreachable!("{}", Self::MESSAGE);
|
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_export]
|
||||||
macro_rules! require_novelties_tracking {
|
macro_rules! require_novelties_tracking {
|
||||||
($name: literal, $obs: ident) => {
|
($name: literal, $obs: ident) => {
|
||||||
struct SanityCheck<O: $crate::observers::CanTrack> {
|
struct TrackingEnabledCheck<O: $crate::observers::CanTrack> {
|
||||||
phantom: ::core::marker::PhantomData<O>,
|
phantom: ::core::marker::PhantomData<O>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<O: $crate::observers::CanTrack> SanityCheck<O> {
|
impl<O: $crate::observers::CanTrack> TrackingEnabledCheck<O> {
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
const MESSAGE: &'static str = {
|
const MESSAGE: &'static str = {
|
||||||
const LINE_OFFSET: usize = line!().ilog10() as usize + 2;
|
const LINE_OFFSET: usize = line!().ilog10() as usize + 2;
|
||||||
@ -327,7 +327,7 @@ pub mod macros {
|
|||||||
SPACING, "| ",
|
SPACING, "| ",
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
const TRACKING_SANITY: bool = {
|
const TRACKING_ENABLED: bool = {
|
||||||
if !O::NOVELTIES {
|
if !O::NOVELTIES {
|
||||||
panic!("{}", Self::MESSAGE)
|
panic!("{}", Self::MESSAGE)
|
||||||
} else {
|
} else {
|
||||||
@ -336,13 +336,13 @@ pub mod macros {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn check_sanity() {
|
fn check_enabled() {
|
||||||
if !Self::TRACKING_SANITY {
|
if !Self::TRACKING_ENABLED {
|
||||||
unreachable!("{}", Self::MESSAGE);
|
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
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,7 @@ impl CoverageRuntime {
|
|||||||
//
|
//
|
||||||
// Since we also need to spill some registers in order to update our
|
// 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
|
// 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
|
// code writer so that we can overwrite the so-called "restoration
|
||||||
// prologue".
|
// prologue".
|
||||||
#[cfg(target_arch = "aarch64")]
|
#[cfg(target_arch = "aarch64")]
|
||||||
|
@ -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![];
|
let mut objects = vec![];
|
||||||
|
@ -78,7 +78,7 @@ use walkdir::{DirEntry, WalkDir};
|
|||||||
use which::which;
|
use which::which;
|
||||||
|
|
||||||
async fn run_cargo_fmt(path: PathBuf, is_check: bool, verbose: bool) -> io::Result<()> {
|
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");
|
assert_eq!(path.file_name().unwrap().to_str().unwrap(), "Cargo.toml");
|
||||||
|
|
||||||
let task_str = if is_check { "Checking" } else { "Formatting" };
|
let task_str = if is_check { "Checking" } else { "Formatting" };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user