Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

ice: no resolution for an import #120789

Closed
matthiaskrgr opened this issue Feb 8, 2024 · 2 comments · Fixed by #120850
Closed

ice: no resolution for an import #120789

matthiaskrgr opened this issue Feb 8, 2024 · 2 comments · Fixed by #120850
Assignees
Labels
A-resolve Area: Name resolution 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

use ::{}; fn main() {}

Meta

rustc --version --verbose:

rustc 1.78.0-nightly (af88f7db5 2024-02-08)
binary: rustc
commit-hash: af88f7db51f6f2a1472f9279d7c7e7c822afff77
commit-date: 2024-02-08
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 17.0.6

Error output

<output>
Backtrace

warning: unused import: `::{}`
 --> 08D75AC466B02457D5C4F4BDCCE0271869625FFC766C1ECE2C2483B3DB3E449C.rs:3:5
  |
3 | use ::{}; fn main() {}
  |     ^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

note: no errors encountered even though delayed bugs were created

note: those delayed bugs will now be shown as internal compiler errors

error: internal compiler error: no resolution for an import
 --> 08D75AC466B02457D5C4F4BDCCE0271869625FFC766C1ECE2C2483B3DB3E449C.rs:3:5
  |
3 | use ::{}; fn main() {}
  |     ^^^^
  |
note: delayed at compiler/rustc_ast_lowering/src/lib.rs:757:24
         0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
         1: <rustc_errors::DiagCtxt>::emit_diagnostic
         2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic_builder::EmissionGuarantee>::emit_producing_guarantee
         3: <rustc_ast_lowering::LoweringContext>::lower_import_res
         4: <rustc_ast_lowering::LoweringContext>::lower_use_tree
         5: <rustc_ast_lowering::LoweringContext>::lower_item_kind
         6: <rustc_ast_lowering::item::ItemLowerer>::lower_node
         7: rustc_ast_lowering::lower_to_hir
         8: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::hir_crate::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
         9: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        10: rustc_query_impl::query_impl::hir_crate::get_query_non_incr::__rust_end_short_backtrace
        11: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::hir_attrs::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
        12: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_hir::hir_id::OwnerId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        13: rustc_query_impl::query_impl::hir_attrs::get_query_non_incr::__rust_end_short_backtrace
        14: <rustc_middle::hir::map::Map>::attrs
        15: rustc_passes::entry::entry_fn
        16: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::entry_fn::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 12]>>
        17: <rustc_query_impl::query_impl::entry_fn::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, ())>>::call_once
        18: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 12]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        19: rustc_query_impl::query_impl::entry_fn::get_query_non_incr::__rust_end_short_backtrace
        20: rustc_interface::passes::analysis
        21: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
        22: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        23: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        24: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
        25: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
        26: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
        27: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/8ace7ea1f7cbba7b4f031e66c54ca237a0d65de6/library/alloc/src/boxed.rs:2015:9
        28: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/8ace7ea1f7cbba7b4f031e66c54ca237a0d65de6/library/alloc/src/boxed.rs:2015:9
        29: std::sys::pal::unix::thread::Thread::new::thread_start
                   at /rustc/8ace7ea1f7cbba7b4f031e66c54ca237a0d65de6/library/std/src/sys/pal/unix/thread.rs:108:17
        30: <unknown>
        31: <unknown>
 --> 08D75AC466B02457D5C4F4BDCCE0271869625FFC766C1ECE2C2483B3DB3E449C.rs:3:5
  |
3 | use ::{}; fn main() {}
  |     ^^^^

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: please attach the file at `/tmp/im/rustc-ice-2024-02-08T16_41_58-1021684.txt` to your bug report

query stack during panic:
end of query stack
error: aborting due to 1 previous error; 1 warning emitted

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. labels Feb 8, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 8, 2024
@petrochenkov
Copy link
Contributor

Regression from #120609.

@petrochenkov petrochenkov self-assigned this Feb 8, 2024
@fmease fmease added A-resolve Area: Name resolution and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 8, 2024
@petrochenkov
Copy link
Contributor

Fixed in #120850.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 9, 2024
ast_lowering: Fix regression in `use ::{}` imports.

Fixes rust-lang#120789
@bors bors closed this as completed in 8177c0f Feb 10, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Feb 10, 2024
Rollup merge of rust-lang#120850 - petrochenkov:empimpres, r=cjgillot

ast_lowering: Fix regression in `use ::{}` imports.

Fixes rust-lang#120789
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name resolution 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.

4 participants