about summary refs log tree commit diff
path: root/library/std/src/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-10-03 20:58:55 +0200
committerGitHub <noreply@github.com>2022-10-03 20:58:55 +0200
commitdf11395a55fc00e1f8fa9d452af179160b91896f (patch)
treec1c189f5f5cbffd859b041958f508c22190df221 /library/std/src/sys/unix/stack_overflow.rs
parentc7f1b8e41d45f54b080c9e816565d72756bf2416 (diff)
parent3d4980bc8d8a58df217a6b659b9353a11ce4cd29 (diff)
downloadrust-df11395a55fc00e1f8fa9d452af179160b91896f.tar.gz
rust-df11395a55fc00e1f8fa9d452af179160b91896f.zip
Rollup merge of #101040 - danielhenrymantilla:no-bounds-for-default-annotated-derive, r=joshtriplett
Fix `#[derive(Default)]` on a generic `#[default]` enum adding unnecessary `Default` bounds

That is, given something like:

```rs
// #[default] on a generic enum does not add `Default` bounds to the type params.
#[derive(Default)]
enum MyOption<T> {
    #[default]
    None,
    Some(T),
}
```

then `MyOption<T> : Default`_as currently implemented_ only holds when `T : Default`, as reported by ```@5225225``` [over Zulip](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/.23.5Bderive.28Default.29.5D.20for.20enums.20with.20fields).

This is contrary to [what the accepted RFC proposes](https://rust-lang.github.io/rfcs/3107-derive-default-enum.html#generated-bounds) (_i.e._, that `T` be allowed not to be itself `Default`), and indeed seems to be a rather unnecessary limitation.
Diffstat (limited to 'library/std/src/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions