Skip to content

Rollup of 8 pull requests #96073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 19 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
f427698
Parse inner attributes on inline const block
dtolnay Mar 16, 2022
9cfdb89
Only add codegen backend to dep info if -Zbinary-dep-depinfo is used
bjorn3 Feb 13, 2022
c681a88
Don't include invalid paths in the depinfo for builtin backends
bjorn3 Feb 13, 2022
147e5da
Add test
bjorn3 Mar 24, 2022
8035796
Stablize `const_extern_fn` for "Rust" and "C"
Aaron1011 Mar 26, 2022
6b75406
Create 2024 edition
jhpratt Feb 28, 2022
7bd22e2
only downgrade Error -> Ambiguous if type error is in predicate
compiler-errors Apr 7, 2022
abf2b4c
Stabilize `derive_default_enum`
jhpratt Feb 28, 2022
a3dd654
Add documentation
jhpratt Mar 8, 2022
69de213
Fix `x test --doc --stage 0 library/std`
jyn514 Apr 13, 2022
c20bb1d
Update issue-92893.stderr
ouz-a Apr 14, 2022
81c26e4
Rollup merge of #93969 - bjorn3:codegen_backend_dep_info, r=pnkfelix
Dylan-DPC Apr 15, 2022
32a66fc
Rollup merge of #94457 - jhpratt:stabilize-derive_default_enum, r=dav…
Dylan-DPC Apr 15, 2022
405766d
Rollup merge of #94461 - jhpratt:2024-edition, r=pnkfelix
Dylan-DPC Apr 15, 2022
9ff6d66
Rollup merge of #94849 - ouz-a:master4, r=oli-obk
Dylan-DPC Apr 15, 2022
dda2112
Rollup merge of #94985 - dtolnay:constattr, r=pnkfelix
Dylan-DPC Apr 15, 2022
0190a68
Rollup merge of #95346 - Aaron1011:stablize-const-extern-fn, r=pnkfelix
Dylan-DPC Apr 15, 2022
33e7edc
Rollup merge of #95749 - compiler-errors:ambig, r=oli-obk
Dylan-DPC Apr 15, 2022
ced4156
Rollup merge of #95993 - jyn514:fix-stage0-doctests, r=Mark-Simulacrum
Dylan-DPC Apr 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add documentation
  • Loading branch information
jhpratt committed Apr 8, 2022
commit a3dd654ae9f9002d3ff47e45a9a9b6afcb484d2f
17 changes: 17 additions & 0 deletions library/core/src/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,23 @@
/// This trait can be used with `#[derive]` if all of the type's fields implement
/// `Default`. When `derive`d, it will use the default value for each field's type.
///
/// ### `enum`s
///
/// When using `#[derive(Default)]` on an `enum`, you need to choose which unit variant will be
/// default. You do this by placing the `#[default]` attribute on the variant.
///
/// ```
/// #[derive(Default)]
/// enum Kind {
/// #[default]
/// A,
/// B,
/// C,
/// }
/// ```
///
/// You cannot use the `#[default]` attribute on non-unit or non-exhaustive variants.
///
/// ## How can I implement `Default`?
///
/// Provide an implementation for the `default()` method that returns the value of
Expand Down