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

Refactor float Primitives to a separate Float type #124797

Merged
merged 1 commit into from
May 10, 2024

Conversation

beetrees
Copy link
Contributor

@beetrees beetrees commented May 6, 2024

Now there are 4 of them, it makes sense to refactor F16, F32, F64 and F128 out of Primitive and into a separate Float type (like integers already are). This allows patterns like F16 | F32 | F64 | F128 to be simplified into Float(_), and is consistent with ty::FloatTy.

As a side effect, this PR also makes the Ty::primitive_size method work with f16 and f128.

Tracking issue: #116909

@rustbot label +F-f16_and_f128

@rustbot
Copy link
Collaborator

rustbot commented May 6, 2024

r? @davidtwco

rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 6, 2024
@rustbot
Copy link
Collaborator

rustbot commented May 6, 2024

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

@rustbot rustbot added the F-f16_and_f128 `#![feature(f16)]`, `#![feature(f128)]` label May 6, 2024
@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented May 6, 2024

rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead.

cc @rust-lang/rust-analyzer

@rust-log-analyzer

This comment has been minimized.

@davidtwco
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 10, 2024

📌 Commit 3769fdd has been approved by davidtwco

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 10, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 10, 2024
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#124615 (coverage: Further simplify extraction of mapping info from MIR)
 - rust-lang#124778 (Fix parse error message for meta items)
 - rust-lang#124797 (Refactor float `Primitive`s to a separate `Float` type)
 - rust-lang#124888 (Migrate `run-make/rustdoc-output-path` to rmake)
 - rust-lang#124957 (Make `Ty::builtin_deref` just return a `Ty`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 1ae0d90 into rust-lang:master May 10, 2024
6 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 10, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 10, 2024
Rollup merge of rust-lang#124797 - beetrees:primitive-float, r=davidtwco

Refactor float `Primitive`s to a separate `Float` type

Now there are 4 of them, it makes sense to refactor `F16`, `F32`, `F64` and `F128` out of `Primitive` and into a separate `Float` type (like integers already are). This allows patterns like `F16 | F32 | F64 | F128` to be simplified into `Float(_)`, and is consistent with `ty::FloatTy`.

As a side effect, this PR also makes the `Ty::primitive_size` method work with `f16` and `f128`.

Tracking issue: rust-lang#116909

`@rustbot` label +F-f16_and_f128
@beetrees beetrees deleted the primitive-float branch May 10, 2024 18:20
tautschnig pushed a commit to model-checking/kani that referenced this pull request May 15, 2024
GuillaumeGomez pushed a commit to GuillaumeGomez/rust that referenced this pull request Jul 10, 2024
Refactor float `Primitive`s to a separate `Float` type

Now there are 4 of them, it makes sense to refactor `F16`, `F32`, `F64` and `F128` out of `Primitive` and into a separate `Float` type (like integers already are). This allows patterns like `F16 | F32 | F64 | F128` to be simplified into `Float(_)`, and is consistent with `ty::FloatTy`.

As a side effect, this PR also makes the `Ty::primitive_size` method work with `f16` and `f128`.

Tracking issue: rust-lang#116909

`@rustbot` label +F-f16_and_f128
GuillaumeGomez pushed a commit to GuillaumeGomez/rust that referenced this pull request Jul 10, 2024
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#124615 (coverage: Further simplify extraction of mapping info from MIR)
 - rust-lang#124778 (Fix parse error message for meta items)
 - rust-lang#124797 (Refactor float `Primitive`s to a separate `Float` type)
 - rust-lang#124888 (Migrate `run-make/rustdoc-output-path` to rmake)
 - rust-lang#124957 (Make `Ty::builtin_deref` just return a `Ty`)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-f16_and_f128 `#![feature(f16)]`, `#![feature(f128)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants