Skip to content

Conversation

@BennoLossin
Copy link
Contributor

@BennoLossin BennoLossin commented Sep 7, 2025

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 the offset_of! macro. They natively implement the Field trait 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 core instead of creating my own using the hash of the name of the field. See the Rust-for-Linux/field-projection lang-experiment branch.

API added to core::field

pub unsafe trait Field {
    type Base;
    
    type Type;

    const OFFSET: usize;
}

pub macro field_of($Container:ty, $($fields:expr)+ $(,)?);

Explanation 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 as offset_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 a PinnableField trait 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. The Field traits should be implemented by the compiler & populated with correct information (unsafe code needs to be able to rely on them being correct).

Implementation Details

  • Reuse offset_of! type checking machinery in the FnCtxt case,
    • Create a new type called FieldPath for using them in both field_of! and offset_of!,
    • Add lower_field_path to HirTyLowerer,
  • Use an intrinsic to add the offset information into the associated OFFSET constant of the UnalignedField trait,

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 !

    • They only contain type information via the [Unaligned]Field traits, so no need to make them useful as values.
    • This simplifies const-eval.
    • They are thus also Freeze
  • FRTs are considered local by the orphan check if and only if:

    • The outer-most container is a local struct,
    • All intermediate container types that are structs must be local (we don't consider the type of the field to be an intermediate base)

    So field_of!(Foo, bar.baz) is local if Foo and Bar are local (Baz is 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. So field_of!(Foo, bar.0.baz) is considered local if Foo is local & bar has type (Bar0, Bar1, ..., BarN) with Bar0 also 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 UnalignedField case, 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:

    • local structs are valid outer-most containers,
    • tuples where every type is a valid outer-most container are also valid outer-most containers.

    This would allow users to implement traits on field_of!((LocalTy, LocalTy), 0). But still prevent field_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 a Drop impl 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 Field trait is not user-implementable

    • this also can be lifted in the future, but for now only FRTs will implement it.

TODOs

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 as bug!("FIXME(field_projections): ...").

  • symbol mangling for FTRs.
    • compiler/rustc_symbol_mangling/src/v0.rs
    • compiler/rustc_symbol_mangling/src/export.rs
    • compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/transform.rs
    • compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs
  • rustdoc support for FTRs
    • src/librustdoc/passes/collect_intra_doc_links.rs
    • src/librustdoc/json/conversions.rs
    • src/librustdoc/clean/mod.rs
  • check that FRTs support tuples, unions and structs
  • investigate how complex enum support would be
    decided against enum support in this PR
  • what about DSTs? can we really support the OFFSET constant for those, or do we need different traits?
    decided against ?Sized types in this PR

@rustbot
Copy link
Collaborator

rustbot commented Sep 7, 2025

r? @lcnr

rustbot has assigned @lcnr.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustdoc-json Area: Rustdoc JSON backend PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Sep 7, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 8, 2025

changes to the core type system

cc @compiler-errors, @lcnr

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred in diagnostic error codes

cc @GuillaumeGomez

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

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

cc @WaffleLapkin

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
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Copy link
Contributor Author

@BennoLossin BennoLossin left a 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?

View changes since this review

@rustbot
Copy link
Collaborator

rustbot commented Sep 9, 2025

Some changes occurred to constck

cc @fee1-dead

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Sep 9, 2025

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

@rust-log-analyzer

This comment has been minimized.

@tmandry tmandry added the F-field_projections `#![feature(field_projections)]` label Sep 9, 2025
Copy link
Member

@RalfJung RalfJung left a 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.

View changes since this review

Copy link
Contributor Author

@BennoLossin BennoLossin left a 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

View changes since this review

Comment on lines +3617 to +3618
// FIXME(FRTs): use correct error number
E0001,
Copy link
Contributor Author

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)?

Comment on lines +496 to +497
// FIXME(FRTs): add FieldId to the visitor infrastructure if we need to visit it.
ty::FRT(ty, _field) => ty.visit_with(visitor),
Copy link
Contributor Author

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?

Comment on lines +49 to +51
/// Field representing type.
// FIXME(FRTs): should we have a `Option<DefId>` here that gets filled with the Adt's DefId?
FRT,
Copy link
Contributor Author

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(),
Copy link
Contributor Author

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.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 16, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Comment on lines +30 to +33
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`
}
Copy link
Contributor Author

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? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustdoc-json Area: Rustdoc JSON backend F-field_projections `#![feature(field_projections)]` I-lang-radar Items that are on lang's radar and will need eventual work or consideration. PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants