Skip to content

cfg(bootstrap) needed in test-float-parse #141900

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

Closed
Mark-Simulacrum opened this issue Jun 2, 2025 · 1 comment · Fixed by #141904
Closed

cfg(bootstrap) needed in test-float-parse #141900

Mark-Simulacrum opened this issue Jun 2, 2025 · 1 comment · Fixed by #141904
Assignees
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@Mark-Simulacrum
Copy link
Member

Mark-Simulacrum commented Jun 2, 2025

x.py check --stage 0 fails on checking src/etc/test-float-parse since that used to always get an in-tree std but now gets beta std after #119899.

error[E0277]: the trait bound `f16: LowerExp` is not satisfied
   --> src/etc/test-float-parse/src/traits.rs:158:65
    |
149 | / macro_rules! impl_float {
150 | |     ($($fty:ty, $ity:ty);+) => {
151 | |         $(
152 | |             impl Float for $fty {
...   |
158 | |                 const SIGN_MASK: Self::Int = Self::Int::ONE << (Self::BITS-1);
    | |                                                                 ^^^^ the trait `LowerExp` is not implemented for `f16`
...   |
169 | | }
    | |_- in this expansion of `impl_float!`
...
174 |   impl_float!(f16, u16);
    |   --------------------- in this macro invocation
    |
    = help: the following other types implement trait `LowerExp`:
              f32
              f64
              i128
              i16
              i32
              i64
              i8
              isize
            and 6 others
note: required by a bound in `traits::Float::BITS`
   --> src/etc/test-float-parse/src/traits.rs:105:25
    |
105 |     Copy + fmt::Debug + fmt::LowerExp + FromStr<Err: fmt::Display> + Sized + Send + 'static
    |                         ^^^^^^^^^^^^^ required by this bound in `Float::BITS`
...
112 |     const BITS: u32;
    |           ---- required by a bound in this associated constant

We should consider adding an x.py check --stage 0 to CI so that people remember/notice adding the relevant cfg(bootstrap) annotations and/or change bootstrap to not permit checking certain tools under stage 0.

cc #141901

@Mark-Simulacrum Mark-Simulacrum added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. labels Jun 2, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 2, 2025
@jieyouxu jieyouxu added A-testsuite Area: The testsuite used to check the correctness of rustc and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jun 2, 2025
@jieyouxu jieyouxu self-assigned this Jun 2, 2025
@jieyouxu
Copy link
Member

jieyouxu commented Jun 2, 2025

We should consider adding an x.py check --stage 0 to CI so that people remember/notice adding the relevant cfg(bootstrap) annotations and/or change bootstrap to not permit checking certain tools under stage 0.

Pulling this part out to #141905

@bors bors closed this as completed in 44ba243 Jun 2, 2025
rust-timer added a commit that referenced this issue Jun 2, 2025
Rollup merge of #141904 - jieyouxu:test-float-parse, r=Mark-Simulacrum

test-float-parse: apply `cfg(not(bootstrap))`

Prior to stage 0 redesign, `test-float-parse` ran against in-tree std but now it runs against beta std. `f16::FromStr` is only present in in-tree std and not yet beta std, so apply `cfg(not(bootstrap))` gating to unbrick `./x check --stage=0`.

Fixes #141900.

`./x check --stage=0` in CI is intended for follow-up.

r? `@Mark-Simulacrum` (or bootstrap/libs)
cc `@tgross35`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants