Crate dont_expand

Crate dont_expand 

Source
Expand description

This library provides macro implementations for macros found in the rust std library. The purpose of the macros in this library is to do nothing. The macros are intended to be imported as needed to shadow the std macros. This is useful when using cargo expand to see what a macro might be doing as it will effectively hide the typical expansion of the std macros which typically just pollute the output.

Included macros are: assert, assert_eq, assert_ne, cfg, column, compile_error, concat, dbg, debug_assert, debug_assert_eq, debug_assert_ne, env, eprint, eprintln, file, format, format_args, include, include_bytes, include_str, is_x86_feature_detected, line, matches, module_path, option_env, panic, print, println, thread_local, todo, unimplemented, unreachable, vec, write, writeln

And the following derive macros: Debug, Default, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord

The following example would only show the expansion of the Default macro

use dont_expand::{Debug, Clone};

#[derive(Debug, Clone, Default)]
struct Foo;

Glob imports don’t work with dont-expand as that throws an error by the compiler since they shadow the std macros.

Macros§

assert
assert_eq
assert_ne
cfg
column
compile_error
concat
dbg
debug_assert
debug_assert_eq
debug_assert_ne
env
eprint
eprintln
file
format
format_args
include
include_bytes
include_str
is_x86_feature_detected
line
matches
module_path
option_env
panic
print
println
thread_local
todo
unimplemented
unreachable
vec
write
writeln

Derive Macros§

Clone
Copy
Debug
Default
Eq
Hash
Ord
PartialEq
PartialOrd