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 when using tracing::debug!("").await in a non-async fn #12703

Closed
ReactorScram opened this issue Apr 22, 2024 · 2 comments
Closed

ICE when using tracing::debug!("").await in a non-async fn #12703

ReactorScram opened this issue Apr 22, 2024 · 2 comments
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@ReactorScram
Copy link

Summary

I minimized it to this https://github.com/ReactorScram/rust-ice-repro/blob/main/src/lib.rs
Basically

fn _() {
    tracing::debug!("").await
}

cargo check, cargo build, or cargo clippy all seem to crash similarly.

Version

rustc 1.77.2 (25ef9e3d8 2024-04-09)
binary: rustc
commit-hash: 25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04
commit-date: 2024-04-09
host: aarch64-unknown-linux-gnu
release: 1.77.2
LLVM version: 17.0.6

Error output

Backtrace

thread 'rustc' panicked at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/compiler/rustc_middle/src/hir/mod.rs:145:88:
no entry found for key
stack backtrace:
 0: rust_begin_unwind
           at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panicking.rs:647:5
 1: core::panicking::panic_fmt
           at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/panicking.rs:72:14
 2: core::panicking::panic_display
           at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/panicking.rs:196:5
 3: core::panicking::panic_str
           at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/panicking.rs:171:5
 4: core::option::expect_failed
           at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/option.rs:1988:5
 5: <rustc_middle::hir::provide::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_hir::hir_id::OwnerId)>>::call_once
    [... omitted 2 frames ...]
 6: <rustc_middle::hir::map::Map>::opt_parent_id
 7: <rustc_middle::hir::map::ParentHirIterator as core::iter::traits::iterator::Iterator>::next
 8: <rustc_middle::lint::ShallowLintLevelMap>::probe_for_lint_level
 9: <rustc_middle::lint::ShallowLintLevelMap>::lint_level_id_at_node
10: <rustc_middle::ty::context::TyCtxt>::lint_level_at_node
11: rustc_hir_analysis::check_unused::check_unused_traits
    [... omitted 2 frames ...]
12: rustc_hir_analysis::check_crate
13: rustc_interface::passes::analysis
    [... omitted 2 frames ...]
14: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#0}::{closure#3}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
15: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#0}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
16: rustc_interface::util::run_in_thread_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}::{closure#0}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

@ReactorScram ReactorScram added C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ labels Apr 22, 2024
@y21
Copy link
Member

y21 commented Apr 22, 2024

This is most likely a duplicate of rust-lang/rust#121096 and should already be fixed on nightly.

@ReactorScram
Copy link
Author

You're right, cargo +nightly check doesn't have the crash. Thanks!

@ReactorScram ReactorScram closed this as not planned Won't fix, can't repro, duplicate, stale Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants