Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Resolve Clippyf16 andf128unimplemented!/FIXMEs#126636

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
bors merged 2 commits intorust-lang:masterfromtgross35:clippy-f16-f128-fixme
Jun 20, 2024

Conversation

@tgross35
Copy link
Contributor

@tgross35tgross35 commentedJun 18, 2024
edited
Loading

This was originally a PR against the Clippy repo,rust-lang/rust-clippy#12950

r?@flip1995

Tracking issue:#116909
Fixes:#126636

@rustbotrustbot added the S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties. labelJun 18, 2024
@rustbot
Copy link
Collaborator

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

These commits modify theCargo.lock file. Unintentional changes toCargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@tgross35
Copy link
ContributorAuthor

tgross35 commentedJun 18, 2024
edited
Loading

I know you suggested to include this as part of#126608, but it may as well just get its own PR since it touches a lot of files.

I need some help understandinghttps://github.com/rust-lang/rust-clippy/actions/runs/9569119207/job/26380925098?pr=12950#step:5:1055, I am not sure why it looks like it just deletes the file. I just forgot to add the feature gates

@rustbot label +F-f16_and_f128

@rustbotrustbot added the F-f16_and_f128`#![feature(f16)]`, `#![feature(f128)]` labelJun 18, 2024
@tgross35tgross35force-pushed theclippy-f16-f128-fixme branch from64443c7 to26ef017CompareJune 18, 2024 17:35
Comment on lines 170 to 182
Self::F16(f) =>{
f64::from(f).to_bits().hash(state);
},
Self::F32(f) =>{
f64::from(f).to_bits().hash(state);
},
Self::F64(f) =>{
f.to_bits().hash(state);
},
Self::F128(f) =>{
f.to_bits().hash(state);
},
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

This part could still use a double check, not sure if there is something better to do here

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure why we go from f32 to f64 before hashing. But keeping this consistent for f16 seems reasonable 👍

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I assume it is to make sure there is a hash that depends only on the value and not the size, which , but I can't find anywhere that it is being used.

Unfortunately, I forgot that conversions to/from f16 aren't yet present on all platforms so I had to change this to justf.to_bits().hash(state);. I left a fixme here instead, maybe we could convert everything to f128 once that is better supported.

Copy link
Member

Choose a reason for hiding this comment

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

maybe we could convert everything to f128 once that is better supported.

Might be a good idea, yes. But I wonder how much that matters of if we should just usef.to_bits().hash(state); everywhere. But that's not for this PR to decide. Let's leave the FIXME here and address this later.

tgross35 reacted with thumbs up emoji
clippy::identity_op
)]

// FIXME(f16_f128): add tests once const casting is available for these types
Copy link
Member

@flip1995flip1995Jun 19, 2024
edited
Loading

Choose a reason for hiding this comment

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

Can those tests be added with#126608 being merged? If so, after merging this PR, please add those in#126608

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

#126608 won't add casting, but it unblocks a followup PR that does add it. I'll make sure to add the Clippy tests with that one.

flip1995 reacted with heart emoji
This removes the ICE codepaths for `f16` and `f128` in Clippy.`rustc_apfloat` is used as a dependency for the parsing of these types,since their `FromStr` implementation will not be available in thestandard library for a while.
@tgross35tgross35force-pushed theclippy-f16-f128-fixme branch from26ef017 to477e9e8CompareJune 19, 2024 17:30
@tgross35
Copy link
ContributorAuthor

I added a couple more FIXMEs in places whereConstant::{F32, F64} is checked nonexhaustively but can't yet be added because it relies on math.@flip1995 to make things a bit more clear, here is my loose plan:

@flip1995
Copy link
Member

Thanks for the summary what the current road map for this feature is!

Let's get this in to unblock you.

@bors r+

@bors
Copy link
Collaborator

📌 Commit477e9e8 has been approved byflip1995

It is now in thequeue for this repository.

@borsbors added S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties. labelsJun 20, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull requestJun 20, 2024
…flip1995Resolve Clippy `f16` and `f128` `unimplemented!`/`FIXME`sThis was originally a PR against the Clippy repo,rust-lang/rust-clippy#12950r? `@flip1995`Tracking issue:rust-lang#116909Fixes:rust-lang#126636
This was referencedJun 20, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull requestJun 20, 2024
…iaskrgrRollup of 7 pull requestsSuccessful merges: -rust-lang#126380 (Add std Xtensa targets support) -rust-lang#126636 (Resolve Clippy `f16` and `f128` `unimplemented!`/`FIXME`s ) -rust-lang#126659 (More status-quo tests for the `#[coverage(..)]` attribute) -rust-lang#126711 (Make Option::as_[mut_]slice const) -rust-lang#126717 (Clean up some comments near `use` declarations) -rust-lang#126719 (Fix assertion failure for some `Expect` diagnostics.) -rust-lang#126730 (Add opaque type corner case test)r? `@ghost``@rustbot` modify labels: rollup
@borsbors merged commitd3f5e7b intorust-lang:masterJun 20, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull requestJun 20, 2024
Rollup merge ofrust-lang#126636 - tgross35:clippy-f16-f128-fixme, r=flip1995Resolve Clippy `f16` and `f128` `unimplemented!`/`FIXME`sThis was originally a PR against the Clippy repo,rust-lang/rust-clippy#12950r? ``@flip1995``Tracking issue:rust-lang#116909Fixes:rust-lang#126636
@tgross35
Copy link
ContributorAuthor

Thank you for the review!

@tgross35tgross35 deleted the clippy-f16-f128-fixme branchJune 20, 2024 18:28
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull requestJun 28, 2024
Resolve Clippy `f16` and `f128` `unimplemented!`/`FIXME`sThis was originally a PR against the Clippy repo,rust-lang#12950r? ``@flip1995``Tracking issue:rust-lang/rust#116909Fixes:rust-lang/rust#126636
bors added a commit to rust-lang-ci/rust that referenced this pull requestJul 12, 2024
Add `f16` and `f128` math functionsWIPThis will be pretty finicky among selection failures, the lowering bug, and lack of symbols. But might as well start somewhere.Checks will fail untilrust-lang#126636 makes it to beta, which should be next week (July 19).try-job: aarch64-gnu
bors added a commit to rust-lang-ci/rust that referenced this pull requestJul 16, 2024
Add `f16` and `f128` math functionsThis adds intrinsics and math functions for `f16` and `f128` floating point types. Support is quite limited and some things are broken so tests don't run on many platforms, but this provides a starting point.Checks will fail untilrust-lang#126636 makes it to beta, which should be next week (July 19).try-job: aarch64-gnu
bors added a commit to rust-lang-ci/rust that referenced this pull requestJul 16, 2024
Add `f16` and `f128` math functionsThis adds intrinsics and math functions for `f16` and `f128` floating point types. Support is quite limited and some things are broken so tests don't run on many platforms, but this provides a starting point.Checks will fail untilrust-lang#126636 makes it to beta, which should be next week (July 19).try-job: aarch64-gnu
bors added a commit to rust-lang-ci/rust that referenced this pull requestJul 16, 2024
Add `f16` and `f128` math functionsThis adds intrinsics and math functions for `f16` and `f128` floating point types. Support is quite limited and some things are broken so tests don't run on many platforms, but this provides a starting point.Checks will fail untilrust-lang#126636 makes it to beta, which should be next week (July 19).try-job: aarch64-gnu
bors added a commit to rust-lang-ci/rust that referenced this pull requestJul 16, 2024
Add `f16` and `f128` math functionsThis adds intrinsics and math functions for `f16` and `f128` floating point types. Support is quite limited and some things are broken so tests don't run on many platforms, but this provides a starting point.Checks will fail untilrust-lang#126636 makes it to beta, which should be next week (July 19).try-job: aarch64-gnu
bors added a commit to rust-lang-ci/rust that referenced this pull requestJul 16, 2024
Add `f16` and `f128` math functionsThis adds intrinsics and math functions for `f16` and `f128` floating point types. Support is quite limited and some things are broken so tests don't run on many platforms, but this provides a starting point.Checks will fail untilrust-lang#126636 makes it to beta, which should be next week (July 19).try-job: aarch64-gnu
bors added a commit to rust-lang-ci/rust that referenced this pull requestJul 17, 2024
Add `f16` and `f128` math functionsThis adds intrinsics and math functions for `f16` and `f128` floating point types. Support is quite limited and some things are broken so tests don't run on many platforms, but this provides a starting point.Checks will fail untilrust-lang#126636 makes it to beta, which should be next week (July 19).try-job: aarch64-gnu
bors added a commit to rust-lang-ci/rust that referenced this pull requestJul 17, 2024
Add `f16` and `f128` math functionsThis adds intrinsics and math functions for `f16` and `f128` floating point types. Support is quite limited and some things are broken so tests don't run on many platforms, but this provides a starting point.Checks will fail untilrust-lang#126636 makes it to beta, which should be next week (July 19).try-job: aarch64-gnu
bors added a commit to rust-lang-ci/rust that referenced this pull requestJul 17, 2024
Add `f16` and `f128` math functionsThis adds intrinsics and math functions for `f16` and `f128` floating point types. Support is quite limited and some things are broken so tests don't run on many platforms, but this provides a starting point.Checks will fail untilrust-lang#126636 makes it to beta, which should be next week (July 19).try-job: aarch64-gnu
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@flip1995flip1995flip1995 left review comments

Assignees

@flip1995flip1995

Labels

F-f16_and_f128`#![feature(f16)]`, `#![feature(f128)]`S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@tgross35@rustbot@flip1995@bors

[8]ページ先頭

©2009-2025 Movatter.jp