AMBIGUOUS_PANIC_IMPORTS in rustc_lint_defs::builtin - Rust
Description: The `ambiguous_panic_imports` lint detects ambiguous core and std panic imports, but previously didn’t do that due to `#[macro_use]` prelude macro import.

Skip to main content

## AMBIGUOUS_PANIC_IMPORTS

# Static AMBIGUOUS_PANIC_IMPORTS

Source

    pub static AMBIGUOUS_PANIC_IMPORTS: &Lint

Expand description

The `ambiguous_panic_imports` lint detects ambiguous core and std panic imports, but previously didn’t do that due to `#[macro_use]` prelude macro import.

#### §Example

ⓘ

    #![deny(ambiguous_panic_imports)]
    #![no_std]

    extern crate std;
    use std::prelude::v1::*;

    fn xx() {
        panic!(); // resolves to core::panic
    }

{{produces}}

#### §Explanation

Future versions of Rust will no longer accept the ambiguous resolution.

This is a future-incompatible lint to transition this to a hard error in the future.