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

remove the float type #9519

Closed
wants to merge 1 commit into from
Closed

remove the float type #9519

wants to merge 1 commit into from

Conversation

thestinger
Copy link
Contributor

It is simply defined as f64 across every platform right now.

A use case hasn't been presented for a float type defined as the
highest precision floating point type implemented in hardware on the
platform. Performance-wise, using the smallest precision correct for the
use case greatly saves on cache space and allows for fitting more
numbers into SSE/AVX registers.

If there was a use case, this could be implemented as simply a type
alias or a struct thanks to #[cfg(...)].

Closes #6592

The mailing list thread, for reference:

https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html

@huonw
Copy link
Member

huonw commented Sep 26, 2013

Shouldn't this remove something from rustc::driver::{driver, session} too? (the float_type variable/struct field at least.)

@thestinger
Copy link
Contributor Author

@huonw: done, no more float_type

@thestinger
Copy link
Contributor Author

@huonw: I would hold off on an r+ for now because I want to run this by @brson first. There has been a fair bit of discussion about it, and no known use cases after the RFC being open for 4 months but it's a change to the core language (and not just a bug/soundness fix).

@huonw
Copy link
Member

huonw commented Sep 26, 2013

Don't worry, I wasn't going to r+ anyway: this is definitely one for the core-devs. :)

@alexcrichton
Copy link
Member

If a decision isn't reached before the next meeting, I'll bring this up at the next meeting.

@brson
Copy link
Contributor

brson commented Oct 1, 2013

As discussed in today's meeting we can merge this and remove float.

It is simply defined as `f64` across every platform right now.

A use case hasn't been presented for a `float` type defined as the
highest precision floating point type implemented in hardware on the
platform. Performance-wise, using the smallest precision correct for the
use case greatly saves on cache space and allows for fitting more
numbers into SSE/AVX registers.

If there was a use case, this could be implemented as simply a type
alias or a struct thanks to `#[cfg(...)]`.

Closes #6592

The mailing list thread, for reference:

https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html
bors added a commit that referenced this pull request Oct 1, 2013
It is simply defined as `f64` across every platform right now.

A use case hasn't been presented for a `float` type defined as the
highest precision floating point type implemented in hardware on the
platform. Performance-wise, using the smallest precision correct for the
use case greatly saves on cache space and allows for fitting more
numbers into SSE/AVX registers.

If there was a use case, this could be implemented as simply a type
alias or a struct thanks to `#[cfg(...)]`.

Closes #6592

The mailing list thread, for reference:

https://mail.mozilla.org/pipermail/rust-dev/2013-July/004632.html
@bors bors closed this Oct 1, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 6, 2022
uninit_vec: fix false positive with set_len(0)

`set_len(0)` does not create uninitialized elements. Fixes a false positive with the following pattern:

```rust
fn copy_slice_into_vec(dst: &mut Vec<u8>, src: &[u8]) {
    dst.reserve(src.len().saturating_sub(dst.len()));
    unsafe {
        dst.set_len(0);
        std::ptr::copy_nonoverlapping(src.as_ptr(), dst.as_mut_ptr(), src.len());
        dst.set_len(src.len());
    }
}
```

zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/uninit_vec.20and.20set_len.280.29

changelog: FP: [`uninit_vec`]: No longer lints `Vec::set_len(0)`
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.

RFC: Removing `float'
5 participants