Repository navigation
Closed
Closed
Copy link
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-debug-assertionsThis issue requires a build of rustc or tooling with debug-assertions in some wayThis issue requires a build of rustc or tooling with debug-assertions in some way
Description
Code
fn main() {
let mut x = 4;
let x_str = {
format!("{}", x);
//()
};
println!("{}", x_str);
}Meta
rustc --version --verbose(dd7fda5):
rustc 1.92.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: aarch64-apple-darwin
release: 1.92.0-dev
LLVM version: 21.1.1
It requires debug assertions.
Error output
<no output>
Backtrace
thread 'rustc' panicked at /private/var/tmp/code.1mIq4m/rust/compiler/rustc_errors/src/diagnostic.rs:1025:9:
Span must not be empty and have no suggestion
stack backtrace:
0: __rustc::rust_begin_unwind
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:697:5
1: core::panicking::panic_fmt
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/panicking.rs:75:14
2: span_suggestion_with_style<rustc_span::ErrorGuaranteed, &str, &str>
at ./rust/compiler/rustc_errors/src/diagnostic.rs:1025:9
3: check_for_binding_assigned_block_without_tail_expression
at ./rust/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs:958:17
4: report_selection_error
at ./rust/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs:325:30
5: report_fulfillment_error
at ./rust/compiler/rustc_trait_selection/src/error_reporting/traits/mod.rs:271:71
6: report_fulfillment_errors
at ./rust/compiler/rustc_trait_selection/src/error_reporting/traits/mod.rs:228:37
7: select_obligations_where_possible<rustc_hir_typeck::fn_ctxt::_impl::{impl#0}::resolve_ty_and_res_fully_qualified_call::{closure#0}::{closure_env#1}>
at ./rust/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs:667:29
8: check_argument_types
at ./rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:404:22
9: confirm_builtin_call
at ./rust/compiler/rustc_hir_typeck/src/callee.rs:574:14
10: check_expr_call
at ./rust/compiler/rustc_hir_typeck/src/callee.rs:131:22
11: check_expr_kind
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:575:50
12: {closure#0}
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:282:23
13: maybe_grow<rustc_middle::ty::Ty, rustc_hir_typeck::expr::{impl#0}::check_expr_with_expectation_and_args::{closure_env#0}>
at /Users/xieym/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-4dc01642fd091eda/stacker-0.1.21/src/lib.rs:57:9
14: ensure_sufficient_stack<rustc_middle::ty::Ty, rustc_hir_typeck::expr::{impl#0}::check_expr_with_expectation_and_args::{closure_env#0}>
at ./rust/compiler/rustc_data_structures/src/stack.rs:21:5
15: check_expr_with_expectation_and_args
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:277:18
16: check_expr_with_expectation
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:222:14
17: check_expr_with_hint
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:177:14
18: check_expr_array
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:1828:33
19: check_expr_kind
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:591:43
20: {closure#0}
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:282:23
21: maybe_grow<rustc_middle::ty::Ty, rustc_hir_typeck::expr::{impl#0}::check_expr_with_expectation_and_args::{closure_env#0}>
at /Users/xieym/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-4dc01642fd091eda/stacker-0.1.21/src/lib.rs:57:9
22: ensure_sufficient_stack<rustc_middle::ty::Ty, rustc_hir_typeck::expr::{impl#0}::check_expr_with_expectation_and_args::{closure_env#0}>
at ./rust/compiler/rustc_data_structures/src/stack.rs:21:5
23: check_expr_with_expectation_and_args
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:277:18
24: check_expr_with_expectation
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:222:14
25: check_expr_coercible_to_type_or_error<rustc_hir_typeck::expr::{impl#0}::check_expr_coercible_to_type::{closure_env#0}>
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:153:23
26: check_expr_coercible_to_type
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:143:14
27: check_decl_initializer
at ./rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:865:18
28: check_decl
at ./rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:875:32
29: check_decl_local
at ./rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:910:23
30: check_stmt
at ./rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:934:22
31: {closure#0}
at ./rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:1015:22
32: with_breakable_ctxt<rustc_hir_typeck::fn_ctxt::checks::{impl#0}::check_expr_block::{closure_env#0}, ()>
at ./rust/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs:1533:22
33: check_expr_block
at ./rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:1013:31
34: check_expr_kind
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:574:46
35: {closure#0}
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:282:23
36: maybe_grow<rustc_middle::ty::Ty, rustc_hir_typeck::expr::{impl#0}::check_expr_with_expectation_and_args::{closure_env#0}>
at /Users/xieym/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-4dc01642fd091eda/stacker-0.1.21/src/lib.rs:57:9
37: ensure_sufficient_stack<rustc_middle::ty::Ty, rustc_hir_typeck::expr::{impl#0}::check_expr_with_expectation_and_args::{closure_env#0}>
at ./rust/compiler/rustc_data_structures/src/stack.rs:21:5
38: check_expr_with_expectation_and_args
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:277:18
39: check_expr_with_expectation
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:222:14
40: {closure#1}
at ./rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:343:35
41: check_argument_types
at ./rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:440:34
42: confirm_builtin_call
at ./rust/compiler/rustc_hir_typeck/src/callee.rs:574:14
43: check_expr_call
at ./rust/compiler/rustc_hir_typeck/src/callee.rs:131:22
44: check_expr_kind
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:575:50
45: {closure#0}
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:282:23
46: maybe_grow<rustc_middle::ty::Ty, rustc_hir_typeck::expr::{impl#0}::check_expr_with_expectation_and_args::{closure_env#0}>
at /Users/xieym/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-4dc01642fd091eda/stacker-0.1.21/src/lib.rs:57:9
47: ensure_sufficient_stack<rustc_middle::ty::Ty, rustc_hir_typeck::expr::{impl#0}::check_expr_with_expectation_and_args::{closure_env#0}>
at ./rust/compiler/rustc_data_structures/src/stack.rs:21:5
48: check_expr_with_expectation_and_args
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:277:18
49: check_expr_with_expectation
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:222:14
50: check_expr
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:201:14
51: check_stmt
at ./rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:962:31
52: {closure#0}
at ./rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:1015:22
53: with_breakable_ctxt<rustc_hir_typeck::fn_ctxt::checks::{impl#0}::check_expr_block::{closure_env#0}, ()>
at ./rust/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs:1533:22
54: check_expr_block
at ./rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:1013:31
55: check_expr_kind
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:574:46
56: {closure#0}
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:282:23
57: maybe_grow<rustc_middle::ty::Ty, rustc_hir_typeck::expr::{impl#0}::check_expr_with_expectation_and_args::{closure_env#0}>
at /Users/xieym/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-4dc01642fd091eda/stacker-0.1.21/src/lib.rs:57:9
58: ensure_sufficient_stack<rustc_middle::ty::Ty, rustc_hir_typeck::expr::{impl#0}::check_expr_with_expectation_and_args::{closure_env#0}>
at ./rust/compiler/rustc_data_structures/src/stack.rs:21:5
59: check_expr_with_expectation_and_args
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:277:18
60: check_expr_with_expectation
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:222:14
61: check_expr
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:201:14
62: check_stmt
at ./rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:962:31
63: {closure#0}
at ./rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:1015:22
64: with_breakable_ctxt<rustc_hir_typeck::fn_ctxt::checks::{impl#0}::check_expr_block::{closure_env#0}, ()>
at ./rust/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs:1533:22
65: check_expr_block
at ./rust/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs:1013:31
66: check_expr_kind
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:574:46
67: {closure#0}
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:282:23
68: maybe_grow<rustc_middle::ty::Ty, rustc_hir_typeck::expr::{impl#0}::check_expr_with_expectation_and_args::{closure_env#0}>
at /Users/xieym/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-4dc01642fd091eda/stacker-0.1.21/src/lib.rs:57:9
69: ensure_sufficient_stack<rustc_middle::ty::Ty, rustc_hir_typeck::expr::{impl#0}::check_expr_with_expectation_and_args::{closure_env#0}>
at ./rust/compiler/rustc_data_structures/src/stack.rs:21:5
70: check_expr_with_expectation_and_args
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:277:18
71: check_expr_with_expectation
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:222:14
72: check_expr_with_hint
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:177:14
73: check_return_or_body_tail
at ./rust/compiler/rustc_hir_typeck/src/expr.rs:1131:35
74: check_fn
at ./rust/compiler/rustc_hir_typeck/src/check.rs:130:9
75: {closure#0}
at ./rust/compiler/rustc_hir_typeck/src/lib.rs:181:9
76: typeck_with_inspect
at ./rust/compiler/rustc_hir_typeck/src/lib.rs:106:1
77: {closure#0}
at ./rust/compiler/rustc_query_impl/src/plumbing.rs:294:9
[... omitted 22 frames ...]
78: query_ensure<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::dep_graph::graph::DepNodeIndex>>
at ./rust/compiler/rustc_middle/src/query/plumbing.rs:198:9
79: typeck<rustc_span::def_id::LocalDefId>
at ./rust/compiler/rustc_middle/src/query/plumbing.rs:233:9
80: {closure#2}
at ./rust/compiler/rustc_hir_analysis/src/lib.rs:243:29
81: {closure#0}<rustc_hir_analysis::check_crate::{closure_env#2}>
at ./rust/compiler/rustc_middle/src/hir/map.rs:340:79
82: {closure#0}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>
at ./rust/compiler/rustc_data_structures/src/sync/parallel.rs:181:30
83: call_once<(), rustc_data_structures::sync::parallel::par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/panic/unwind_safe.rs:272:9
84: do_call<core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>>, ()>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:589:40
85: catch_unwind<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>>>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:552:19
86: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>>, ()>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panic.rs:359:14
87: run<(), rustc_data_structures::sync::parallel::par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>>
at ./rust/compiler/rustc_data_structures/src/sync/parallel.rs:23:9
88: {closure#1}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>
at ./rust/compiler/rustc_data_structures/src/sync/parallel.rs:181:23
89: for_each<rustc_span::def_id::LocalDefId, rustc_data_structures::sync::parallel::par_for_each_in::{closure#0}::{closure_env#1}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/slice/iter/macros.rs:277:21
90: {closure#0}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>
at ./rust/compiler/rustc_data_structures/src/sync/parallel.rs:180:27
91: parallel_guard<(), rustc_data_structures::sync::parallel::par_for_each_in::{closure_env#0}<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>>
at ./rust/compiler/rustc_data_structures/src/sync/parallel.rs:39:15
92: par_for_each_in<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], rustc_middle::hir::map::{impl#3}::par_hir_body_owners::{closure_env#0}<rustc_hir_analysis::check_crate::{closure_env#2}>>
at ./rust/compiler/rustc_data_structures/src/sync/parallel.rs:175:5
93: par_hir_body_owners<rustc_hir_analysis::check_crate::{closure_env#2}>
at ./rust/compiler/rustc_middle/src/hir/map.rs:340:9
94: check_crate
at ./rust/compiler/rustc_hir_analysis/src/lib.rs:221:9
95: run_required_analyses
at ./rust/compiler/rustc_interface/src/passes.rs:1082:5
96: analysis
at ./rust/compiler/rustc_interface/src/passes.rs:1143:5
97: {closure#0}
at ./rust/compiler/rustc_query_impl/src/plumbing.rs:294:9
[... omitted 22 frames ...]
98: query_ensure<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>>
at ./rust/compiler/rustc_middle/src/query/plumbing.rs:198:9
99: analysis
at ./rust/compiler/rustc_middle/src/query/plumbing.rs:233:9
100: {closure#2}
at ./rust/compiler/rustc_driver_impl/src/lib.rs:371:29
101: {closure#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
at ./rust/compiler/rustc_interface/src/passes.rs:1017:27
102: {closure#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>
at ./rust/compiler/rustc_middle/src/ty/context.rs:1619:37
103: {closure#0}<rustc_middle::ty::context::{impl#21}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
at ./rust/compiler/rustc_middle/src/ty/context/tls.rs:60:9
104: try_with<core::cell::Cell<*const ()>, rustc_middle::ty::context::tls::enter_context::{closure_env#0}<rustc_middle::ty::context::{impl#21}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/thread/local.rs:315:12
105: with<core::cell::Cell<*const ()>, rustc_middle::ty::context::tls::enter_context::{closure_env#0}<rustc_middle::ty::context::{impl#21}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/thread/local.rs:279:20
106: enter_context<rustc_middle::ty::context::{impl#21}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
at ./rust/compiler/rustc_middle/src/ty/context/tls.rs:57:9
107: enter<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>
at ./rust/compiler/rustc_middle/src/ty/context.rs:1619:9
108: create_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>>
at ./rust/compiler/rustc_middle/src/ty/context.rs:1824:13
109: {closure#2}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
at ./rust/compiler/rustc_interface/src/passes.rs:984:9
110: call_once<rustc_interface::passes::create_and_enter_global_ctxt::{closure_env#2}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, (&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy, alloc::alloc::Global>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2})>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/ops/function.rs:253:5
111: call_once<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy, alloc::alloc::Global>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}), dyn core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy, alloc::alloc::Global>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}), Output=core::option::Option<rustc_interface::queries::Linker>>, alloc::alloc::Global>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/alloc/src/boxed.rs:1971:9
112: create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
at ./rust/compiler/rustc_interface/src/passes.rs:1025:5
113: {closure#0}
at ./rust/compiler/rustc_driver_impl/src/lib.rs:344:22
114: {closure#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>
at ./rust/compiler/rustc_interface/src/interface.rs:531:80
115: call_once<(), rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/core/src/panic/unwind_safe.rs:272:9
116: do_call<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>, ()>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:589:40
117: catch_unwind<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panicking.rs:552:19
118: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>, ()>
at /rustc/788da80fcfcef3f34c90def5baa32813e39a1a41/library/std/src/panic.rs:359:14
119: {closure#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>
at ./rust/compiler/rustc_interface/src/interface.rs:531:23
120: {closure#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>
at ./rust/compiler/rustc_interface/src/util.rs:200:17
121: {closure#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>
at ./rust/compiler/rustc_interface/src/util.rs:154:24
122: set<rustc_span::SessionGlobals, rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>, ()>
at /Users/xieym/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-4dc01642fd091eda/scoped-tls-1.0.1/src/lib.rs:137:9
123: create_session_globals_then<(), rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure#0}::{closure_env#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>>
at ./rust/compiler/rustc_span/src/lib.rs:146:21
124: {closure#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>
at ./rust/compiler/rustc_interface/src/util.rs:150:17
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: the compiler unexpectedly panicked. this is a bug.
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 make sure that you have updated to the latest nightly
note: please attach the file at `/private/var/tmp/code.1mIq4m/rustc-ice-2025-10-02T04_28_54-28336.txt` to your bug report
query stack during panic:
#0 [typeck] type-checking `main`
#1 [analysis] running analysis passes on this crate
end of query stack
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-debug-assertionsThis issue requires a build of rustc or tooling with debug-assertions in some wayThis issue requires a build of rustc or tooling with debug-assertions in some way
Activity
ym-xie commentedon Oct 2, 2025
@rustbot label +requires-debug-assertions
Kivooeo commentedon Oct 2, 2025
Is that reproducable on playground? Because from what I see currently nightly build with debug build is not ICEing on playing ground
jieyouxu commentedon Oct 2, 2025
jieyouxu commentedon Oct 2, 2025
Kivooeo commentedon Oct 2, 2025
Do we really need this debug_assert here?
rust/compiler/rustc_errors/src/diagnostic.rs
Lines 1025 to 1028 in 42b384e
Because if I remove it then it does work as before :D
jieyouxu commentedon Oct 2, 2025
Yes, that's the entire point of that debug assertion. Empty spans (with no sugestions) are a bug, best they indicate one with diagnostics logic, worse they could be a symptom of a more serious logic bug.
Kivooeo commentedon Oct 2, 2025
Using this instead of just
stmt.span.with_lo(tail_expr.span.hi())Do fix the problem, but I really wonder what could happen that this started to ICE, that's very weird
Is there any chance that this was ICEing even before and we just don't have test for such case that will break this "span arithmetic"
edit: well, no, if nightly is not panicking then it means that it's something new
edit2: nightly in playground is without debug assertaion so it does not representing anything
ym-xie commentedon Oct 2, 2025
Does nightly build with debug-assertions? the playground doesn't seem to have it #144501 (comment)
Kivooeo commentedon Oct 2, 2025
I guess so, see this example
ym-xie commentedon Oct 2, 2025
fmease commentedon Oct 2, 2025
No, that just demonstrates that the compiler builds the playground crate with debug assertions enabled (and optimizations off) because the default mode / profile is debug; see the big dropdown button at the top.
This does not demonstrate that the compiler itself was compiled with debug assertions.
Nightly / beta / stable releases were not compiled with debug assertions. IINM on all release channels, the compiler build is a full release / dist build, hence optimized and no debug assertions.
Kivooeo commentedon Oct 2, 2025
Oh, I see, thanks for explanation
Kivooeo commentedon Oct 2, 2025
Is this the same reason why
cargo-bisect-rustccan't bisect this one? Because it downloads binaries without debug-assertation?Kivooeo commentedon Oct 2, 2025
I now leaning more into this theory, can I somehow (if so, how?) test more older compiler versions and build it with debug assertation to see if this issue was before or it's a new one
edit: git reset --hard commit should work fine
fmease commentedon Oct 2, 2025
Very likely, yes. cargo-bisect-rustc merely downloads existing artifacts from static.rust-lang.org. While bisecting it initially only checks nightly builds (by default at least) (which were compiled in release / dist mode as established).
Now, cargo-bisect-rustc also downloads available historical try-builds (created via
@bors tryfor unrelated reasons, e.g., perf, crater) to bisect within rollups (and maybe other situations). It's possible that these try-builds were actually compiled in debug mode but I'm not sure. In any case, it doesn't really matter for initial bisections.Kivooeo commentedon Oct 2, 2025
Sorry for a long reply, I fall asleep on another llvm build... because they are unavailable for old rustc version to donwload
Well, I found out that the last version where it does ICE is 1.86, 1.85 is fine
So, @fmease, what do you think, just use another span (as I show above) when this one is empty is reasonable solution?
Because at some situations like this they are equal which turns out in empty span, it seems to me that I can just use one of them in such cases?
I ran a
./x test uiwith solution above and there is no tests failedRollup merge of rust-lang#147416 - Kivooeo:ice-fix23456, r=fmease
Unrolled build for #147416