Skip to content

ICE register-attr-tool-import.rs with -Zsave-analysis #69588

Closed
@matthiaskrgr

Description

@matthiaskrgr

Code

command:
RUST_BACKTRACE=1 ./build/x86_64-unknown-linux-gnu/stage2/bin/rustc src/test/ui/attributes/register-attr-tool-import.rs -Zui-testing --emit metadata -Zsave-analysis -L src/test/ui/attributes/register-attr-tool-import/auxiliary -Lnative=build/x86_64-unknown-linux-gnu/native/rust-test-helpers "-A" "unused" "--edition=2018"

Meta

rustc --version --verbose:

rustc @ 3f9bddc

Error output

thread 'rustc' panicked at 'attempted .def_id() on invalid res: NonMacroAttr(Registered)', <::std::macros::panic macros>:5:6

Backtrace

RUST_BACKTRACE=1 ./build/x86_64-unknown-linux-gnu/stage2/bin/rustc   src/test/ui/attributes/register-attr-tool-import.rs   -Zui-testing  --emit metadata  -Zsave-analysis -L src/test/ui/attributes/register-attr-tool-import/auxiliary   -Lnative=build/x86_64-unknown-linux-gnu/native/rust-test-helpers  "-A" "unused" "--edition=2018"
error: cannot use an explicitly registered attribute through an import
  --> src/test/ui/attributes/register-attr-tool-import.rs:12:3
   |
LL | #[renamed_attr] //~ ERROR cannot use an explicitly registered attribute through an import
   |   ^^^^^^^^^^^^
   |
note: the explicitly registered attribute imported here
  --> src/test/ui/attributes/register-attr-tool-import.rs:9:5
   |
LL | use attr as renamed_attr; // OK
   |     ^^^^^^^^^^^^^^^^^^^^

error: cannot use a tool module through an import
  --> src/test/ui/attributes/register-attr-tool-import.rs:13:3
   |
LL | #[renamed_tool::attr] //~ ERROR cannot use a tool module through an import
   |   ^^^^^^^^^^^^
   |
note: the tool module imported here
  --> src/test/ui/attributes/register-attr-tool-import.rs:10:5
   |
LL | use tool as renamed_tool; // OK
   |     ^^^^^^^^^^^^^^^^^^^^

thread 'rustc' panicked at 'attempted .def_id() on invalid res: NonMacroAttr(Registered)', <::std::macros::panic macros>:5:6
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: rustc_driver::report_ice
   6: std::panicking::rust_panic_with_hook
   7: rust_begin_unwind
   8: std::panicking::begin_panic_fmt
   9: rustc_hir::def::Res<Id>::def_id::{{closure}}
  10: rustc_save_analysis::dump_visitor::DumpVisitor::process_use_tree
  11: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_item
  12: <rustc_save_analysis::dump_visitor::DumpVisitor as syntax::visit::Visitor>::visit_mod
  13: syntax::visit::walk_crate
  14: rustc::dep_graph::graph::DepGraph::with_ignore
  15: rustc_session::utils::<impl rustc_session::session::Session>::time
  16: rustc::ty::context::tls::enter_global
  17: rustc_interface::interface::run_compiler_in_existing_thread_pool
  18: syntax::attr::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.43.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: -Z ui-testing -Z save-analysis

query stack during panic:
end of query stack
error: aborting due to 2 previous errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-save-analysisArea: saving results of analyses such as inference and borrowck results to a file.C-bugCategory: This is a bug.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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions