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

Find a way to test MIR code that rustc won't emit #196

Closed
RalfJung opened this issue Jun 14, 2017 · 2 comments
Closed

Find a way to test MIR code that rustc won't emit #196

RalfJung opened this issue Jun 14, 2017 · 2 comments
Labels
A-tests Area: affects our test suite or CI C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement

Comments

@RalfJung
Copy link
Member

It would be nice to be able to test miri against known-bad MIR code -- like, code that uses StorageLive/StorageDead incorrectly, just to make sure that miri catches such errors. Some more examples will come come up with the stuff about unsafe code guidelines that I'm working on.

It seems that we need something like a MIR parser for this, though?

@eddyb
Copy link
Member

eddyb commented Jun 14, 2017

One way you could do this is use valid Rust syntax and have an AST-to-MIR transform (maybe use HIR to get types that you can use rustc_typeck::astconv on).

@oli-obk oli-obk added the C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement label Jun 14, 2017
@RalfJung RalfJung added the A-tests Area: affects our test suite or CI label Mar 8, 2019
erickt pushed a commit to erickt/miri that referenced this issue Feb 4, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Apr 23, 2023

We now have #[custom_mir], so there's no need to keep this issue open

@oli-obk oli-obk closed this as completed Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tests Area: affects our test suite or CI C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement
Projects
None yet
Development

No branches or pull requests

3 participants