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

458 fix wasm #519

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

matthew-russo
Copy link
Member

replaces #458

Hides a few paths, that fail at runtime on wasm32-unknown-unknown, under conditional compilation.

Fixes proptest-rs#137.
@RReverser
Copy link

From a quick glance, looks good, although it's been open for a long time, so would be good to test it still works.

@rexmas rexmas closed this Sep 22, 2024
@rexmas rexmas reopened this Sep 22, 2024
#[cfg(feature = "std")]
const MAX_SHRINK_ITERS: &str = "PROPTEST_MAX_SHRINK_ITERS";
#[cfg(feature = "std")]
const MAX_DEFAULT_SIZE_RANGE: &str = "PROPTEST_MAX_DEFAULT_SIZE_RANGE";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did this one get deleted on accident? i believe it's still in use in parse_or_warn

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk - it's been a very long time - but CI seems to pass?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

odd

Variable `MAX_DEFAULT_SIZE_RANGE` should have snake_case name, e.g. `max_default_size_range`

so arbitrary tokens in pattern match positions seem to be treated as new variable bindings and default to (), that's why this still compiles even though there's a warning.

i don't think i have push access to this branch though so @matthew-russo you'll need to update please

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is fixed in #518

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so arbitrary tokens in pattern match positions seem to be treated as new variable bindings and default to (), that's why this still compiles even though there's a warning.

Hm but that doesn't explain why parse_or_warn accepted it if it's () and used in an argument that expects &str.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants