Closed
Description
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