Skip to content

warning: use of deprecated associated function core::num::<impl u32>::max_value: replaced by the MAX associated constant on this type #5110

Open

Description

@asukaminato0721

Some new build warnings.

warning: use of deprecated associated function `core::num::<impl u32>::max_value`: replaced by the `MAX` associated constant on this type
   --> crates/pyrefly_util/src/tarjan.rs:183:1
    |
183 | / define_index_type! {
184 | |     struct NodeIdx = u32;
185 | | }
    | |_^
    |
    = note: `#[warn(deprecated)]` on by default
    = note: this warning originates in the macro `define_index_type` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: use of deprecated associated function `core::num::<impl u32>::max_value`: replaced by the `MAX` associated constant on this type
   --> crates/pyrefly_util/src/tarjan.rs:187:1
    |
187 | / define_index_type! {
188 | |     struct StackIdx = u32;
189 | | }
    | |_^
    |
    = note: this warning originates in the macro `define_index_type` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: use of deprecated associated function `core::num::<impl u32>::max_value`: replaced by the `MAX` associated constant on this type
   --> crates/pyrefly_util/src/tarjan.rs:191:1
    |
191 | / define_index_type! {
192 | |     pub struct SccIdx = u32;
193 | | }
    | |_^
    |

Activity

  1. XinjieCui commented on Oct 6, 2026

    @XinjieCui

    Hi, I'd like to work on this. #claim

  2. github-actions commented on Oct 6, 2026

    @github-actions

    @XinjieCui you've claimed this issue — it's now assigned to you. Thanks for picking it up! 🎉

  3. shahhamdihassan commented on Oct 13, 2026

    @shahhamdihassan
    Contributor

    Thanks for flagging this, and thanks @XinjieCui for picking it up! The deprecated call comes from the index_vec macro's default rather than tarjan.rs itself, so adding MAX_INDEX = u32::MAX as usize; to each of the three define_index_type! blocks fixes it without changing behaviour (0.1.4 is the latest index_vec, so an upgrade won't help). If your rustc doesn't show the warning yet, build with RUSTFLAGS="-W deprecated-in-future" to check before and after.

  4. shahhamdihassan commented on Oct 21, 2026

    @shahhamdihassan
    Contributor

    Hi @XinjieCui, just checking in on this one. Are you still planning to send a PR? No rush, but if you have moved on, let us know and we will pick it up.

  5. shahhamdihassan commented on Oct 28, 2026

    @shahhamdihassan
    Contributor

    Since we haven't heard back, I'm opening this up again for anyone who'd like to take it. The fix is in my earlier comment: add MAX_INDEX = u32::MAX as usize; to each of the three define_index_type! blocks in tarjan.rs. Thanks @XinjieCui, and feel free to jump back in if you still want it.

  6. Raresreras commented on Oct 30, 2026

    @Raresreras

    Hello, I would like to work on this issue

    #claim

  7. github-actions commented on Oct 30, 2026

    @github-actions

    @Raresreras this issue is already claimed by @XinjieCui. Please coordinate with them before starting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions