Skip to content

ICE when useing macro defined in standard library #53512

Closed
@orium

Description

@orium

On nightly 1.30.0-nightly (33b923fd4 2018-08-18):

If you try to compile

use std::assert;

fn main() {
    assert!(true);
}

you get

error[E0432]: unresolved import `std::assert`
 --> src/main.rs:1:5
  |
1 | use std::assert;
  |     ^^^^^^^^^^^ no `assert` in the root

thread 'main' panicked at 'librustc_resolve/macros.rs:909: inconsistent resolution for a macro', librustc/util/bug.rs:47:26
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.30.0-nightly (33b923fd4 2018-08-18) running on x86_64-unknown-linux-gnu

note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type bin

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `playground`.

To learn more, run the command again with --verbose.

On playground: https://play.rust-lang.org/?gist=5f24c022a2d8fd3f2256a88a6c92e8a1&version=nightly&mode=debug&edition=2015

Metadata

Metadata

Assignees

Labels

A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyregression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions