Skip to content

coretests: extend and simplify float tests #141571

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

Merged
merged 2 commits into from
May 29, 2025
Merged

Conversation

RalfJung
Copy link
Member

Also de-duplicate tests by removing a ui test that duplicates the tests in core.
r? @tgross35

@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 26, 2025
f64::MAX_EXP
);
// FIXME(f16_f128): `f16` is only tested in consts for now.
test_float!(f16_const, float_const_assert, f16);
Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like this will actually run the div_euclid/rem_euclid tests on the host, not in core, since those aren't const fn yet. I'll constify them but that needs #141521 to land first.

I assume that means I should drop the first commit here since f16 / f128 don't work properly on all targets?

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be great to have them tested here too, but I suppose dropping them may be best if there isn't an elegant solution.

Maybe something like #141521 (comment) would work here for *_euclid? That would mean the test functions can be defined with relevant gates in the four different files, only the test cases would live in a macro here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not a fan of spreading the macro uses across multiple files, that makes it easy to forget using one of the macros for one of the types.

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed the f16/f128 tests for now, the remaining changes are still good improvements IMO and I'll wait for #141521 to land before attempting any further changes here.

f64::MAX_EXP
);
// FIXME(f16_f128): `f16` is only tested in consts for now.
test_float!(f16_const, float_const_assert, f16);
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be great to have them tested here too, but I suppose dropping them may be best if there isn't an elegant solution.

Maybe something like #141521 (comment) would work here for *_euclid? That would mean the test functions can be defined with relevant gates in the four different files, only the test cases would live in a macro here.

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

r=me once CI passes

@RalfJung
Copy link
Member Author

@bors r=tgross35

@bors
Copy link
Collaborator

bors commented May 28, 2025

📌 Commit e0ff77a has been approved by tgross35

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 28, 2025
jieyouxu added a commit to jieyouxu/rust that referenced this pull request May 28, 2025
coretests: extend and simplify float tests

Also de-duplicate tests by removing a ui test that duplicates the tests in core.
r? `@tgross35`
bors added a commit that referenced this pull request May 29, 2025
Rollup of 4 pull requests

Successful merges:

 - #138285 (Stabilize `repr128`)
 - #139994 (add `CStr::display`)
 - #141571 (coretests: extend and simplify float tests)
 - #141656 (CI: Add cargo tests to aarch64-apple-darwin)

Failed merges:

 - #141430 (remove `visit_clobber` and move `DummyAstNode` to `rustc_expand`)
 - #141636 (avoid some usages of `&mut P<T>` in AST visitors)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit bf1343b into rust-lang:master May 29, 2025
7 checks passed
@rustbot rustbot added this to the 1.89.0 milestone May 29, 2025
rust-timer added a commit that referenced this pull request May 29, 2025
Rollup merge of #141571 - RalfJung:float-tests, r=tgross35

coretests: extend and simplify float tests

Also de-duplicate tests by removing a ui test that duplicates the tests in core.
r? `@tgross35`
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request May 30, 2025
coretests: extend and simplify float tests

Also de-duplicate tests by removing a ui test that duplicates the tests in core.
r? `@tgross35`
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request May 30, 2025
Rollup of 4 pull requests

Successful merges:

 - rust-lang#138285 (Stabilize `repr128`)
 - rust-lang#139994 (add `CStr::display`)
 - rust-lang#141571 (coretests: extend and simplify float tests)
 - rust-lang#141656 (CI: Add cargo tests to aarch64-apple-darwin)

Failed merges:

 - rust-lang#141430 (remove `visit_clobber` and move `DummyAstNode` to `rustc_expand`)
 - rust-lang#141636 (avoid some usages of `&mut P<T>` in AST visitors)

r? `@ghost`
`@rustbot` modify labels: rollup
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request May 31, 2025
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#138285 (Stabilize `repr128`)
 - rust-lang/rust#139994 (add `CStr::display`)
 - rust-lang/rust#141571 (coretests: extend and simplify float tests)
 - rust-lang/rust#141656 (CI: Add cargo tests to aarch64-apple-darwin)

Failed merges:

 - rust-lang/rust#141430 (remove `visit_clobber` and move `DummyAstNode` to `rustc_expand`)
 - rust-lang/rust#141636 (avoid some usages of `&mut P<T>` in AST visitors)

r? `@ghost`
`@rustbot` modify labels: rollup
@RalfJung RalfJung deleted the float-tests branch June 1, 2025 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants