Compiling my_test v0.1.0 (/tmp/my_test)
warning: unused variable: `node`
--> src/main.rs:38:9
|
38 | let node = Box::new(Node::new(Noop, vec![Box::new(Node::new(Noop, vec![]))]));
| ^^^^ help: if this is intentional, prefix it with an underscore: `_node`
|
= note: `#[warn(unused_variables)]` on by default
warning: fields `transform` and `children` are never read
--> src/main.rs:13:5
|
9 | pub struct Node<T>
| ---- fields in this struct
...
13 | transform: T,
| ^^^^^^^^^
14 | children: Vec<Child<T>>,
| ^^^^^^^^
|
= note: `#[warn(dead_code)]` 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: broken MIR in DefId(0:21 ~ my_test[db07]::main) ([move _11]): std::boxed::Box<dyn [Binder { value: Trait(Propagate<()>), bound_vars: [Region(BrNamed(DefId(0:10 ~ my_test[db07]::Child::'a), 'a))] }] + '?14, std::alloc::Global> is not a subtype of std::boxed::Box<dyn [Binder { value: Trait(Propagate<<main::Noop as Transform>::Output<'a>>), bound_vars: [Region(BrNamed(DefId(0:10 ~ my_test[db07]::Child::'a), 'a))] }] + '?7, std::alloc::Global>: NoSolution
--> src/main.rs:38:41
|
38 | let node = Box::new(Node::new(Noop, vec![Box::new(Node::new(Noop, vec![]))]));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: delayed at compiler/rustc_borrowck/src/type_check/mod.rs:2570:17
0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
1: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
3: <rustc_errors::DiagCtxtHandle>::span_delayed_bug::<rustc_span::span_encoding::Span, alloc::string::String>
4: <rustc_borrowck::type_check::TypeChecker>::typeck_mir
5: rustc_borrowck::type_check::type_check
6: rustc_borrowck::nll::compute_regions
7: rustc_borrowck::do_mir_borrowck
8: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::mir_borrowck::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::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, true>
10: rustc_query_impl::query_impl::mir_borrowck::get_query_incr::__rust_end_short_backtrace
11: rustc_interface::passes::analysis
12: 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]>>
13: 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, true>
14: rustc_query_impl::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
15: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
16: std::sys::backtrace::__rust_begin_short_backtrace::<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#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
17: <<std::thread::Builder>::spawn_unchecked_<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#1}, 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}
18: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/alloc/src/boxed.rs:2070:9
19: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/alloc/src/boxed.rs:2070:9
20: std::sys::pal::unix::thread::Thread::new::thread_start
at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sys/pal/unix/thread.rs:108:17
21: <unknown>
22: <unknown>
--> src/main.rs:38:41
|
38 | let node = Box::new(Node::new(Noop, vec![Box::new(Node::new(Noop, vec![]))]));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error: internal compiler error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
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: rustc 1.81.0 (eeb90cda1 2024-09-04) running on x86_64-unknown-linux-gnu
note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
end of query stack
warning: `my_test` (bin "my_test") generated 2 warnings
error: could not compile `my_test` (bin "my_test"); 2 warnings emitted
Code
MWE below, also tested on nightly (via the playground). Interestingly the error goes away if I manually inline the
Node::newcalls. Minimised from a filter graph that uses trait objects for type erasure.Meta
rustc --version --verbose:Error output
Backtrace