unused_imports

The compiler provides a unused_imports lint that will warn about unused imports. An attribute can be used to disable the lint.

// `#[allow(unused_imports)]` is an attribute that disables the `unused_imports` lint
use core::num::traits::ops::checked::CheckedAdd;
#[allow(unused_imports)]
use core::num::traits::ops::checked::CheckedSub;
use core::num::traits::ops::wrapping::WrappingMul;
// FIXME ^ Add an attribute to suppress the warning

fn main() {
    2_u8.checked_add(1).unwrap();
}

Note that in real programs, you should eliminate dead code. In these examples we'll allow dead code in some places because of the interactive nature of the examples.