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

Handle infinities in rand::distributions::zero_case #7755

Closed
catamorphism opened this issue Jul 12, 2013 · 1 comment · Fixed by #10542
Closed

Handle infinities in rand::distributions::zero_case #7755

catamorphism opened this issue Jul 12, 2013 · 1 comment · Fixed by #10542

Comments

@catamorphism
Copy link
Contributor

XXX (which I'm changing to a FIXME) just says "infinities?" Not sure what the issue is.

@huonw
Copy link
Member

huonw commented Nov 15, 2013

The issue is the random number generator generates numbers in [0, 1) and takes logarithms, so it's possible to get log(0) == -∞. It should be (0, 1), i.e. never generating 0.

I guess generating (0, 1) isn't that unusual (IIRC there's at least 2 other places it is done in an ad-hoc way in std::rand) so I'll add a newtype Rand impl for this. (Triage.)

bors added a commit that referenced this issue Nov 19, 2013
Provide `Closed01` and `Open01` that generate directly from the
closed/open intervals from 0 to 1, in contrast to the plain impls for
f32 and f64 which generate the half-open [0,1).

Fixes #7755.
@huonw huonw closed this as completed in e6fb622 Nov 19, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Oct 7, 2021
exclude enum from derivable impls

fix rust-lang#7753

changelog: Exclude enum from ``[`derivable_impls`]``
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 25, 2022
make `files.excludeDirs` work

There's a small issue because if all projects are excluded, this: https://github.com/rust-lang/rust-analyzer/blob/01d412f4d7bd7ef21a7e8f0461e9ba3439e3c4bf/crates/rust-analyzer/src/main_loop.rs#L114 will be shown.
I thought about not showing it if `files.excludeDirs` is set, but that is not necessarily correct.

Fixes rust-lang#7755
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 a pull request may close this issue.

2 participants