[ICE]: `no type for local variable`
Open
@TaKO8Ki is already working on this.
Since May 13, 2026.
C-bug
F-move_expr
I-ICE
T-compiler
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
snippet:
#![feature(move_expr)]
fn main() {
|| {
let x;
move(x);
}
}
Version information
rustc 1.97.0-nightly (2aabf3ce0 2026-05-12)
binary: rustc
commit-hash: 2aabf3ce0569dd7c8c2d2a27944850056dcf2566
commit-date: 2026-05-12
host: x86_64-unknown-linux-gnu
release: 1.97.0-nightly
LLVM version: 22.1.4
Possibly related line of code:
https://github.com/rust-lang/rust/blob/2aabf3ce0569dd7c8c2d2a27944850056dcf2566/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs#L190-L202
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc
Program output
warning: the feature `move_expr` is incomplete and may not be safe to use and/or cause compiler crashes
--> /tmp/icemaker_global_tempdir.5qhoISwFFXK1/rustc_testrunner_tmpdir_reporting.ZGKe5P4p00GV/mvce.rs:1:12
|
1 | #![feature(move_expr)]
| ^^^^^^^^^
|
= note: see issue #155050 <https://github.com/rust-lang/rust/issues/155050> for more information
= note: `#[warn(incomplete_features)]` on by default
error: internal compiler error: /rustc-dev/2aabf3ce0569dd7c8c2d2a27944850056dcf2566/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs:196:13: no type for local variable HirId(DefId(0:3 ~ mvce[502c]::main).7) (pat `x`)
--> /tmp/icemaker_global_tempdir.5qhoISwFFXK1/rustc_testrunner_tmpdir_reporting.ZGKe5P4p00GV/mvce.rs:5:10
|
5 | move(x);
| ^
thread 'rustc' (3779788) panicked at /rustc-dev/2aabf3ce0569dd7c8c2d2a27944850056dcf2566/compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs:196:13:
Box<dyn Any>
stack backtrace:
0: 0x7f7ed45fe939 - <<std[fb72487e8bd7b759]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[457c31d02d1af627]::fmt::Display>::fmt
1: 0x7f7ed4c14308 - core[457c31d02d1af627]::fmt::write
2: 0x7f7ed4615556 - <std[fb72487e8bd7b759]::sys::stdio::unix::Stderr as std[fb72487e8bd7b759]::io::Write>::write_fmt
3: 0x7f7ed45d497e - std[fb72487e8bd7b759]::panicking::default_hook::{closure#0}
4: 0x7f7ed45f1ff3 - std[fb72487e8bd7b759]::panicking::default_hook
5: 0x7f7ed34021f1 - std[fb72487e8bd7b759]::panicking::update_hook::<alloc[4e5e6ce44ab11126]::boxed::Box<rustc_driver_impl[1ada6c65d04239e9]::install_ice_hook::{closure#1}>>::{closure#0}
6: 0x7f7ed45f22d2 - std[fb72487e8bd7b759]::panicking::panic_with_hook
7: 0x7f7ed342f4a1 - std[fb72487e8bd7b759]::panicking::begin_panic::<rustc_errors[76f2050a81decc74]::ExplicitBug>::{closure#0}
8: 0x7f7ed3428496 - std[fb72487e8bd7b759]::sys::backtrace::__rust_end_short_backtrace::<std[fb72487e8bd7b759]::panicking::begin_panic<rustc_errors[76f2050a81decc74]::ExplicitBug>::{closure#0}, !>
9: 0x7f7ed34281fb - std[fb72487e8bd7b759]::panicking::begin_panic::<rustc_errors[76f2050a81decc74]::ExplicitBug>
10: 0x7f7ed343a981 - <rustc_errors[76f2050a81decc74]::diagnostic::BugAbort as rustc_errors[76f2050a81decc74]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
11: 0x7f7ed3a9747c - <rustc_errors[76f2050a81decc74]::DiagCtxtHandle>::span_bug::<rustc_span[fc6225e1ca122264]::span_encoding::Span, alloc[4e5e6ce44ab11126]::string::String>
12: 0x7f7ed3ac2af6 - rustc_middle[9e5cd1d249fcf777]::util::bug::opt_span_bug_fmt::<rustc_span[fc6225e1ca122264]::span_encoding::Span>::{closure#0}
13: 0x7f7ed3ac2c82 - rustc_middle[9e5cd1d249fcf777]::ty::context::tls::with_opt::<rustc_middle[9e5cd1d249fcf777]::util::bug::opt_span_bug_fmt<rustc_span[fc6225e1ca122264]::span_encoding::Span>::{closure#0}, !>::{closure#0}
14: 0x7f7ed3ab171b - rustc_middle[9e5cd1d249fcf777]::ty::context::tls::with_context_opt::<rustc_middle[9e5cd1d249fcf777]::ty::context::tls::with_opt<rustc_middle[9e5cd1d249fcf777]::util::bug::opt_span_bug_fmt<rustc_span[fc6225e1ca122264]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
15: 0x7f7ed1c49638 - rustc_middle[9e5cd1d249fcf777]::util::bug::span_bug_fmt::<rustc_span[fc6225e1ca122264]::span_encoding::Span>
16: 0x7f7ed5b0ca2b - <rustc_hir_typeck[3ceca232e7278b75]::fn_ctxt::FnCtxt>::instantiate_value_path
17: 0x7f7ed4f9737d - <rustc_hir_typeck[3ceca232e7278b75]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
18: 0x7f7ed4f6fcc2 - <rustc_hir_typeck[3ceca232e7278b75]::fn_ctxt::FnCtxt>::check_decl
19: 0x7f7ed4f8b0d4 - <rustc_hir_typeck[3ceca232e7278b75]::fn_ctxt::FnCtxt>::check_expr_block
20: 0x7f7ed4f971f1 - <rustc_hir_typeck[3ceca232e7278b75]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
21: 0x7f7ed4f8a463 - <rustc_hir_typeck[3ceca232e7278b75]::fn_ctxt::FnCtxt>::check_expr_block
22: 0x7f7ed4f971f1 - <rustc_hir_typeck[3ceca232e7278b75]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
23: 0x7f7ed4f67e22 - rustc_hir_typeck[3ceca232e7278b75]::check::check_fn
24: 0x7f7ed56213c9 - rustc_hir_typeck[3ceca232e7278b75]::typeck_with_inspect::{closure#0}
25: 0x7f7ed561e370 - rustc_query_impl[9fc3ed92a5a76066]::query_impl::typeck_root::invoke_provider_fn::__rust_begin_short_backtrace
26: 0x7f7ed4f08866 - rustc_query_impl[9fc3ed92a5a76066]::execution::try_execute_query::<rustc_data_structures[d71def3eda27c10f]::vec_cache::VecCache<rustc_span[fc6225e1ca122264]::def_id::LocalDefId, rustc_middle[9e5cd1d249fcf777]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[9e5cd1d249fcf777]::dep_graph::graph::DepNodeIndex>, false>
27: 0x7f7ed4f08083 - rustc_query_impl[9fc3ed92a5a76066]::query_impl::typeck_root::execute_query_non_incr::__rust_end_short_backtrace
28: 0x7f7ed4f0ee2e - <rustc_middle[9e5cd1d249fcf777]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_hir_analysis[e7de524a224a9bd4]::check_crate::{closure#1}>::{closure#0}
29: 0x7f7ed4f0e81e - rustc_hir_analysis[e7de524a224a9bd4]::check_crate
30: 0x7f7ed4f09fa1 - rustc_interface[c670da77810bcda2]::passes::analysis
31: 0x7f7ed5d21909 - rustc_query_impl[9fc3ed92a5a76066]::execution::try_execute_query::<rustc_middle[9e5cd1d249fcf777]::query::caches::SingleCache<rustc_middle[9e5cd1d249fcf777]::query::erase::ErasedData<[u8; 0usize]>>, false>
32: 0x7f7ed5d21573 - rustc_query_impl[9fc3ed92a5a76066]::query_impl::analysis::execute_query_non_incr::__rust_end_short_backtrace
33: 0x7f7ed5d5931b - rustc_interface[c670da77810bcda2]::interface::run_compiler::<(), rustc_driver_impl[1ada6c65d04239e9]::run_compiler::{closure#0}>::{closure#1}
34: 0x7f7ed5d1043e - std[fb72487e8bd7b759]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[c670da77810bcda2]::util::run_in_thread_with_globals<rustc_interface[c670da77810bcda2]::util::run_in_thread_pool_with_globals<rustc_interface[c670da77810bcda2]::interface::run_compiler<(), rustc_driver_impl[1ada6c65d04239e9]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
35: 0x7f7ed5d10b2d - <std[fb72487e8bd7b759]::thread::lifecycle::spawn_unchecked<rustc_interface[c670da77810bcda2]::util::run_in_thread_with_globals<rustc_interface[c670da77810bcda2]::util::run_in_thread_pool_with_globals<rustc_interface[c670da77810bcda2]::interface::run_compiler<(), rustc_driver_impl[1ada6c65d04239e9]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[457c31d02d1af627]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
36: 0x7f7ed5d1192c - <std[fb72487e8bd7b759]::sys::thread::unix::Thread>::new::thread_start
37: 0x7f7ecf49697a - <unknown>
38: 0x7f7ecf51a2bc - <unknown>
39: 0x0 - <unknown>
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: rustc 1.97.0-nightly (2aabf3ce0 2026-05-12) running on x86_64-unknown-linux-gnu
query stack during panic:
#0 [typeck_root] type-checking `main`
#1 [analysis] running analysis passes on crate `mvce`
end of query stack
error: aborting due to 1 previous error; 1 warning emitted
@rustbot label +F-move_expr
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.