mitigate additional debuginfo expansions
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -10,6 +10,7 @@ use crate::{Err, Error, Result, debug::type_name, err};
|
||||
|
||||
/// Checked arithmetic expression. Returns a Result<R, Error::Arithmetic>
|
||||
#[macro_export]
|
||||
#[collapse_debuginfo(yes)]
|
||||
macro_rules! checked {
|
||||
($($input:tt)+) => {
|
||||
$crate::utils::math::checked_ops!($($input)+)
|
||||
@@ -22,6 +23,7 @@ macro_rules! checked {
|
||||
/// has no realistic expectation for error and no interest in cluttering the
|
||||
/// callsite with result handling from checked!.
|
||||
#[macro_export]
|
||||
#[collapse_debuginfo(yes)]
|
||||
macro_rules! expected {
|
||||
($msg:literal, $($input:tt)+) => {
|
||||
$crate::checked!($($input)+).expect($msg)
|
||||
@@ -37,6 +39,7 @@ macro_rules! expected {
|
||||
/// regression analysis.
|
||||
#[cfg(not(debug_assertions))]
|
||||
#[macro_export]
|
||||
#[collapse_debuginfo(yes)]
|
||||
macro_rules! validated {
|
||||
($($input:tt)+) => {
|
||||
//#[allow(clippy::arithmetic_side_effects)] {
|
||||
@@ -53,6 +56,7 @@ macro_rules! validated {
|
||||
/// the expression is obviously safe. The check is elided in release-mode.
|
||||
#[cfg(debug_assertions)]
|
||||
#[macro_export]
|
||||
#[collapse_debuginfo(yes)]
|
||||
macro_rules! validated {
|
||||
($($input:tt)+) => { $crate::expected!($($input)+) }
|
||||
}
|
||||
|
||||
@@ -173,7 +173,6 @@ macro_rules! is_equal {
|
||||
|
||||
/// Functor for |x| *x.$i
|
||||
#[macro_export]
|
||||
#[collapse_debuginfo(yes)]
|
||||
macro_rules! deref_at {
|
||||
($idx:tt) => {
|
||||
|t| *t.$idx
|
||||
@@ -182,7 +181,6 @@ macro_rules! deref_at {
|
||||
|
||||
/// Functor for |ref x| x.$i
|
||||
#[macro_export]
|
||||
#[collapse_debuginfo(yes)]
|
||||
macro_rules! ref_at {
|
||||
($idx:tt) => {
|
||||
|ref t| &t.$idx
|
||||
@@ -191,7 +189,6 @@ macro_rules! ref_at {
|
||||
|
||||
/// Functor for |&x| x.$i
|
||||
#[macro_export]
|
||||
#[collapse_debuginfo(yes)]
|
||||
macro_rules! val_at {
|
||||
($idx:tt) => {
|
||||
|&t| t.$idx
|
||||
@@ -200,7 +197,6 @@ macro_rules! val_at {
|
||||
|
||||
/// Functor for |x| x.$i
|
||||
#[macro_export]
|
||||
#[collapse_debuginfo(yes)]
|
||||
macro_rules! at {
|
||||
($idx:tt) => {
|
||||
|t| t.$idx
|
||||
|
||||
@@ -14,6 +14,7 @@ pub const EMPTY: &str = "";
|
||||
/// returned otherwise the input (i.e. &'static str) is returned. If multiple
|
||||
/// arguments are provided the first is assumed to be a format string.
|
||||
#[macro_export]
|
||||
#[collapse_debuginfo(yes)]
|
||||
macro_rules! format_maybe {
|
||||
($s:literal $(,)?) => {
|
||||
if $crate::is_format!($s) { std::format!($s).into() } else { $s.into() }
|
||||
@@ -27,6 +28,7 @@ macro_rules! format_maybe {
|
||||
/// Constant expression to decide if a literal is a format string. Note: could
|
||||
/// use some improvement.
|
||||
#[macro_export]
|
||||
#[collapse_debuginfo(yes)]
|
||||
macro_rules! is_format {
|
||||
($s:literal) => {
|
||||
::const_str::contains!($s, "{") && ::const_str::contains!($s, "}")
|
||||
|
||||
@@ -117,7 +117,7 @@ pub fn name_from_path(path: &Path) -> Result<String> {
|
||||
|
||||
/// Get the (major, minor) of the block device on which Path is mounted.
|
||||
#[allow(clippy::useless_conversion, clippy::unnecessary_fallible_conversions)]
|
||||
pub fn dev_from_path(path: &Path) -> Result<(dev_t, dev_t)> {
|
||||
fn dev_from_path(path: &Path) -> Result<(dev_t, dev_t)> {
|
||||
#[cfg(target_family = "unix")]
|
||||
use std::os::unix::fs::MetadataExt;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user