Skip to content

core::derive was unintentionally stabilized #159856

Description

@kpreid

The description below was EDITED in by @fee1-dead, sorry for hijacking!

I was looking at this issue for triage when I noticed that this feature was intended to be unstable:

https://github.com/rust-lang/rust/blob/main/library/std/src/lib.rs#L753-L754

The tracking issue has no proposal to stabilize: #154645

Using the feature name gives unused features: (play)

#![feature(derive_macro_global_path)]

#[::core::derive(Clone)]
struct Y;

#[::std::derive(Clone)]
struct X;
warning: feature `derive_macro_global_path` is declared but not used
 --> src/lib.rs:1:12
  |
1 | #![feature(derive_macro_global_path)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_features)]` (part of `#[warn(unused)]`) on by default

One can use this without the feature: (play)

#[::core::derive(Clone)]
struct Y;

#[::std::derive(Clone)]
struct X;

It looks like this was accidentally stabilized! The re-export of an attribute macro apparently doesn't care about the stability attribute on the re-export.

This has made itself into 1.96. Our current stable appears to be 1.97.1. So, uh... someone do something maybe?


Original issue description by @kpreid:

Location (URL)

https://doc.rust-lang.org/1.95.0/std/#attributes
https://doc.rust-lang.org/1.96.0/std/#attributes
https://doc.rust-lang.org/1.95.0/core/#attributes
https://doc.rust-lang.org/1.96.0/core/#attributes
https://doc.rust-lang.org/1.96.0/std/attr.derive.html
https://doc.rust-lang.org/1.96.0/core/attr.derive.html
https://dev-doc.rust-lang.org/releases.html#version-1960-2026-05-28

Summary

The paths core::derive and std::derive were added in 1.96. However, there is no documentation — not in rustdoc and not even in the release notes — that indicates that it was added in 1.96 and thus that code using it is incompatible with ≤ 1.95. It isn’t caught by clippy::incompatible_msrv, either.

I’m not sure if there is anything feasible to do about this, but it wasted some of my time, so I’m reporting it as feedback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-stabilityArea: `#[stable]`, `#[unstable]` etc.C-bugCategory: This is a bug.I-libs-api-nominatedNominated for discussion during a libs-api team meeting.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions