Skip to content
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

doctests in libcore sometimes use wrong external crate #1852

Closed
RalfJung opened this issue Jul 16, 2021 · 3 comments
Closed

doctests in libcore sometimes use wrong external crate #1852

RalfJung opened this issue Jul 16, 2021 · 3 comments
Labels
A-cargo Area: affects the cargo wrapper (cargo miri) C-bug Category: This is a bug.

Comments

@RalfJung
Copy link
Member

Under some circumstances, Miri goes all crazy on libcore doctests: it seems to load two distinct copies of libcore and then hell breaks loose.

Specifically, this seems to be triggered when the code contains a variable that does not exist -- rustc will try to make szggestions for names to use, which can trigger loading external crates, which might be what is happening here.

@RalfJung RalfJung added A-cargo Area: affects the cargo wrapper (cargo miri) C-bug Category: This is a bug. labels Jul 16, 2021
@ghost
Copy link

ghost commented Jul 16, 2021

I think this issue belongs to https://github.com/rust-lang/miri-test-libstd. cargo test without Miri fails with same errors in that repository and all other libcore tests passed. It's caused by the miri-test-libstd-specific core_miri_test crate which is effectively another libcore.

@RalfJung
Copy link
Member Author

Ah I see, thanks. I can't transfer issues there so I'll do that by hand.

@RalfJung
Copy link
Member Author

Moved to rust-lang/miri-test-libstd#4

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jul 17, 2021
fix typo in compile_fail doctest

Fixes a typo introduced by rust-lang#86211. For some reason this typo makes Miri go all crazy when running libcore doctests (rust-lang/miri#1852). Kudos to `@hyd-dev` for noticing the typo.

Cc `@tlyu` `@joshtriplett`
JohnTitor added a commit to JohnTitor/rust that referenced this issue Jul 18, 2021
fix typo in compile_fail doctest

Fixes a typo introduced by rust-lang#86211. For some reason this typo makes Miri go all crazy when running libcore doctests (rust-lang/miri#1852). Kudos to ``@hyd-dev`` for noticing the typo.

Cc ``@tlyu`` ``@joshtriplett``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cargo Area: affects the cargo wrapper (cargo miri) C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

1 participant