Skip to content

Commit

Permalink
Rollup merge of rust-lang#122675 - tmfink:doc-clarify, r=scottmcm
Browse files Browse the repository at this point in the history
core: document default attribute stabilization

As of now, the first release which stabilized the `#[default]` macro for the deriving the `Default` trait for enus is not documented.
I have had to search the [`RELEASES.md`](https://github.com/rust-lang/rust/blob/master/RELEASES.md) when making sure my code would be accepted by an older Rust compiler.

I just added a line in the doc comment since, as far as I know, there's no option to pass to the `#[stable()]` attribute.

I am open to improvements in the wording.
  • Loading branch information
workingjubilee authored Mar 18, 2024
2 parents 62de306 + d7b4b01 commit 6007cdd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/core/src/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ use crate::ascii::Char as AsciiChar;
///
/// You cannot use the `#[default]` attribute on non-unit or non-exhaustive variants.
///
/// The `#[default]` attribute was stabilized in Rust 1.62.0.
///
/// ## How can I implement `Default`?
///
/// Provide an implementation for the `default()` method that returns the value of
Expand Down

0 comments on commit 6007cdd

Please sign in to comment.