Skip to content

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

New issue

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

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

Already on GitHub? # to your account

Closed
matthiaskrgr opened this issue Feb 29, 2020 · 0 comments · Fixed by #69605
Closed

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

matthiaskrgr opened this issue Feb 29, 2020 · 0 comments · Fixed by #69605
Labels
A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

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

@matthiaskrgr matthiaskrgr added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 29, 2020
@jonas-schievink jonas-schievink added the A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. label Feb 29, 2020
@bors bors closed this as completed in 47d87d7 Mar 1, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants