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

must_cast: fix test failures and fmt. #194

Merged
merged 4 commits into from
Jun 15, 2023

Conversation

zachs18
Copy link
Contributor

@zachs18 zachs18 commented Jun 12, 2023

All doctests in src/main.rs were failing under miri due to rust-lang/miri#2423. As a temporary workaround, instead mark those tests as should_panic under miri, and compile_fail only under not(miri) (b275f7d).

Two doctests in src/must.rs were failing for unrelated reasons (4809de5).

(Also cargo fmt on src/must.rs)

@zachs18
Copy link
Contributor Author

zachs18 commented Jun 12, 2023

Shorter/clearer version of cfg(not(miri))-ing out the compile_fails, adapted from @danielhenrymantilla via discord:

#[cfg(not(miri))]
macro_rules! compile_fail {() => (
    "``​`compile_fail,E0080"
)}

#[cfg(miri)]
macro_rules! compile_fail {() => (
    "``​`should_panic"
)}

at the beginning of src/must.rs, so as to:

#[doc = compile_fail!()]

(I'm not at a computer atm)

@Lokathor
Copy link
Owner

Yeah i like the macro, please use that and also put in a comment to the miri issue as to why the macro is there at all.

@Lokathor Lokathor self-assigned this Jun 12, 2023
@Lokathor Lokathor added the semver-patch semver patch change label Jun 12, 2023
@zachs18
Copy link
Contributor Author

zachs18 commented Jun 15, 2023

I changed it to the macro version, and added a description of why the workaround is needed in a comment.

@Lokathor Lokathor merged commit c286994 into Lokathor:main Jun 15, 2023
@Lokathor Lokathor removed their assignment Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch semver patch change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants