Skip to content

Instantly share code, notes, and snippets.

@nihalpasham
Created September 30, 2025 13:14
Show Gist options
  • Save nihalpasham/0de75eb39e1b62eadd16f8a1ee422732 to your computer and use it in GitHub Desktop.
Save nihalpasham/0de75eb39e1b62eadd16f8a1ee422732 to your computer and use it in GitHub Desktop.
stable-mir-compile-errors
./x build
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.07s
$ cargo +nightly-aarch64-apple-darwin build --manifest-path /Users/nihalpasham/devspace/rust/compiler/rustc_public/rustc_public/Cargo.toml --all-targets
   Compiling rustc_public v0.1.0-preview (/Users/nihalpasham/devspace/rust/compiler/rustc_public/rustc_public)
error[E0412]: cannot find type `DynKind` in module `rustc_ty`
   --> rustc_public/src/unstable/convert/internal.rs:464:30
    |
464 |     type T<'tcx> = rustc_ty::DynKind;
    |                              ^^^^^^^
    |
   ::: /Users/nihalpasham/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/def.rs:100:1
    |
100 | pub enum DefKind {
    | ---------------- similarly named enum `DefKind` defined here
    |
help: an enum with a similar name exists
    |
464 -     type T<'tcx> = rustc_ty::DynKind;
464 +     type T<'tcx> = rustc_ty::DefKind;
    |
help: consider importing this enum
    |
  8 + use crate::ty::DynKind;
    |
help: if you import `DynKind`, refer to it directly
    |
464 -     type T<'tcx> = rustc_ty::DynKind;
464 +     type T<'tcx> = DynKind;
    |

error[E0433]: failed to resolve: could not find `DynKind` in `rustc_ty`
   --> rustc_public/src/unstable/convert/internal.rs:472:39
    |
472 |             DynKind::Dyn => rustc_ty::DynKind::Dyn,
    |                                       ^^^^^^^ could not find `DynKind` in `rustc_ty`
    |
help: an enum with a similar name exists
    |
472 -             DynKind::Dyn => rustc_ty::DynKind::Dyn,
472 +             DynKind::Dyn => rustc_ty::DefKind::Dyn,
    |
help: consider importing this enum
    |
  8 + use crate::ty::DynKind;
    |
help: if you import `DynKind`, refer to it directly
    |
472 -             DynKind::Dyn => rustc_ty::DynKind::Dyn,
472 +             DynKind::Dyn => DynKind::Dyn,
    |

error[E0531]: cannot find tuple struct or tuple variant `Len` in this scope
   --> rustc_public/src/unstable/convert/stable/mir.rs:218:13
    |
218 |             Len(place) => crate::mir::Rvalue::Len(place.stable(tables, cx)),
    |             ^^^ not found in this scope
    |
help: consider importing this tuple variant
    |
  3 + use crate::mir::Rvalue::Len;
    |

error[E0412]: cannot find type `DynKind` in module `ty`
   --> rustc_public/src/unstable/convert/stable/ty.rs:51:33
    |
 51 | impl<'tcx> Stable<'tcx> for ty::DynKind {
    |                                 ^^^^^^^
    |
   ::: /Users/nihalpasham/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/def.rs:100:1
    |
100 | pub enum DefKind {
    | ---------------- similarly named enum `DefKind` defined here
    |
help: an enum with a similar name exists
    |
 51 - impl<'tcx> Stable<'tcx> for ty::DynKind {
 51 + impl<'tcx> Stable<'tcx> for ty::DefKind {
    |
help: consider importing this enum
    |
  3 + use crate::ty::DynKind;
    |
help: if you import `DynKind`, refer to it directly
    |
 51 - impl<'tcx> Stable<'tcx> for ty::DynKind {
 51 + impl<'tcx> Stable<'tcx> for DynKind {
    |

error[E0531]: cannot find unit struct, unit variant or constant `Dyn` in module `ty`
  --> rustc_public/src/unstable/convert/stable/ty.rs:56:17
   |
56 |             ty::Dyn => crate::ty::DynKind::Dyn,
   |                 ^^^ not found in `ty`
   |
help: consider importing one of these items
   |
 3 + use crate::ty::DynKind::Dyn;
   |
 3 + use rustc_span::kw::Dyn;
   |
help: if you import `Dyn`, refer to it directly
   |
56 -             ty::Dyn => crate::ty::DynKind::Dyn,
56 +             Dyn => crate::ty::DynKind::Dyn,
   |

error[E0412]: cannot find type `AssocItemContainer` in module `ty`
    --> rustc_public/src/unstable/convert/stable/ty.rs:1079:33
     |
1079 | impl<'tcx> Stable<'tcx> for ty::AssocItemContainer {
     |                                 ^^^^^^^^^^^^^^^^^^
     |
    ::: /Users/nihalpasham/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/ty/assoc.rs:14:1
     |
  14 | pub enum AssocContainer {
     | ----------------------- similarly named enum `AssocContainer` defined here
     |
help: an enum with a similar name exists
     |
1079 - impl<'tcx> Stable<'tcx> for ty::AssocItemContainer {
1079 + impl<'tcx> Stable<'tcx> for ty::AssocContainer {
     |
help: consider importing this enum
     |
   3 + use crate::ty::AssocItemContainer;
     |
help: if you import `AssocItemContainer`, refer to it directly
     |
1079 - impl<'tcx> Stable<'tcx> for ty::AssocItemContainer {
1079 + impl<'tcx> Stable<'tcx> for AssocItemContainer {
     |

error[E0433]: failed to resolve: could not find `AssocItemContainer` in `ty`
    --> rustc_public/src/unstable/convert/stable/ty.rs:1085:17
     |
1085 |             ty::AssocItemContainer::Trait => AssocItemContainer::Trait,
     |                 ^^^^^^^^^^^^^^^^^^ could not find `AssocItemContainer` in `ty`
     |
help: an enum with a similar name exists
     |
1085 -             ty::AssocItemContainer::Trait => AssocItemContainer::Trait,
1085 +             ty::AssocContainer::Trait => AssocItemContainer::Trait,
     |
help: consider importing this enum
     |
   3 + use crate::ty::AssocItemContainer;
     |
help: if you import `AssocItemContainer`, refer to it directly
     |
1085 -             ty::AssocItemContainer::Trait => AssocItemContainer::Trait,
1085 +             AssocItemContainer::Trait => AssocItemContainer::Trait,
     |

error[E0433]: failed to resolve: could not find `AssocItemContainer` in `ty`
    --> rustc_public/src/unstable/convert/stable/ty.rs:1086:17
     |
1086 |             ty::AssocItemContainer::Impl => AssocItemContainer::Impl,
     |                 ^^^^^^^^^^^^^^^^^^ could not find `AssocItemContainer` in `ty`
     |
help: an enum with a similar name exists
     |
1086 -             ty::AssocItemContainer::Impl => AssocItemContainer::Impl,
1086 +             ty::AssocContainer::Impl => AssocItemContainer::Impl,
     |
help: consider importing this enum
     |
   3 + use crate::ty::AssocItemContainer;
     |
help: if you import `AssocItemContainer`, refer to it directly
     |
1086 -             ty::AssocItemContainer::Impl => AssocItemContainer::Impl,
1086 +             AssocItemContainer::Impl => AssocItemContainer::Impl,
     |

error[E0061]: this enum variant takes 2 arguments but 3 arguments were supplied
   --> rustc_public/src/unstable/convert/internal.rs:191:62
    |
191 |             RigidTy::Dynamic(predicate, region, dyn_kind) => rustc_ty::TyKind::Dynamic(
    |                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^
...
194 |                 dyn_kind.internal(tables, tcx),
    |                 ------------------------------ unexpected argument #3
    |
note: tuple variant defined here
   --> /Users/nihalpasham/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_type_ir/src/ty_kind.rs:154:5
    |
154 |     Dynamic(I::BoundExistentialPredicates, I::Region),
    |     ^^^^^^^
help: remove the extra argument
    |
193 -                 region.internal(tables, tcx),
194 -                 dyn_kind.internal(tables, tcx),
193 +                 region.internal(tables, tcx),
    |

error[E0023]: this pattern has 3 fields, but the corresponding tuple variant has 2 fields
   --> rustc_public/src/unstable/convert/stable/ty.rs:442:25
    |
442 |             ty::Dynamic(existential_predicates, region, dyn_kind) => {
    |                         ^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^  ^^^^^^^^ expected 2 fields, found 3
    |
   ::: /Users/nihalpasham/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/rustc-src/rust/compiler/rustc_type_ir/src/ty_kind.rs:154:13
    |
154 |     Dynamic(I::BoundExistentialPredicates, I::Region),
    |             -----------------------------  --------- tuple variant has 2 fields

error[E0282]: type annotations needed
   --> rustc_public/src/unstable/convert/stable/ty.rs:446:31
    |
446 |                         .map(|existential_predicate| existential_predicate.stable(tables, cx))
    |                               ^^^^^^^^^^^^^^^^^^^^^                        ------ type must be known at this point
    |
help: consider giving this closure parameter an explicit type
    |
446 |                         .map(|existential_predicate: /* Type */| existential_predicate.stable(tables, cx))
    |                                                    ++++++++++++

error[E0026]: variant `rustc_middle::ty::GenericParamDefKind::Const` does not have a field named `synthetic`
   --> rustc_public/src/unstable/convert/stable/ty.rs:664:59
    |
664 |             ty::GenericParamDefKind::Const { has_default, synthetic: _ } => {
    |                                                           ^^^^^^^^^ variant `rustc_middle::ty::GenericParamDefKind::Const` does not have this field

error[E0599]: no method named `stable` found for enum `AssocContainer` in the current scope
    --> rustc_public/src/unstable/convert/stable/ty.rs:1102:39
     |
1102 |             container: self.container.stable(tables, cx),
     |                                       ^^^^^^
     |
     = help: items from traits can only be used if the trait is in scope
help: trait `Stable` which provides `stable` is implemented but not in scope; perhaps you want to import it
     |
   3 + use rustc_public::unstable::Stable;
     |
help: there is a method `hash_stable` with a similar name
     |
1102 |             container: self.container.hash_stable(tables, cx),
     |                                       +++++

error[E0615]: attempted to take value of method `trait_item_def_id` on type `&rustc_middle::ty::AssocItem`
    --> rustc_public/src/unstable/convert/stable/ty.rs:1103:37
     |
1103 |             trait_item_def_id: self.trait_item_def_id.map(|did| tables.assoc_def(did)),
     |                                     ^^^^^^^^^^^^^^^^^ method, not a field
     |
help: use parentheses to call the method
     |
1103 |             trait_item_def_id: self.trait_item_def_id().map(|did| tables.assoc_def(did)),
     |                                                      ++

Some errors have detailed explanations: E0023, E0026, E0061, E0282, E0412, E0433, E0531, E0599, E0615.
For more information about an error, try `rustc --explain E0023`.
error: could not compile `rustc_public` (lib) due to 14 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `rustc_public` (lib test) due to 14 previous errors
Error: command exited with non-zero code `cargo +nightly-aarch64-apple-darwin build --manifest-path /Users/nihalpasham/devspace/rust/compiler/rustc_public/rustc_public/Cargo.toml --all-targets`: 101
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment