Repository navigation
Open
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-found-by-fuzzingStatus: This issue was found using fuzzing. It may not arise in practical cases.Status: This issue was found using fuzzing. It may not arise in practical cases.S-has-bisectionStatus: A bisection has been found for this issueStatus: A bisection has been found for this issueT-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.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Description
Code
use std::cell::Cell;
use std::ops::Deref;
trait Foo: Deref<Target = Cell<dyn Bar>> {
fn method(self: &Cell<dyn Bar>) {}
}
trait Bar {}
fn test(x: &dyn Foo) {
x.method();
}
fn main() {}Mutant of tests/ui/self/invalid-self-dyn-receiver.rs.
Meta
rustc --version --verbose:
rustc 1.101.0-nightly (16d1ffac1 2026-10-26)
binary: rustc
commit-hash: 16d1ffac17ad8b739e32483ac2e65fe7e1804977
commit-date: 2026-10-26
host: x86_64-apple-darwin
release: 1.101.0-nightly
LLVM version: 23.1.4
Error output
Command: rustc objpick.rs --edition 2024
error[E0307]: invalid `self` parameter type: `&Cell<(dyn Bar + 'static)>`
--> objpick.rs:5:21
|
5 | fn method(self: &Cell<dyn Bar>) {}
| ^^^^^^^^^^^^^^
|
= note: type of `self` must be `Self` or a type that dereferences to it
= help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
error: internal compiler error: /rustc-dev/16d1ffac17ad8b739e32483ac2e65fe7e1804977/compiler/rustc_hir_typeck/src/method/confirm.rs:410:17: self-type `&Cell<(dyn Bar + 'static)>` for ObjectPick never dereferenced to an object
--> objpick.rs:11:7
|
11 | x.method();
| ^^^^^^
thread 'rustc' (44602892) panicked at /rustc-dev/16d1ffac17ad8b739e32483ac2e65fe7e1804977/compiler/rustc_hir_typeck/src/method/confirm.rs:410:17:
Box<dyn Any>
Backtrace
thread 'rustc' (44602892) panicked at /rustc-dev/16d1ffac17ad8b739e32483ac2e65fe7e1804977/compiler/rustc_hir_typeck/src/method/confirm.rs:410:17:
Box<dyn Any>
stack backtrace:
0: 0x10ee76824 - <<std[2593b8881ffc8f3d]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[78285f1485d4cbbc]::fmt::Display>::fmt
1: 0x10b47de57 - core[78285f1485d4cbbc]::fmt::write
2: 0x10ee8efab - <std[2593b8881ffc8f3d]::sys::stdio::unix::Stderr as core[78285f1485d4cbbc]::io::write::Write>::write_fmt
3: 0x10ee403d0 - std[2593b8881ffc8f3d]::panicking::default_hook::{closure#0}
4: 0x10ee66107 - std[2593b8881ffc8f3d]::panicking::default_hook
5: 0x10c3bfee2 - std[2593b8881ffc8f3d]::panicking::update_hook::<alloc[484f06d20a7e4722]::boxed::Box<rustc_driver_impl[7b907c5adb31dd75]::install_ice_hook::{closure#1}>>::{closure#0}
6: 0x10ee66717 - std[2593b8881ffc8f3d]::panicking::panic_with_hook
7: 0x10e55a859 - std[2593b8881ffc8f3d]::panicking::begin_panic::<rustc_span[bb5d078d821bdf7d]::macros::ExplicitBug>::{closure#0}
8: 0x10e5569e9 - std[2593b8881ffc8f3d]::sys::backtrace::__rust_end_short_backtrace::<std[2593b8881ffc8f3d]::panicking::begin_panic<rustc_span[bb5d078d821bdf7d]::macros::ExplicitBug>::{closure#0}, !>
9: 0x10f10ed88 - std[2593b8881ffc8f3d]::panicking::begin_panic::<rustc_span[bb5d078d821bdf7d]::macros::ExplicitBug>
10: 0x10f110703 - rustc_span[bb5d078d821bdf7d]::macros::bug_impl
11: 0x10cbb109f - <rustc_hir_typeck[be8275de51fa67fb]::method::confirm::ConfirmContext>::confirm
12: 0x10cb2d479 - <rustc_hir_typeck[be8275de51fa67fb]::fn_ctxt::FnCtxt>::check_expr_method_call
13: 0x10cb30fb3 - <rustc_hir_typeck[be8275de51fa67fb]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
14: 0x10cb88fd8 - <rustc_hir_typeck[be8275de51fa67fb]::fn_ctxt::FnCtxt>::check_expr_block
15: 0x10cb31091 - <rustc_hir_typeck[be8275de51fa67fb]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
16: 0x10cb2e90a - <rustc_hir_typeck[be8275de51fa67fb]::fn_ctxt::FnCtxt>::check_return_or_body_tail
17: 0x10cc31f62 - rustc_hir_typeck[be8275de51fa67fb]::check::check_fn
18: 0x10cad138e - rustc_hir_typeck[be8275de51fa67fb]::typeck_with_inspect::{closure#0}
19: 0x10cafafe0 - rustc_hir_typeck[be8275de51fa67fb]::typeck_root
20: 0x10def9115 - rustc_query_impl[7d3ade741a45c836]::execution::try_execute_query::<rustc_data_structures[d1a59173e0b94bb]::vec_cache::VecCache<rustc_span[bb5d078d821bdf7d]::def_id::LocalDefId, rustc_middle[ca6269e841c8a80d]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[ca6269e841c8a80d]::dep_graph::graph::DepNodeIndex>, false>
21: 0x10e1284c5 - rustc_query_impl[7d3ade741a45c836]::query_vtables::typeck_root::execute_query_non_incr::__rust_end_short_backtrace
22: 0x10c6087fe - <rustc_middle[ca6269e841c8a80d]::query::calls::TyCtxtEnsureOk>::typeck::<rustc_span[bb5d078d821bdf7d]::def_id::LocalDefId>
23: 0x10c6fde35 - <rustc_middle[ca6269e841c8a80d]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_hir_analysis[bdb44298bdcb9b02]::check_crate::{closure#1}>::{closure#0}
24: 0x10c74715d - rustc_hir_analysis[bdb44298bdcb9b02]::check_crate
25: 0x10cf1cebd - rustc_interface[24eeb4300d06b8bb]::passes::analysis
26: 0x10df2462f - rustc_query_impl[7d3ade741a45c836]::execution::try_execute_query::<rustc_middle[ca6269e841c8a80d]::query::caches::SingleCache<rustc_middle[ca6269e841c8a80d]::query::erase::ErasedData<[u8; 0usize]>>, false>
27: 0x10e144d46 - rustc_query_impl[7d3ade741a45c836]::query_vtables::analysis::execute_query_non_incr::__rust_end_short_backtrace
28: 0x10c344b73 - rustc_interface[24eeb4300d06b8bb]::passes::create_and_enter_global_ctxt::<core[78285f1485d4cbbc]::option::Option<rustc_interface[24eeb4300d06b8bb]::queries::Linker>, rustc_driver_impl[7b907c5adb31dd75]::compiler_entrypoint::{closure#0}::{closure#1}>
29: 0x10c3be7fd - rustc_interface[24eeb4300d06b8bb]::interface::run_compiler::<(), rustc_driver_impl[7b907c5adb31dd75]::compiler_entrypoint::{closure#0}>::{closure#2}
30: 0x10c3ab9a0 - std[2593b8881ffc8f3d]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[24eeb4300d06b8bb]::util::run_in_thread_with_globals<rustc_interface[24eeb4300d06b8bb]::util::run_in_thread_pool_with_globals<rustc_interface[24eeb4300d06b8bb]::interface::run_compiler<(), rustc_driver_impl[7b907c5adb31dd75]::compiler_entrypoint::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
31: 0x10c3c474b - <std[2593b8881ffc8f3d]::thread::lifecycle::spawn_unchecked<rustc_interface[24eeb4300d06b8bb]::util::run_in_thread_with_globals<rustc_interface[24eeb4300d06b8bb]::util::run_in_thread_pool_with_globals<rustc_interface[24eeb4300d06b8bb]::interface::run_compiler<(), rustc_driver_impl[7b907c5adb31dd75]::compiler_entrypoint::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[78285f1485d4cbbc]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
32: 0x10ee7238b - <std[2593b8881ffc8f3d]::sys::thread::unix::Thread>::new::thread_start
33: 0x7ff80aa76e05 - __pthread_start
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 `/Volumes/T7/workspace/tmp/rustc-ice-2026-10-27T11_11_58-86764.txt` to your bug report
note: rustc 1.101.0-nightly (16d1ffac1 2026-10-26) running on x86_64-apple-darwin
query stack during panic:
#0 [typeck_root] type-checking `test`
#1 [analysis] running analysis passes on crate `objpick`
end of query stack
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0307`.
Notes
- ICE location:
compiler/rustc_hir_typeck/src/method/confirm.rsLine-410
rust/compiler/rustc_hir_typeck/src/method/confirm.rs
Lines 397 to 416 in 16d1ffa
autoderef .include_raw_pointers() .find_map(|(ty, _)| match ty.kind() { ty::Dynamic(data, ..) => Some(closure( self, ty, data.principal().unwrap_or_else(|| { span_bug!(self.span, "calling trait method on empty object?") }), )), _ => None, }) .unwrap_or_else(|| { span_bug!( self.span, "self-type `{}` for ObjectPick never dereferenced to an object", self_ty ) }) } - Currently I cannot find any opened ICE issues with "ObjectPick" query. link
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-found-by-fuzzingStatus: This issue was found using fuzzing. It may not arise in practical cases.Status: This issue was found using fuzzing. It may not arise in practical cases.S-has-bisectionStatus: A bisection has been found for this issueStatus: A bisection has been found for this issueT-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.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Activity
cushionbadak commentedon Oct 27, 2026
Regression innightly-2024-11-25My Fault, 2024-11-25 is just when
--edition 2024support begins.Regression in
nightly-2024-02-15.Might be related to pr-120847 ?
Bisection Log
maxdexh commentedon Oct 27, 2026
Yeah #120847 looks plausible