Closed
Description
Perhaps similar to #109153, but with a different error stack
Code
mod foo {
pub mod bar {
pub mod bar {
pub mod bar {
pub mod bar {}
}
}
}
}
use foo::*;
use bar::bar::bar;
use bar::*;
fn main() {}
Meta
rustc --version --verbose
:
rustc 1.70.0-nightly (db0cbc48d 2023-03-26)
binary: rustc
commit-hash: db0cbc48d4aaa300713a95d9b317a365a474490c
commit-date: 2023-03-26
host: aarch64-apple-darwin
release: 1.70.0-nightly
LLVM version: 16.0.0
Error output
<output>
Backtrace
thread 'rustc' panicked at 'assertion failed: import.imported_module.get().is_none()', compiler/rustc_resolve/src/imports.rs:760:21
stack backtrace:
0: 0x102b5161c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hfbd99529d8ecd76d
1: 0x102ba4744 - core::fmt::write::h9d97190441ee1d43
2: 0x102b46fd4 - std::io::Write::write_fmt::h8e549a8786c022b9
3: 0x102b51430 - std::sys_common::backtrace::print::hcdd2ae2f7b4f384b
4: 0x102b53e44 - std::panicking::default_hook::{{closure}}::h2a46a28a68dc3d98
5: 0x102b53c04 - std::panicking::default_hook::h9a2d7764b010ec79
6: 0x10afb37f8 - rustc_driver_impl[36f9eacf6ed4a456]::DEFAULT_HOOK::{closure#0}::{closure#0}
7: 0x102b54504 - std::panicking::rust_panic_with_hook::h65330bb1b8d3241c
8: 0x102b542bc - std::panicking::begin_panic_handler::{{closure}}::h343dfc740ec0e358
9: 0x102b51a3c - std::sys_common::backtrace::__rust_end_short_backtrace::hc5295e27637ab888
10: 0x102b54090 - _rust_begin_unwind
11: 0x102bd0160 - core::panicking::panic_fmt::h2fc7f604365b2fbe
12: 0x102bd01d0 - core::panicking::panic::hf25fee583223a2d0
13: 0x10d9dbdc4 - <rustc_resolve[ee31f98a99a62d61]::Resolver>::finalize_import
14: 0x10d9d70c4 - <rustc_resolve[ee31f98a99a62d61]::Resolver>::finalize_imports
15: 0x10d9b105c - <rustc_session[8cde9655f3fdf5d4]::session::Session>::time::<(), <rustc_resolve[ee31f98a99a62d61]::Resolver>::resolve_crate::{closure#0}>
16: 0x10d9e8b74 - <rustc_resolve[ee31f98a99a62d61]::Resolver>::resolve_crate
17: 0x10b05b36c - rustc_interface[3d0cf88b79335b1d]::passes::resolver_for_lowering
18: 0x10e1b5bf0 - <rustc_middle[3a76e9f875a80391]::dep_graph::dep_node::DepKind as rustc_query_system[cda1a4a7f4fba84]::dep_graph::DepKind>::with_deps::<<rustc_query_system[cda1a4a7f4fba84]::dep_graph::graph::DepGraphData<rustc_middle[3a76e9f875a80391]::dep_graph::dep_node::DepKind>>::with_task<(rustc_query_impl[71d65aa877d6c29f]::plumbing::QueryCtxt, rustc_query_impl[71d65aa877d6c29f]::queries::metadata_loader), (), &rustc_data_structures[dc2bd4f2bdfd8c3a]::steal::Steal<alloc[461e12abd46ebdf1]::boxed::Box<dyn rustc_session[8cde9655f3fdf5d4]::cstore::MetadataLoader + core[1e402bd52f9ef0e1]::marker::Sync + core[1e402bd52f9ef0e1]::marker::Send>>>::{closure#0}, &rustc_data_structures[dc2bd4f2bdfd8c3a]::steal::Steal<alloc[461e12abd46ebdf1]::boxed::Box<dyn rustc_session[8cde9655f3fdf5d4]::cstore::MetadataLoader + core[1e402bd52f9ef0e1]::marker::Sync + core[1e402bd52f9ef0e1]::marker::Send>>>
19: 0x10e0f0d6c - rustc_query_system[cda1a4a7f4fba84]::query::plumbing::try_execute_query::<rustc_query_impl[71d65aa877d6c29f]::queries::resolver_for_lowering, rustc_query_impl[71d65aa877d6c29f]::plumbing::QueryCtxt>
20: 0x10e224628 - <rustc_query_impl[71d65aa877d6c29f]::Queries as rustc_middle[3a76e9f875a80391]::ty::query::QueryEngine>::resolver_for_lowering
21: 0x10af3e934 - <rustc_middle[3a76e9f875a80391]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[36f9eacf6ed4a456]::run_compiler::{closure#1}::{closure#2}::{closure#2}, &rustc_data_structures[dc2bd4f2bdfd8c3a]::steal::Steal<(rustc_middle[3a76e9f875a80391]::ty::ResolverAstLowering, alloc[461e12abd46ebdf1]::rc::Rc<rustc_ast[72ec421f4741fa9e]::ast::Crate>)>>
22: 0x10af8ffc0 - <rustc_interface[3d0cf88b79335b1d]::interface::Compiler>::enter::<rustc_driver_impl[36f9eacf6ed4a456]::run_compiler::{closure#1}::{closure#2}, core[1e402bd52f9ef0e1]::result::Result<core[1e402bd52f9ef0e1]::option::Option<rustc_interface[3d0cf88b79335b1d]::queries::Linker>, rustc_span[33b8002dac58b04]::ErrorGuaranteed>>
23: 0x10af4cd30 - rustc_span[33b8002dac58b04]::with_source_map::<core[1e402bd52f9ef0e1]::result::Result<(), rustc_span[33b8002dac58b04]::ErrorGuaranteed>, rustc_interface[3d0cf88b79335b1d]::interface::run_compiler<core[1e402bd52f9ef0e1]::result::Result<(), rustc_span[33b8002dac58b04]::ErrorGuaranteed>, rustc_driver_impl[36f9eacf6ed4a456]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
24: 0x10af5aba8 - std[3de1235cb6134dd8]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[3d0cf88b79335b1d]::util::run_in_thread_pool_with_globals<rustc_interface[3d0cf88b79335b1d]::interface::run_compiler<core[1e402bd52f9ef0e1]::result::Result<(), rustc_span[33b8002dac58b04]::ErrorGuaranteed>, rustc_driver_impl[36f9eacf6ed4a456]::run_compiler::{closure#1}>::{closure#0}, core[1e402bd52f9ef0e1]::result::Result<(), rustc_span[33b8002dac58b04]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[1e402bd52f9ef0e1]::result::Result<(), rustc_span[33b8002dac58b04]::ErrorGuaranteed>>
25: 0x10af52eec - <<std[3de1235cb6134dd8]::thread::Builder>::spawn_unchecked_<rustc_interface[3d0cf88b79335b1d]::util::run_in_thread_pool_with_globals<rustc_interface[3d0cf88b79335b1d]::interface::run_compiler<core[1e402bd52f9ef0e1]::result::Result<(), rustc_span[33b8002dac58b04]::ErrorGuaranteed>, rustc_driver_impl[36f9eacf6ed4a456]::run_compiler::{closure#1}>::{closure#0}, core[1e402bd52f9ef0e1]::result::Result<(), rustc_span[33b8002dac58b04]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[1e402bd52f9ef0e1]::result::Result<(), rustc_span[33b8002dac58b04]::ErrorGuaranteed>>::{closure#1} as core[1e402bd52f9ef0e1]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
26: 0x102b5cbb4 - std::sys::unix::thread::Thread::new::thread_start::h74bccdd3846674d0
27: 0x19757a06c - __pthread_deallocate
error: the compiler unexpectedly panicked. this is a bug.