Skip to content

Rust 1.62.1 cannot be compiled and installed, because of miri #100134

Closed
@dilyanpalauzov

Description

@dilyanpalauzov

When compiling rust 1.62.1 it fails with:

Building stage1 tool miri (x86_64-unknown-linux-gnu)
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /src/rustc-1.62.1-src/src/tools/rls/racer/Cargo.toml
workspace: /src/rustc-1.62.1-src/Cargo.toml
   Compiling miri v0.1.0 (/src/rustc-1.62.1-src/src/tools/miri)
error[E0407]: method `ptr_from_addr` is not a member of trait `Machine`
   --> src/tools/miri/src/machine.rs:602:5
    |
602 | /     fn ptr_from_addr(
603 | |         ecx: &MiriEvalContext<'mir, 'tcx>,
604 | |         addr: u64,
605 | |     ) -> Pointer<Option<Self::PointerTag>> {
606 | |         intptrcast::GlobalStateInner::ptr_from_addr(addr, ecx)
607 | |     }
    | |_____^ not a member of trait `Machine`

error[E0053]: method `get_alloc_id` has an incompatible type for trait
   --> src/tools/miri/src/machine.rs:161:30
    |
161 |     fn get_alloc_id(self) -> AllocId {
    |                              ^^^^^^^
    |                              |
    |                              expected enum `Option`, found struct `rustc_const_eval::interpret::AllocId`
    |                              help: change the output type to match the trait: `Option<rustc_const_eval::interpret::AllocId>`
    |
    = note: expected fn pointer `fn(machine::Tag) -> Option<rustc_const_eval::interpret::AllocId>`
               found fn pointer `fn(machine::Tag) -> rustc_const_eval::interpret::AllocId`

error[E0053]: method `ptr_get_alloc` has an incompatible type for trait
   --> src/tools/miri/src/machine.rs:614:10
    |
614 |     ) -> (AllocId, Size, Self::TagExtra) {
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |          |
    |          expected enum `Option`, found tuple
    |          help: change the output type to match the trait: `Option<(rustc_const_eval::interpret::AllocId, rustc_target::abi::Size, stacked_borrows::SbTag)>`
    |
    = note: expected fn pointer `fn(&rustc_const_eval::interpret::InterpCx<'mir, 'tcx, machine::Evaluator<'mir, 'tcx>>, rustc_const_eval::interpret::Pointer<_>) -> Option<(rustc_const_eval::interpret::AllocId, rustc_target::abi::Size, stacked_borrows::SbTag)>`
               found fn pointer `fn(&rustc_const_eval::interpret::InterpCx<'mir, 'tcx, machine::Evaluator<'mir, 'tcx>>, rustc_const_eval::interpret::Pointer<_>) -> (rustc_const_eval::interpret::AllocId, rustc_target::abi::Size, stacked_borrows::SbTag)`

error[E0046]: not all trait items implemented, missing: `ptr_from_addr_cast`, `ptr_from_addr_transmute`, `expose_ptr`
   --> src/tools/miri/src/machine.rs:434:1
    |
434 | impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `ptr_from_addr_cast`, `ptr_from_addr_transmute`, `expose_ptr` in implementation
    |
    = help: implement the missing item: `fn ptr_from_addr_cast(_: &rustc_const_eval::interpret::InterpCx<'mir, 'tcx, Self>, _: u64) -> rustc_const_eval::interpret::Pointer<Option<<Self as rustc_const_eval::interpret::Machine<'mir, 'tcx>>::PointerTag>> { todo!() }`
    = help: implement the missing item: `fn ptr_from_addr_transmute(_: &rustc_const_eval::interpret::InterpCx<'mir, 'tcx, Self>, _: u64) -> rustc_const_eval::interpret::Pointer<Option<<Self as rustc_const_eval::interpret::Machine<'mir, 'tcx>>::PointerTag>> { todo!() }`
    = help: implement the missing item: `fn expose_ptr(_: &mut rustc_const_eval::interpret::InterpCx<'mir, 'tcx, Self>, _: rustc_const_eval::interpret::Pointer<<Self as rustc_const_eval::interpret::Machine<'mir, 'tcx>>::PointerTag>) -> Result<(), rustc_const_eval::interpret::InterpErrorInfo<'tcx>> { todo!() }`

error[E0061]: this function takes 2 arguments but 1 argument was supplied
    --> src/tools/miri/src/machine.rs:546:29
     |
546  |         let attrs = ecx.tcx.get_attrs(def_id);
     |                             ^^^^^^^^^ ------ supplied 1 argument
     |                             |
     |                             expected 2 arguments
     |
note: associated function defined here
    --> /src/rustc-1.62.1-src/compiler/rustc_middle/src/ty/mod.rs:2194:12
     |
2194 |     pub fn get_attrs(self, did: DefId, attr: Symbol) -> ty::Attributes<'tcx> {
     |            ^^^^^^^^^

error[E0308]: mismatched types
    --> src/tools/miri/src/machine.rs:547:73
     |
547  |         let link_name = match ecx.tcx.sess.first_attr_value_str_by_name(attrs, sym::link_name) {
     |                                                                         ^^^^^ expected `&[Attribute]`, found opaque type
    ::: /src/rustc-1.62.1-src/compiler/rustc_middle/src/ty/mod.rs:1944:29
     |
1944 | pub type Attributes<'tcx> = impl Iterator<Item = &'tcx ast::Attribute>;
     |                             ------------------------------------------ the found opaque type
     |
     = note: expected reference `&[Attribute]`
              found opaque type `rustc_middle::ty::Attributes<'_>`

error[E0061]: this function takes 2 arguments but 1 argument was supplied
    --> src/tools/miri/src/shims/foreign_items.rs:238:30
     |
238  |         let attrs = this.tcx.get_attrs(def_id);
     |                              ^^^^^^^^^ ------ supplied 1 argument
     |                              |
     |                              expected 2 arguments
     |
note: associated function defined here
    --> /src/rustc-1.62.1-src/compiler/rustc_middle/src/ty/mod.rs:2194:12
     |
2194 |     pub fn get_attrs(self, did: DefId, attr: Symbol) -> ty::Attributes<'tcx> {
     |            ^^^^^^^^^

error[E0308]: mismatched types
    --> src/tools/miri/src/shims/foreign_items.rs:242:43
     |
242  |             .first_attr_value_str_by_name(attrs, sym::link_name)
     |                                           ^^^^^ expected `&[Attribute]`, found opaque type
     |
    ::: /src/rustc-1.62.1-src/compiler/rustc_middle/src/ty/mod.rs:1944:29
     |
1944 | pub type Attributes<'tcx> = impl Iterator<Item = &'tcx ast::Attribute>;
     |                             ------------------------------------------ the found opaque type
     |
     = note: expected reference `&[Attribute]`
              found opaque type `rustc_middle::ty::Attributes<'_>`

error[E0599]: no method named `subst` found for struct `rustc_middle::ty::Ty` in the current scope
   --> src/tools/miri/src/shims/posix/sync.rs:844:21
    |
844 |     let ty = def_ty.subst(*tcx, &[param.into()]);
    |                     ^^^^^ method not found in `rustc_middle::ty::Ty<'_>`

warning: unused import: `subst::Subst`
 --> src/tools/miri/src/shims/posix/sync.rs:4:62
  |
4 | use rustc_middle::ty::{layout::TyAndLayout, query::TyCtxtAt, subst::Subst, Ty};
  |                                                              ^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

Some errors have detailed explanations: E0046, E0053, E0061, E0308, E0407, E0599.
For more information about an error, try `rustc --explain E0046`.
warning: `miri` (lib) generated 1 warning
error: could not compile `miri` due to 9 previous errors; 1 warning emitted
Building stage1 tool cargo-miri (x86_64-unknown-linux-gnu)
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /src/rustc-1.62.1-src/src/tools/rls/racer/Cargo.toml
workspace: /src/rustc-1.62.1-src/Cargo.toml
    Finished release [optimized] target(s) in 0.28s
Build completed successfully in 0:00:16

The above is during x.py build -j1. When I call afterwards x.py install -j1 the output is:

Building stage2 tool miri (x86_64-unknown-linux-gnu)
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /src/rustc-1.62.1-src/src/tools/rls/racer/Cargo.toml
workspace: /src/rustc-1.62.1-src/Cargo.toml
   Compiling miri v0.1.0 (/src/rustc-1.62.1-src/src/tools/miri)
error[E0407]: method `ptr_from_addr` is not a member of trait `Machine`
   --> src/tools/miri/src/machine.rs:602:5
    |
602 | /     fn ptr_from_addr(
603 | |         ecx: &MiriEvalContext<'mir, 'tcx>,
604 | |         addr: u64,
605 | |     ) -> Pointer<Option<Self::PointerTag>> {
606 | |         intptrcast::GlobalStateInner::ptr_from_addr(addr, ecx)
607 | |     }
    | |_____^ not a member of trait `Machine`

error[E0053]: method `get_alloc_id` has an incompatible type for trait
   --> src/tools/miri/src/machine.rs:161:30
    |
161 |     fn get_alloc_id(self) -> AllocId {
    |                              ^^^^^^^
    |                              |
    |                              expected enum `Option`, found struct `rustc_const_eval::interpret::AllocId`
    |                              help: change the output type to match the trait: `Option<rustc_const_eval::interpret::AllocId>`
    |
    = note: expected fn pointer `fn(machine::Tag) -> Option<rustc_const_eval::interpret::AllocId>`
               found fn pointer `fn(machine::Tag) -> rustc_const_eval::interpret::AllocId`

error[E0053]: method `ptr_get_alloc` has an incompatible type for trait
   --> src/tools/miri/src/machine.rs:614:10
    |
614 |     ) -> (AllocId, Size, Self::TagExtra) {
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |          |
    |          expected enum `Option`, found tuple
    |          help: change the output type to match the trait: `Option<(rustc_const_eval::interpret::AllocId, rustc_target::abi::Size, stacked_borrows::SbTag)>`
    |
    = note: expected fn pointer `fn(&rustc_const_eval::interpret::InterpCx<'mir, 'tcx, machine::Evaluator<'mir, 'tcx>>, rustc_const_eval::interpret::Pointer<_>) -> Option<(rustc_const_eval::interpret::AllocId, rustc_target::abi::Size, stacked_borrows::SbTag)>`
               found fn pointer `fn(&rustc_const_eval::interpret::InterpCx<'mir, 'tcx, machine::Evaluator<'mir, 'tcx>>, rustc_const_eval::interpret::Pointer<_>) -> (rustc_const_eval::interpret::AllocId, rustc_target::abi::Size, stacked_borrows::SbTag)`

error[E0046]: not all trait items implemented, missing: `ptr_from_addr_cast`, `ptr_from_addr_transmute`, `expose_ptr`
   --> src/tools/miri/src/machine.rs:434:1
    |
434 | impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `ptr_from_addr_cast`, `ptr_from_addr_transmute`, `expose_ptr` in implementation
    |
    = help: implement the missing item: `fn ptr_from_addr_cast(_: &rustc_const_eval::interpret::InterpCx<'mir, 'tcx, Self>, _: u64) -> rustc_const_eval::interpret::Pointer<Option<<Self as rustc_const_eval::interpret::Machine<'mir, 'tcx>>::PointerTag>> { todo!() }`
    = help: implement the missing item: `fn ptr_from_addr_transmute(_: &rustc_const_eval::interpret::InterpCx<'mir, 'tcx, Self>, _: u64) -> rustc_const_eval::interpret::Pointer<Option<<Self as rustc_const_eval::interpret::Machine<'mir, 'tcx>>::PointerTag>> { todo!() }`
    = help: implement the missing item: `fn expose_ptr(_: &mut rustc_const_eval::interpret::InterpCx<'mir, 'tcx, Self>, _: rustc_const_eval::interpret::Pointer<<Self as rustc_const_eval::interpret::Machine<'mir, 'tcx>>::PointerTag>) -> Result<(), rustc_const_eval::interpret::InterpErrorInfo<'tcx>> { todo!() }`

error[E0061]: this function takes 2 arguments but 1 argument was supplied
    --> src/tools/miri/src/machine.rs:546:29
     |
546  |         let attrs = ecx.tcx.get_attrs(def_id);
     |                             ^^^^^^^^^ ------ supplied 1 argument
     |                             |
     |                             expected 2 arguments
     |
note: associated function defined here
    --> /src/rustc-1.62.1-src/compiler/rustc_middle/src/ty/mod.rs:2194:12
     |
2194 |     pub fn get_attrs(self, did: DefId, attr: Symbol) -> ty::Attributes<'tcx> {
     |            ^^^^^^^^^

error[E0308]: mismatched types
    --> src/tools/miri/src/machine.rs:547:73
     |
547  |         let link_name = match ecx.tcx.sess.first_attr_value_str_by_name(attrs, sym::link_name) {
     |                                                                         ^^^^^ expected `&[Attribute]`, found opaque type
     |
    ::: /src/rustc-1.62.1-src/compiler/rustc_middle/src/ty/mod.rs:1944:29
     |
1944 | pub type Attributes<'tcx> = impl Iterator<Item = &'tcx ast::Attribute>;
     |                             ------------------------------------------ the found opaque type
     |
     = note: expected reference `&[Attribute]`
              found opaque type `rustc_middle::ty::Attributes<'_>`

error[E0061]: this function takes 2 arguments but 1 argument was supplied
    --> src/tools/miri/src/shims/foreign_items.rs:238:30
     |
238  |         let attrs = this.tcx.get_attrs(def_id);
     |                              ^^^^^^^^^ ------ supplied 1 argument
     |                              |
     |                              expected 2 arguments
     |
note: associated function defined here
    --> /src/rustc-1.62.1-src/compiler/rustc_middle/src/ty/mod.rs:2194:12
     |
2194 |     pub fn get_attrs(self, did: DefId, attr: Symbol) -> ty::Attributes<'tcx> {
     |            ^^^^^^^^^

error[E0308]: mismatched types
    --> src/tools/miri/src/shims/foreign_items.rs:242:43
     |
242  |             .first_attr_value_str_by_name(attrs, sym::link_name)
     |                                           ^^^^^ expected `&[Attribute]`, found opaque type
     |
    ::: /src/rustc-1.62.1-src/compiler/rustc_middle/src/ty/mod.rs:1944:29
     |
1944 | pub type Attributes<'tcx> = impl Iterator<Item = &'tcx ast::Attribute>;
     |                             ------------------------------------------ the found opaque type
     |
     = note: expected reference `&[Attribute]`
              found opaque type `rustc_middle::ty::Attributes<'_>`

error[E0599]: no method named `subst` found for struct `rustc_middle::ty::Ty` in the current scope
   --> src/tools/miri/src/shims/posix/sync.rs:844:21
    |
844 |     let ty = def_ty.subst(*tcx, &[param.into()]);
    |                     ^^^^^ method not found in `rustc_middle::ty::Ty<'_>`

warning: unused import: `subst::Subst`
 --> src/tools/miri/src/shims/posix/sync.rs:4:62
  |
4 | use rustc_middle::ty::{layout::TyAndLayout, query::TyCtxtAt, subst::Subst, Ty};
  |                                                              ^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

Some errors have detailed explanations: E0046, E0053, E0061, E0308, E0407, E0599.
For more information about an error, try `rustc --explain E0046`.
warning: `miri` (lib) generated 1 warning
error: could not compile `miri` due to 9 previous errors; 1 warning emitted
thread 'main' panicked at 'Unable to build miri', src/bootstrap/dist.rs:42:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Build completed unsuccessfully in 0:42:12

That is, rust 1.62.1 cannot be compiled and installed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions