-
Notifications
You must be signed in to change notification settings - Fork 163
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
FYI: proptest breaks the compiler with RUSTFLAGS="-C link-dead-code" #124
Comments
Actually, the diff to work around this turns out to be fairly small: $ git diff
diff --git a/proptest/src/arbitrary/_alloc/char.rs b/proptest/src/arbitrary/_alloc/char.rs
index 02fd213..04accca 100644
--- a/proptest/src/arbitrary/_alloc/char.rs
+++ b/proptest/src/arbitrary/_alloc/char.rs
@@ -43,11 +43,6 @@ impl_wrap_char!(ToLowercase, char::to_lowercase);
#[cfg(feature = "unstable")]
impl_wrap_char!(ToUppercase, char::to_uppercase);
-arbitrary!(DecodeUtf16<<Vec<u16> as IntoIterator>::IntoIter>,
- SMapped<Vec<u16>, Self>;
- static_map(vec(any::<u16>(), ..VEC_MAX), decode_utf16)
-);
-
arbitrary!(ParseCharError, IndFlatten<Mapped<bool, Just<Self>>>;
any::<bool>().prop_ind_flat_map(|is_two|
Just((if is_two { "__" } else { "" }).parse::<char>().unwrap_err())) I will see about putting that behind a feature in the next release. |
0.9.1 now has a workaround. You need to opt out of the [dev-dependencies.proptest]
version = "0.9" # Only works for 0.9.1 or newer
default-features = false
# Enable all default features not known to break code coverage builds
features = ["default-code-coverage"] I'm going to keep this issue open for now to help direct people to the workaround. |
This has supposedly been fixed in rust-lang/rust#58375, so if local testing shows the bug is fixed, this issue can be closed. |
I can confirm that running |
This isn't a problem that proptest can fix (probably), but building proptest with RUSTFLAGS="-C link-dead-code" leads to an ICE. The link-dead-code flag is important for accurate code coverage results.
See rust-lang/rust#52478
The text was updated successfully, but these errors were encountered: