rust/compiler/rustc_builtin_macros/src
Matthias Krüger df11395a55
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.
2022-10-03 20:58:55 +02:00
..
assert Replace rustc_data_structures::thin_vec::ThinVec with thin_vec::ThinVec. 2022-08-29 15:42:13 +10:00
deriving Rollup merge of #101040 - danielhenrymantilla:no-bounds-for-default-annotated-derive, r=joshtriplett 2022-10-03 20:58:55 +02:00
format Update doc comments. 2022-09-27 13:31:52 +02:00
format_foreign update tests 2021-12-31 12:51:27 -05:00
asm.rs Use AttrVec in more places. 2022-08-22 07:35:33 +10:00
assert.rs Box the MacCall in various types. 2022-08-17 08:10:56 +10:00
cfg_accessible.rs Remove crate visibility usage in compiler 2022-05-20 20:04:54 -04:00
cfg_eval.rs Emit an error instead of reconstructing token stream. 2022-09-13 19:47:50 +02:00
cfg.rs UPDATE - rename DiagnosticHandler macro to Diagnostic 2022-09-21 11:39:53 -04:00
cmdline_attrs.rs make mk_attr_id part of ParseSess 2022-09-14 08:49:10 +08:00
compile_error.rs check_doc_keyword: don't alloc string for emptiness check 2022-04-08 11:45:57 +03:00
concat_bytes.rs Remove the symbol from ast::LitKind::Err. 2022-08-23 16:56:24 +10:00
concat_idents.rs Remove TreeAndSpacing. 2022-07-29 15:52:15 +10:00
concat.rs Remove the symbol from ast::LitKind::Err. 2022-08-23 16:56:24 +10:00
derive.rs make mk_attr_id part of ParseSess 2022-09-14 08:49:10 +08:00
edition_panic.rs Box the MacCall in various types. 2022-08-17 08:10:56 +10:00
env.rs check_doc_keyword: don't alloc string for emptiness check 2022-04-08 11:45:57 +03:00
format_foreign.rs [rustc_builtin_macros] add indices to format_foreign::printf::Substitution::Escape 2021-12-31 12:42:15 -05:00
format.rs Fix format_args capture for macro expanded format strings 2022-09-30 17:40:14 +01:00
global_allocator.rs Replace rustc_data_structures::thin_vec::ThinVec with thin_vec::ThinVec. 2022-08-29 15:42:13 +10:00
lib.rs Change feature name to is_some_and 2022-10-01 11:45:52 -05:00
log_syntax.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
proc_macro_harness.rs Use AttrVec in more places. 2022-08-22 07:35:33 +10:00
source_util.rs Make ExtCtxt::expr_lit non-pub. 2022-08-16 11:17:15 +10:00
standard_library_imports.rs Replace rustc_data_structures::thin_vec::ThinVec with thin_vec::ThinVec. 2022-08-29 15:42:13 +10:00
test_harness.rs make mk_attr_id part of ParseSess 2022-09-14 08:49:10 +08:00
test.rs Fix duplicate usage of a article. 2022-10-02 21:40:39 +03:00
trace_macros.rs Remove TreeAndSpacing. 2022-07-29 15:52:15 +10:00
util.rs Add a lint for duplicated attributes. 2021-12-15 23:43:13 +01:00