Skip to content

ICE from public Macro 2.0 + use crate as #77475

Closed
@beepster4096

Description

@beepster4096

This does not happen if the macro is private or pub(crate).

Code

#![feature(decl_macro)]
use crate as _;
pub macro ice(){}

Meta

rustc --version --verbose:

rustc 1.48.0-nightly (154f1f544 2020-10-02)
binary: rustc
commit-hash: 154f1f544dd68f7b53ff8d9952811e855f4c2d7c
commit-date: 2020-10-02
host: x86_64-pc-windows-msvc
release: 1.48.0-nightly
LLVM version: 11.0

Error output

error: internal compiler error: compiler\rustc_middle\src\hir\map\mod.rs:477:41: couldn't find hir id HirId { owner: DefId(0:0 ~ icetest[63b0]), local_id: 0 } in the HIR map

thread 'rustc' panicked at 'Box<Any>', compiler\rustc_errors\src\lib.rs:945:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.48.0-nightly (154f1f544 2020-10-02) running on x86_64-pc-windows-msvc

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib

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

error: aborting due to previous error

error: could not compile `icetest`
Backtrace

error: internal compiler error: compiler\rustc_middle\src\hir\map\mod.rs:477:41: couldn't find hir id HirId { owner: DefId(0:0 ~ icetest[63b0]), local_id: 0 } in the HIR map

thread 'rustc' panicked at 'Box<Any>', compiler\rustc_errors\src\lib.rs:945:9
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.48.0-nightly (154f1f544 2020-10-02) running on x86_64-pc-windows-msvc

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib

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

query stack during panic:
#0 [privacy_access_levels] privacy access levels
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

error: could not compile `icetest`

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-decl-macros-2-0Area: Declarative macros 2.0 (#39412)C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.F-decl_macro`#![feature(decl_macro)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions