Skip to content

"./x run miri" somehow cannot use "core" imports? #154630

@RalfJung

Description

@RalfJung

This command fails:

./x run miri -- src/tools/miri/tests/pass/float.rs
error[E0433]: cannot find `core` in the crate root
 --> src/tools/miri/tests/pass/../utils/io.rs:1:5
  |
1 | use core::fmt::{self, Write};
  |     ^^^^ you might be missing crate `core`
  |
help: try using `std` instead of `core`
  |
1 - use core::fmt::{self, Write};
1 + use std::fmt::{self, Write};
  |

error[E0432]: unresolved import `core`
 --> src/tools/miri/tests/pass/../utils/io.rs:1:5
  |
1 | use core::fmt::{self, Write};
  |     ^^^^ you might be missing crate `core`
  |
help: try using `std` instead of `core`
  |
1 - use core::fmt::{self, Write};
1 + use std::fmt::{self, Write};
  |

error: aborting due to 2 previous errors

This is very strange, I have not the faintest idea what is happening. ./x test miri runs that test and it works fine. The same file also works fine in out-of-tree Miri with ./miri run. Other files that use std imports work fine -- just core imports are somehow broken?!?

@bjorn3 have you seen anything like this before?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-miriArea: The miri tool

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions