-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Add field representing types #146307
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
base: main
Are you sure you want to change the base?
Add field representing types #146307
Conversation
2bd0ff4 to
a6b191a
Compare
|
changes to the core type system Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred in diagnostic error codes Some changes occurred to the CTFE machinery Some changes occurred in compiler/rustc_sanitizers cc @rcvalle HIR ty lowering was modified cc @fmease Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri Some changes occurred in exhaustiveness checking cc @Nadrieril This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @vakaras Some changes occurred in compiler/rustc_codegen_ssa This PR changes rustc_public cc @oli-obk, @celinval, @ouz-a Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some changes to symbol mangling & constant names that I'm not sure how they resulted from my changes. Anybody has any idea?
|
Some changes occurred to constck cc @fee1-dead |
This comment has been minimized.
This comment has been minimized.
|
Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you ensure you have a test that is generic over the field and that queries the offset? That would hit all these points I just mentioned here (or at least some of them), and anyway seems like a very non-trivial case to test.
Or... wait the intrinsic is only used to define that one associated const? I don't know exactly when and how we normalize those but it may be that we indeed never see that MIR in its generic form then...
The test may have to invoke the intrinsic directly to trigger the case I am thinking of.
c4cdce1 to
4a6b88b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I met with Xiang and we resolved most of my todos. I converted the rest to fixme; the ones highlighted here are the most questionable ones.
I still plan to add more (ui) tests, but am very open to suggestions as I am lacking creativity there (or rather, I'm missing the forest for the trees, so some help in that regard would be great).
@rustbot ready
| // FIXME(FRTs): use correct error number | ||
| E0001, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which number should I use here (and in the other places in this function)?
| // FIXME(FRTs): add FieldId to the visitor infrastructure if we need to visit it. | ||
| ty::FRT(ty, _field) => ty.visit_with(visitor), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably don't need this, right?
| /// Field representing type. | ||
| // FIXME(FRTs): should we have a `Option<DefId>` here that gets filled with the Adt's DefId? | ||
| FRT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this, but I also don't know what SimplifiedType is used for...
| } | ||
| ty::Alias(kind, data) => ty::Alias(kind, data.try_fold_with(folder)?), | ||
| ty::Pat(ty, pat) => ty::Pat(ty.try_fold_with(folder)?, pat.try_fold_with(folder)?), | ||
| ty::FRT(ty, field) => *field.resolve(folder.cx(), ty.try_fold_with(folder)?).kind(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is essentially to normalize the FRT and it seems to work, at least in simple tests. Let me know if this is how it's intended to work.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| fn fails2<T: Constraint>() { | ||
| let _: field_of!(<<T as WithAssoc>::Assoc as Special>::Assoc, field); | ||
| // last time I checked this, this line above produced an ICE due to a `delay_bug` | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lcnr here is a very weird case that fails with a delayed span bug with the next solver. Here is the example alone (the delayed span won't get triggered in the test due to the error above & below):
#![feature(field_projections)]
#![expect(incomplete_features, dead_code)]
use std::field::field_of;
struct Struct {
field: u32,
}
trait WithAssoc {
type Assoc: Special;
}
trait Special {
type Assoc;
}
trait Constraint: WithAssoc<Assoc = Struct> {}
impl Special for Struct {
type Assoc = Self;
}
fn fails2<T: Constraint>() {
let _: field_of!(<<T as WithAssoc>::Assoc as Special>::Assoc, field);
}ICE Log
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: error performing operation: query type op
--> demo.rs:27:12
|
27 | let _: field_of!(<<T as WithAssoc>::Assoc as Special>::Assoc, field);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: delayed at .../compiler/rustc_trait_selection/src/traits/query/type_op/custom.rs:95:25
0: emit_diagnostic
at ./compiler/rustc_errors/src/lib.rs:1576:41
1: emit_diagnostic
at ./compiler/rustc_errors/src/lib.rs:1136:33
2: emit_producing_error_guaranteed<rustc_span::ErrorGuaranteed>
at ./compiler/rustc_errors/src/diagnostic.rs:1398:29
3: span_delayed_bug<rustc_span::span_encoding::Span, alloc::string::String>
at ./compiler/rustc_errors/src/lib.rs:1378:82
4: {closure#0}<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::AscribeUserType>, (), rustc_trait_selection::traits::query::type_op::{impl#0}::fully_perform::{closure_env#0}<rustc_middle::traits::query::type_op::AscribeUserType>>
at ./compiler/rustc_trait_selection/src/traits/query/type_op/custom.rs:95:25
5: map_err<(), rustc_type_ir::solve::NoSolution, rustc_span::ErrorGuaranteed, rustc_trait_selection::traits::query::type_op::custom::scrape_region_constraints::{closure#0}::{closure_env#0}<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::AscribeUserType>, (), rustc_trait_selection::traits::query::type_op::{impl#0}::fully_perform::{closure_env#0}<rustc_middle::traits::query::type_op::AscribeUserType>>>
at /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/core/src/result.rs:968:27
6: {closure#0}<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::AscribeUserType>, (), rustc_trait_selection::traits::query::type_op::{impl#0}::fully_perform::{closure_env#0}<rustc_middle::traits::query::type_op::AscribeUserType>>
at ./compiler/rustc_trait_selection/src/traits/query/type_op/custom.rs:94:30
7: commit_if_ok<(), rustc_span::ErrorGuaranteed, rustc_trait_selection::traits::query::type_op::custom::scrape_region_constraints::{closure_env#0}<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::AscribeUserType>, (), rustc_trait_selection::traits::query::type_op::{impl#0}::fully_perform::{closure_env#0}<rustc_middle::traits::query::type_op::AscribeUserType>>>
at ./compiler/rustc_infer/src/infer/snapshot/mod.rs:86:17
8: scrape_region_constraints<rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::AscribeUserType>, (), rustc_trait_selection::traits::query::type_op::{impl#0}::fully_perform::{closure_env#0}<rustc_middle::traits::query::type_op::AscribeUserType>>
at ./compiler/rustc_trait_selection/src/traits/query/type_op/custom.rs:92:23
9: fully_perform<rustc_middle::traits::query::type_op::AscribeUserType>
at ./compiler/rustc_trait_selection/src/traits/query/type_op/mod.rs:156:23
10: fully_perform_op_raw<(), rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::AscribeUserType>>
at ./compiler/rustc_borrowck/src/type_check/canonical.rs:42:12
11: fully_perform_op<(), rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::AscribeUserType>>
at ./compiler/rustc_borrowck/src/type_check/canonical.rs:103:9
12: ascribe_user_type
at ./compiler/rustc_borrowck/src/type_check/canonical.rs:318:50
13: check_user_type_annotations
at ./compiler/rustc_borrowck/src/type_check/mod.rs:393:18
14: type_check
at ./compiler/rustc_borrowck/src/type_check/mod.rs:165:12
15: borrowck_collect_region_constraints
at ./compiler/rustc_borrowck/src/lib.rs:354:9
16: do_mir_borrowck
at ./compiler/rustc_borrowck/src/root_cx.rs:253:26
17: mir_borrowck
at ./compiler/rustc_borrowck/src/lib.rs:135:17
18: {closure#0}
at ./compiler/rustc_query_impl/src/plumbing.rs:298:9
19: __rust_begin_short_backtrace<rustc_query_impl::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure_env#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
at ./compiler/rustc_query_impl/src/plumbing.rs:582:18
20: {closure#2}
at ./compiler/rustc_query_impl/src/plumbing.rs:659:25
21: call_once<rustc_query_impl::query_impl::mir_borrowck::dynamic_query::{closure_env#2}, (rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>
at /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/core/src/ops/function.rs:250:5
22: compute<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>, false, false, false>
at ./compiler/rustc_query_impl/src/lib.rs:119:9
23: {closure#0}<rustc_query_impl::DynamicConfig<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>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>
at ./compiler/rustc_query_system/src/query/plumbing.rs:506:72
24: {closure#0}<rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<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>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>, rustc_middle::query::erase::Erased<[u8; 8]>>
at ./compiler/rustc_middle/src/ty/context/tls.rs:60:9
25: try_with<core::cell::Cell<*const ()>, rustc_middle::ty::context::tls::enter_context::{closure_env#0}<rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<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>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>, rustc_middle::query::erase::Erased<[u8; 8]>>, rustc_middle::query::erase::Erased<[u8; 8]>>
at /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/std/src/thread/local.rs:513:12
26: with<core::cell::Cell<*const ()>, rustc_middle::ty::context::tls::enter_context::{closure_env#0}<rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<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>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>, rustc_middle::query::erase::Erased<[u8; 8]>>, rustc_middle::query::erase::Erased<[u8; 8]>>
at /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/std/src/thread/local.rs:477:20
27: enter_context<rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<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>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>, rustc_middle::query::erase::Erased<[u8; 8]>>
at ./compiler/rustc_middle/src/ty/context/tls.rs:57:9
28: {closure#0}<rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<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>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>>
at ./compiler/rustc_query_impl/src/plumbing.rs:169:13
29: {closure#0}<rustc_query_impl::plumbing::{impl#3}::start_query::{closure_env#0}<rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<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>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>>, rustc_middle::query::erase::Erased<[u8; 8]>>
at ./compiler/rustc_middle/src/ty/context/tls.rs:112:9
30: {closure#0}<rustc_middle::ty::context::tls::with_related_context::{closure_env#0}<rustc_query_impl::plumbing::{impl#3}::start_query::{closure_env#0}<rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<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>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>>, rustc_middle::query::erase::Erased<[u8; 8]>>, rustc_middle::query::erase::Erased<[u8; 8]>>
at ./compiler/rustc_middle/src/ty/context/tls.rs:90:36
31: with_context_opt<rustc_middle::ty::context::tls::with_context::{closure_env#0}<rustc_middle::ty::context::tls::with_related_context::{closure_env#0}<rustc_query_impl::plumbing::{impl#3}::start_query::{closure_env#0}<rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<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>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>>, rustc_middle::query::erase::Erased<[u8; 8]>>, rustc_middle::query::erase::Erased<[u8; 8]>>, rustc_middle::query::erase::Erased<[u8; 8]>>
at ./compiler/rustc_middle/src/ty/context/tls.rs:79:18
32: with_context<rustc_middle::ty::context::tls::with_related_context::{closure_env#0}<rustc_query_impl::plumbing::{impl#3}::start_query::{closure_env#0}<rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<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>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>>, rustc_middle::query::erase::Erased<[u8; 8]>>, rustc_middle::query::erase::Erased<[u8; 8]>>
at ./compiler/rustc_middle/src/ty/context/tls.rs:90:5
33: with_related_context<rustc_query_impl::plumbing::{impl#3}::start_query::{closure_env#0}<rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<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>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>>, rustc_middle::query::erase::Erased<[u8; 8]>>
at ./compiler/rustc_middle/src/ty/context/tls.rs:103:5
34: start_query<rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<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>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>>
at ./compiler/rustc_query_impl/src/plumbing.rs:155:9
35: execute_job_non_incr<rustc_query_impl::DynamicConfig<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>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>
at ./compiler/rustc_query_system/src/query/plumbing.rs:506:22
36: execute_job<rustc_query_impl::DynamicConfig<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>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
at ./compiler/rustc_query_system/src/query/plumbing.rs:442:9
37: try_execute_query<rustc_query_impl::DynamicConfig<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>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
at ./compiler/rustc_query_system/src/query/plumbing.rs:385:13
38: {closure#0}<rustc_query_impl::DynamicConfig<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>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>
at ./compiler/rustc_query_system/src/query/plumbing.rs:827:32
39: maybe_grow<rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::query::plumbing::get_query_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<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>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>>
at ~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/stacker-0.1.21/src/lib.rs:57:9
40: ensure_sufficient_stack<rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::query::plumbing::get_query_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<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>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>>
at ./compiler/rustc_data_structures/src/stack.rs:21:5
41: get_query_non_incr<rustc_query_impl::DynamicConfig<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>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>
at ./compiler/rustc_query_system/src/query/plumbing.rs:827:5
42: __rust_end_short_backtrace
at ./compiler/rustc_query_impl/src/plumbing.rs:635:26
43: 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 ./compiler/rustc_middle/src/query/inner.rs:51:9
44: mir_borrowck<rustc_span::def_id::LocalDefId>
at ./compiler/rustc_middle/src/query/plumbing.rs:173:9
45: {closure#0}
at ./compiler/rustc_interface/src/passes.rs:1107:33
46: {closure#0}<rustc_interface::passes::run_required_analyses::{closure#1}::{closure_env#0}>
at ./compiler/rustc_middle/src/hir/map.rs:339:79
47: {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_interface::passes::run_required_analyses::{closure#1}::{closure_env#0}>>
at ./compiler/rustc_data_structures/src/sync/parallel.rs:181:30
48: 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_interface::passes::run_required_analyses::{closure#1}::{closure_env#0}>>>
at /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/core/src/panic/unwind_safe.rs:274:9
49: 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_interface::passes::run_required_analyses::{closure#1}::{closure_env#0}>>>, ()>
at /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/std/src/panicking.rs:581:40
50: 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_interface::passes::run_required_analyses::{closure#1}::{closure_env#0}>>>>
at /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/std/src/panicking.rs:544:19
51: 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_interface::passes::run_required_analyses::{closure#1}::{closure_env#0}>>>, ()>
at /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/std/src/panic.rs:359:14
52: 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_interface::passes::run_required_analyses::{closure#1}::{closure_env#0}>>>
at ./compiler/rustc_data_structures/src/sync/parallel.rs:23:9
53: {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_interface::passes::run_required_analyses::{closure#1}::{closure_env#0}>>
at ./compiler/rustc_data_structures/src/sync/parallel.rs:181:23
54: 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_interface::passes::run_required_analyses::{closure#1}::{closure_env#0}>>>
at /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/core/src/slice/iter/macros.rs:301:21
55: {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_interface::passes::run_required_analyses::{closure#1}::{closure_env#0}>>
at ./compiler/rustc_data_structures/src/sync/parallel.rs:180:27
56: 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_interface::passes::run_required_analyses::{closure#1}::{closure_env#0}>>>
at ./compiler/rustc_data_structures/src/sync/parallel.rs:39:15
57: 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_interface::passes::run_required_analyses::{closure#1}::{closure_env#0}>>
at ./compiler/rustc_data_structures/src/sync/parallel.rs:175:5
58: par_hir_body_owners<rustc_interface::passes::run_required_analyses::{closure#1}::{closure_env#0}>
at ./compiler/rustc_middle/src/hir/map.rs:339:9
59: {closure#1}
at ./compiler/rustc_interface/src/passes.rs:1097:13
60: run<(), rustc_interface::passes::run_required_analyses::{closure_env#1}>
at ./compiler/rustc_data_structures/src/profiling.rs:844:9
61: time<(), rustc_interface::passes::run_required_analyses::{closure_env#1}>
at ./compiler/rustc_session/src/utils.rs:17:50
62: run_required_analyses
at ./compiler/rustc_interface/src/passes.rs:1096:10
63: analysis
at ./compiler/rustc_interface/src/passes.rs:1144:5
64: {closure#0}
at ./compiler/rustc_query_impl/src/plumbing.rs:298:9
65: __rust_begin_short_backtrace<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure_env#0}, rustc_middle::query::erase::Erased<[u8; 0]>>
at ./compiler/rustc_query_impl/src/plumbing.rs:582:18
66: {closure#2}
at ./compiler/rustc_query_impl/src/plumbing.rs:659:25
67: call_once<rustc_query_impl::query_impl::analysis::dynamic_query::{closure_env#2}, (rustc_middle::ty::context::TyCtxt, ())>
at /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/core/src/ops/function.rs:250:5
68: compute<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>
at ./compiler/rustc_query_impl/src/lib.rs:119:9
69: {closure#0}<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>
at ./compiler/rustc_query_system/src/query/plumbing.rs:506:72
70: {closure#0}<rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>, rustc_middle::query::erase::Erased<[u8; 0]>>
at ./compiler/rustc_middle/src/ty/context/tls.rs:60:9
71: try_with<core::cell::Cell<*const ()>, rustc_middle::ty::context::tls::enter_context::{closure_env#0}<rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>, rustc_middle::query::erase::Erased<[u8; 0]>>, rustc_middle::query::erase::Erased<[u8; 0]>>
at /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/std/src/thread/local.rs:513:12
72: with<core::cell::Cell<*const ()>, rustc_middle::ty::context::tls::enter_context::{closure_env#0}<rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>, rustc_middle::query::erase::Erased<[u8; 0]>>, rustc_middle::query::erase::Erased<[u8; 0]>>
at /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/std/src/thread/local.rs:477:20
73: enter_context<rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>, rustc_middle::query::erase::Erased<[u8; 0]>>
at ./compiler/rustc_middle/src/ty/context/tls.rs:57:9
74: {closure#0}<rustc_middle::query::erase::Erased<[u8; 0]>, rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>>
at ./compiler/rustc_query_impl/src/plumbing.rs:169:13
75: {closure#0}<rustc_query_impl::plumbing::{impl#3}::start_query::{closure_env#0}<rustc_middle::query::erase::Erased<[u8; 0]>, rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>>, rustc_middle::query::erase::Erased<[u8; 0]>>
at ./compiler/rustc_middle/src/ty/context/tls.rs:112:9
76: {closure#0}<rustc_middle::ty::context::tls::with_related_context::{closure_env#0}<rustc_query_impl::plumbing::{impl#3}::start_query::{closure_env#0}<rustc_middle::query::erase::Erased<[u8; 0]>, rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>>, rustc_middle::query::erase::Erased<[u8; 0]>>, rustc_middle::query::erase::Erased<[u8; 0]>>
at ./compiler/rustc_middle/src/ty/context/tls.rs:90:36
77: with_context_opt<rustc_middle::ty::context::tls::with_context::{closure_env#0}<rustc_middle::ty::context::tls::with_related_context::{closure_env#0}<rustc_query_impl::plumbing::{impl#3}::start_query::{closure_env#0}<rustc_middle::query::erase::Erased<[u8; 0]>, rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>>, rustc_middle::query::erase::Erased<[u8; 0]>>, rustc_middle::query::erase::Erased<[u8; 0]>>, rustc_middle::query::erase::Erased<[u8; 0]>>
at ./compiler/rustc_middle/src/ty/context/tls.rs:79:18
78: with_context<rustc_middle::ty::context::tls::with_related_context::{closure_env#0}<rustc_query_impl::plumbing::{impl#3}::start_query::{closure_env#0}<rustc_middle::query::erase::Erased<[u8; 0]>, rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>>, rustc_middle::query::erase::Erased<[u8; 0]>>, rustc_middle::query::erase::Erased<[u8; 0]>>
at ./compiler/rustc_middle/src/ty/context/tls.rs:90:5
79: with_related_context<rustc_query_impl::plumbing::{impl#3}::start_query::{closure_env#0}<rustc_middle::query::erase::Erased<[u8; 0]>, rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>>, rustc_middle::query::erase::Erased<[u8; 0]>>
at ./compiler/rustc_middle/src/ty/context/tls.rs:103:5
80: start_query<rustc_middle::query::erase::Erased<[u8; 0]>, rustc_query_system::query::plumbing::execute_job_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>>
at ./compiler/rustc_query_impl/src/plumbing.rs:155:9
81: execute_job_non_incr<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>
at ./compiler/rustc_query_system/src/query/plumbing.rs:506:22
82: execute_job<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
at ./compiler/rustc_query_system/src/query/plumbing.rs:442:9
83: try_execute_query<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
at ./compiler/rustc_query_system/src/query/plumbing.rs:385:13
84: {closure#0}<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>
at ./compiler/rustc_query_system/src/query/plumbing.rs:827:32
85: maybe_grow<rustc_middle::query::erase::Erased<[u8; 0]>, rustc_query_system::query::plumbing::get_query_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>>
at ~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/stacker-0.1.21/src/lib.rs:57:9
86: ensure_sufficient_stack<rustc_middle::query::erase::Erased<[u8; 0]>, rustc_query_system::query::plumbing::get_query_non_incr::{closure_env#0}<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>>
at ./compiler/rustc_data_structures/src/stack.rs:21:5
87: get_query_non_incr<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>
at ./compiler/rustc_query_system/src/query/plumbing.rs:827:5
88: __rust_end_short_backtrace
at ./compiler/rustc_query_impl/src/plumbing.rs:635:26
89: query_ensure<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>>
at ./compiler/rustc_middle/src/query/inner.rs:51:9
90: analysis
at ./compiler/rustc_middle/src/query/plumbing.rs:173:9
91: {closure#2}
at ./compiler/rustc_driver_impl/src/lib.rs:367:29
92: {closure#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
at ./compiler/rustc_interface/src/passes.rs:1020:27
93: {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 ./compiler/rustc_middle/src/ty/context.rs:1659:37
94: {closure#0}<rustc_middle::ty::context::{impl#20}::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 ./compiler/rustc_middle/src/ty/context/tls.rs:60:9
95: try_with<core::cell::Cell<*const ()>, rustc_middle::ty::context::tls::enter_context::{closure_env#0}<rustc_middle::ty::context::{impl#20}::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/1b6e21e163baa0b20f119e17e3871910978a60b6/library/std/src/thread/local.rs:513:12
96: with<core::cell::Cell<*const ()>, rustc_middle::ty::context::tls::enter_context::{closure_env#0}<rustc_middle::ty::context::{impl#20}::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/1b6e21e163baa0b20f119e17e3871910978a60b6/library/std/src/thread/local.rs:477:20
97: enter_context<rustc_middle::ty::context::{impl#20}::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 ./compiler/rustc_middle/src/ty/context/tls.rs:57:9
98: 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 ./compiler/rustc_middle/src/ty/context.rs:1659:9
99: 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 ./compiler/rustc_middle/src/ty/context.rs:1866:13
100: {closure#2}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
at ./compiler/rustc_interface/src/passes.rs:987:9
101: 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/1b6e21e163baa0b20f119e17e3871910978a60b6/library/core/src/ops/function.rs:250:5
102: 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/1b6e21e163baa0b20f119e17e3871910978a60b6/library/alloc/src/boxed.rs:2206:9
103: create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
at ./compiler/rustc_interface/src/passes.rs:1028:5
104: {closure#0}
at ./compiler/rustc_driver_impl/src/lib.rs:340:22
105: {closure#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>
at ./compiler/rustc_interface/src/interface.rs:552:80
106: call_once<(), rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>
at /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/core/src/panic/unwind_safe.rs:274:9
107: 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/1b6e21e163baa0b20f119e17e3871910978a60b6/library/std/src/panicking.rs:581:40
108: 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/1b6e21e163baa0b20f119e17e3871910978a60b6/library/std/src/panicking.rs:544:19
109: 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/1b6e21e163baa0b20f119e17e3871910978a60b6/library/std/src/panic.rs:359:14
110: {closure#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>
at ./compiler/rustc_interface/src/interface.rs:552:23
111: {closure#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>
at ./compiler/rustc_interface/src/util.rs:209:17
112: {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 ./compiler/rustc_interface/src/util.rs:163:24
113: 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 ~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/scoped-tls-1.0.1/src/lib.rs:137:9
114: 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 ./compiler/rustc_span/src/lib.rs:144:21
115: {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 ./compiler/rustc_interface/src/util.rs:159:17
116: __rust_begin_short_backtrace<rustc_interface::util::run_in_thread_with_globals::{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 /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/std/src/sys/backtrace.rs:160:18
117: {closure#0}<rustc_interface::util::run_in_thread_with_globals::{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 /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/std/src/thread/lifecycle.rs:92:13
118: call_once<(), std::thread::lifecycle::spawn_unchecked::{closure#1}::{closure_env#0}<rustc_interface::util::run_in_thread_with_globals::{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 /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/core/src/panic/unwind_safe.rs:274:9
119: do_call<core::panic::unwind_safe::AssertUnwindSafe<std::thread::lifecycle::spawn_unchecked::{closure#1}::{closure_env#0}<rustc_interface::util::run_in_thread_with_globals::{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 /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/std/src/panicking.rs:581:40
120: catch_unwind<(), core::panic::unwind_safe::AssertUnwindSafe<std::thread::lifecycle::spawn_unchecked::{closure#1}::{closure_env#0}<rustc_interface::util::run_in_thread_with_globals::{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 /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/std/src/panicking.rs:544:19
121: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<std::thread::lifecycle::spawn_unchecked::{closure#1}::{closure_env#0}<rustc_interface::util::run_in_thread_with_globals::{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 /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/std/src/panic.rs:359:14
122: {closure#1}<rustc_interface::util::run_in_thread_with_globals::{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 /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/std/src/thread/lifecycle.rs:90:26
123: call_once<std::thread::lifecycle::spawn_unchecked::{closure_env#1}<rustc_interface::util::run_in_thread_with_globals::{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 /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/core/src/ops/function.rs:250:5
124: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
at /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/alloc/src/boxed.rs:2206:9
125: std::sys::thread::unix::Thread::new::thread_start
at /rustc/1b6e21e163baa0b20f119e17e3871910978a60b6/library/std/src/sys/thread/unix.rs:118:17
126: start_thread
127: __clone3
--> demo.rs:27:12
|
27 | let _: field_of!(<<T as WithAssoc>::Assoc as Special>::Assoc, field);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error: internal compiler error originates in the macro `field_of` (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: please make sure that you have updated to the latest nightly
note: please attach the file at `.../rustc-ice-2026-01-16T12_40_15-28377.txt` to your bug report
note: rustc 1.94.0-dev running on x86_64-unknown-linux-gnu
note: compiler flags: --crate-type lib -Z next-solver
query stack during panic:
end of query stack
Am I missing anything in the code for this to work, or is this a bug in the next solver? 🤔
Add Field Representing Types (FRTs)
This PR implements the first step of the field projection lang experiment (Tracking Issue: #145383). Field representing types (FRTs) are a new kind of type. They can be named through the use of the
field_of!macro that uses the same syntax as theoffset_of!macro. They natively implement theFieldtrait that's also added in this PR. It exposes information about the field such as the type of the field, the type of the base (i.e. the type that contains the field) and the offset within that base type.This PR was created in collaboration with @dingxiangfei2009, it wouldn't have been possible without him, so huge thanks for mentoring me!
I updated my library solution for field projections to use the FRTs from
coreinstead of creating my own using the hash of the name of the field. See the Rust-for-Linux/field-projectionlang-experimentbranch.API added to
core::fieldExplanation of Field Representing Types (FRTs)
FRTs are used for compile-time & trait-level reflection for fields of structs & tuples. Each struct & tuple has a unique compiler-generated type nameable through the
field_of!macro (using the same syntax asoffset_of!). This type natively contains information about the field such as the outermost container, type of the field and its offset. Users may implement additional traits on these types in order to record custom information (for example a crate may define aPinnableFieldtrait that records whether the field is structurally pinned).They are the foundation of field projections, a general operation that's generic over the fields of a struct. This genericism needs to be expressible in the trait system. FRTs make this possible, since an operation generic over fields can just be a function with a generic parameter
F: Field.FRTs should act as though they were defined as
enum MyStruct_my_field<StructGenerics> {}next to the struct. So it should be local to the crate defining the struct so that one can implement any trait for the FRT. TheFieldtraits should be implemented by the compiler & populated with correct information (unsafecode needs to be able to rely on them being correct).Implementation Details
offset_of!type checking machinery in theFnCtxtcase,FieldPathfor using them in bothfield_of!andoffset_of!,lower_field_pathtoHirTyLowerer,OFFSETconstant of theUnalignedFieldtrait,Decisions
During the development several desirable properties of FRTs were discovered. Either due to simplifying the implementation or because of language design reasons. These decisions are:
FRTs are uninhabited and have the same layout as
![Unaligned]Fieldtraits, so no need to make them useful as values.FreezeFRTs are considered local by the orphan check if and only if:
So
field_of!(Foo, bar.baz)is local ifFooandBarare local (Bazis allowed to be foreign). Except for tuples, fundamental types are not handled specially. Tuples are allowed as intermediate bases, as long as the first one isn't a tuple. Sofield_of!(Foo, bar.0.baz)is considered local ifFoois local &barhas type(Bar0, Bar1, ..., BarN)withBar0also being local.The reasoning for these two rules is the following: we don't want to allow foreign crates control over FRTs, since they will often encode field invariants (such as the offset in the
UnalignedFieldcase, or that the field is aligned (Field)).Tuples are an exception to this, but only if the user controls the outer-most container.
In the future, the first rule could be lifted to:
This would allow users to implement traits on
field_of!((LocalTy, LocalTy), 0). But still preventfield_of!((usize, usize), 0).traits may be implemented for FRTs in the usual way (so if the FRT or the trait is local). There is an exception:
Drop: since FRTs are uninhabited, having aDropimpl doesn't really make sense. It also would have required duplicating a lot of logic from ADTs and as such it simplified the implementation.The
Fieldtrait is not user-implementableTODOs
There are several
FIXME(field_projections)scattered around the code. These are either because I & Ding didn't 100% know what to do in that case. Note that not all are comments, some are also contained asbug!("FIXME(field_projections): ...").compiler/rustc_symbol_mangling/src/v0.rscompiler/rustc_symbol_mangling/src/export.rscompiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/transform.rscompiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rssrc/librustdoc/passes/collect_intra_doc_links.rssrc/librustdoc/json/conversions.rssrc/librustdoc/clean/mod.rsenumsupport would bedecided against enum support in this PR
OFFSETconstant for those, or do we need different traits?decided against
?Sizedtypes in this PR