Allow
Dead code
The #[allow(dead_code)]
annotation disables warnings which are emitted by the compiler for code that is unused.
#[allow(dead_code)]
fn unused_function() {}
Deprecated
The #[allow(deprecated)]
annotation disables warnings which are emitted by the compiler for usage of deprecated items.
#[deprecated(note = "this is deprecated")]
struct DeprecatedStruct {}
#[allow(deprecated)]
fn using_deprecated_struct() {
let _ = DeprecatedStruct {};
}