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

Make bench/noise.rs more idiomatic and 20x faster #5695

Merged
merged 1 commit into from
Apr 3, 2013

Conversation

bstrie
Copy link
Contributor

@bstrie bstrie commented Apr 3, 2013

With --opt-level=3, this version runs in 0.014s on my machine, compared to 0.252s for the previous version. Mostly due to the #[inline] on get().

bors added a commit that referenced this pull request Apr 3, 2013
With --opt-level=3, this version runs in 0.014s on my machine, compared to 0.252s for the previous version. Mostly due to the #[inline] on get().
@bors bors closed this Apr 3, 2013
@bors bors merged commit 84e5033 into rust-lang:incoming Apr 3, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 23, 2020
…ansch,oli-obk

New lint: suggest `ptr::read` instead of `mem::replace(..., uninitialized())`

resolves: rust-lang#5575

changelog: improvements to `MEM_REPLACE_WITH_UNINIT`:
- add a new test case in `tests/ui/repl_uninit.rs` to cover the case of replacing with `mem::MaybeUninit::uninit().assume_init()`.
- modify the existing `MEM_REPLACE_WITH_UNINIT` when replacing with `mem::uninitialized` to suggest using `ptr::read` instead.
- lint with `MEM_REPLACE_WITH_UNINIT` when replacing with `mem::MaybeUninit::uninit().assume_init()`
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.

3 participants