rust-lang/rust

Import regression with `use_extern_macros`

petrochenkov opened this issue · 1 comments

Found by running our test suite with use_extern_macros enabled.

With use_extern_macros disabled:

use std::panic::{self, AssertUnwindSafe}; // OK

fn main() {
    panic!();
}

With use_extern_macros enabled:

#![feature(use_extern_macros)]

use std::panic::{self, AssertUnwindSafe}; // ERROR `self` no longer imports values

fn main() {
    panic!(); // Curiously, the error disappears if this panic is removed
}

I haven't investigated what happens yet.
use a::b::{self}; should filter away all namespaces except for type, and it should report an error only if nothing is left.
In the example with use std::panic::{self}; above only the panic module should be imported (without an error).

#50760 partially fixes this, but here is an example that still causes an error:

#![feature(use_extern_macros)]

use std::panic::{self};

fn main() {
    assert!(true); //~ ERROR expected (), found bool
}