Skip to content

Next MSRV bump #4626

Open
Open

Description

@tgross35

Trixie released with rustc 1.85, so I expect a lot of crates will be increasing their MSRV in the next few weeks. I'd like to upgrade only as needed, rough list of what might be nice to have:

Baseline: 1.63

  • 1.64: core::ffi::c_* (definitely need this)
  • 1.64: workspace-level lints (meh)
  • 1.65: cast_mut (this would be nice)

Baseline: 1.65

  • 1.67: varargs for non-C extern ABIs (no known applications)
  • 1.69: derive on packed structs that don't implement Copy (not overly useful for us, everything is copy)
  • 1.75: byte_add (this would be nice)
  • 1.75: const_maybe_uninit_zeroed (this would be nice)
  • 1.77: offset_of (just lets us remove a polyfill)
  • 1.77: C string literals (nothing we can't work around, not sure we even use this now)
  • 1.78: cfg(target_abi = "...") Add support for aarch64-unknown-linux-pauthtest target #5065 (comment)
  • 1.80: size_of, align_of in prelude (nice to have but we have our own prelude)
  • 1.80: variadics without a named parameter (no known applications)
  • 1.81: #[expect(...)] (want this, but it's not pressing)
  • 1.82: unsafe extern blocks (neutral)
  • 1.82: &raw (few small applications, addr_of! works fine)
  • 1.82: nested access in offset_of! (no uses)
  • 1.84: ptr::without_provenance (some 0x1234 as *const T casts)
  • 1.85: ptr::fn_addr_eq (we don't really need this as it is just for trait impls)
  • 1.85: 2024 edition
  • 1.88: Default for pointers (very nice to avoid custom_default)
  • 1.89: _ in array rhs, e.g. const A: [u8; 32] = [0; _]; (nice with custom_default but not huge)
  • 1.92: &raw [mut|const] to union fields is now safe

Activity

  1. matze commented on Oct 12, 2025

    @matze
    • 1.66: AsRawFd that could be implemented on pollfd to simplify interaction with tokio via AsyncFd
  2. tgross35 commented on Oct 15, 2025

    @tgross35
    MemberAuthor
    • 1.66: AsRawFd that could be implemented on pollfd to simplify interaction with tokio via AsyncFd

    That kind of trait implementation would be better suited for a wrapper crate the level above libc. E.g. nix::poll::PollFd, which implements AsFd.

  3. gibbz00 commented on Jan 3, 2026

    @gibbz00
    Contributor
    • 1.65: pointer .cast_mut() (over as _)
    • 1.75: pointer .byte_add() (over (ptr as *const u8).add(n) as *const T
  4. xtqqczze commented on Jan 26, 2026

    @xtqqczze
  5. added a commit that references this issue on Feb 13, 2026
  6. tgross35 commented on Feb 13, 2026

    @tgross35
    MemberAuthor

    Bump to 1.65 in #4972

  7. added a commit that references this issue on Feb 13, 2026
  8. added a commit that references this issue on Mar 14, 2026
  9. xtqqczze commented on Apr 26, 2026

    @xtqqczze
  10. xtqqczze commented on Aug 16, 2026

    @xtqqczze
    Contributor
  11. tgross35 commented on Aug 17, 2026

    @tgross35
    MemberAuthor

    Where would we make use of those?

  12. xtqqczze commented on Aug 17, 2026

    @xtqqczze
    Contributor
    warning: manual creation of a dangling pointer
      --> src/new/apple/libpthread/pthread_/pthread.rs:23:43
       |
    23 | pub const PTHREAD_CANCELED: *mut c_void = 1 as *mut c_void;
       |                                           ^^^^^^^^^^^^^^^^ help: use: `core::ptr::dangling_mut::<c_void>()`
    
    help: use `is_some_and` instead
        |
    326 -     let nightly = nightly_raw.map_or(false, |raw| {
    326 +     let nightly = nightly_raw.is_some_and(|raw| {
    
  13. tgross35 commented on Aug 17, 2026

    @tgross35
    MemberAuthor

    The first warning wouldn't actually be correct - we need the value 1, not what dangling_mut.

  14. xtqqczze commented on Aug 17, 2026

    @xtqqczze
    Contributor

    Per POSIX: "The symbolic constant PTHREAD_CANCELED expands to a constant expression of type ( void *) whose value matches no pointer to an object in memory nor the value NULL."

    So ptr::dangling_mut appears to be correct in theory, and in practice it does in fact produce the value 1.

  15. tgross35 commented on Aug 17, 2026

    @tgross35
    MemberAuthor

    POSIX loosely defines the requirements but we care about the platform here. It's checking for == PTHREAD_CANCELED, not checking whether values it gets match anything in memory. And dangling_mut makes no guarantees about how it is implemented, we can't rely on it being 1.

    Regardless, what's currently there is working code that is easily understood. Obfuscating it just to suppress a lint that applies poorly doesn't make any sense...

  16. Skgland commented on Aug 18, 2026

    @Skgland

    Maybe std::ptr::without_provenance could be used once msrv reaches 1.84.0

  17. xtqqczze commented on Nov 25, 2026

    @xtqqczze
    Contributor

    @tgross35 I'm assuming the MSRV for libc v1.0 will be at least 1.85?

  18. tgross35 commented on Nov 25, 2026

    @tgross35
    MemberAuthor

    Hm, where does the assumption come from? I don't see anything user-facing on that list.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions