Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE when useing macro defined in standard library #53512

Closed
orium opened this issue Aug 20, 2018 · 2 comments · Fixed by #53471
Closed

ICE when useing macro defined in standard library #53512

orium opened this issue Aug 20, 2018 · 2 comments · Fixed by #53471
Assignees
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-resolve Area: Path resolution regression-from-stable-to-nightly Performance or correctness regression from stable to nightly.
Milestone

Comments

@orium
Copy link
Member

orium commented Aug 20, 2018

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

@petrochenkov petrochenkov self-assigned this Aug 20, 2018
@petrochenkov petrochenkov added A-resolve Area: Path resolution A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels Aug 20, 2018
@petrochenkov
Copy link
Contributor

This looks very similar to #53269, easy bug.
I'll fix this tomorrow if this wasn't already fixed by #53471.

@alexcrichton alexcrichton added this to the 1.30 milestone Aug 21, 2018
bors added a commit that referenced this issue Aug 21, 2018
resolve: Some macro resolution refactoring

Work towards completing #50911 (comment)

The last commit also fixes #53269 by not using `def_id()` on `Def::Err` and also fixes #53512.
@petrochenkov
Copy link
Contributor

Fixed in #53471

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-resolve Area: Path resolution regression-from-stable-to-nightly Performance or correctness regression from stable to nightly.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants