Skip to content

Commit 68f4157

Browse files
authored
Rollup merge of rust-lang#122675 - tmfink:doc-clarify, r=scottmcm
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.
2 parents 638f0a8 + 99363a1 commit 68f4157

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/default.rs

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ use crate::ascii::Char as AsciiChar;
7171
///
7272
/// You cannot use the `#[default]` attribute on non-unit or non-exhaustive variants.
7373
///
74+
/// The `#[default]` attribute was stabilized in Rust 1.62.0.
75+
///
7476
/// ## How can I implement `Default`?
7577
///
7678
/// Provide an implementation for the `default()` method that returns the value of

0 commit comments

Comments
 (0)