attribute
A note to the compiler written #[...], such as #[test].
An attribute (#[...]) attaches metadata to the next item; #[test] marks a test and #[cfg(test)] compiles an item only in test builds.
Examples
#[test]marks a test function, and#[cfg(test)]compiles thetestsmodule only forcargo test.
See also