]> git.lizzy.rs Git - rust.git/blob - tests/ui/deriving/deriving-with-helper.rs
Rollup merge of #106470 - ehuss:tidy-no-wasm, r=Mark-Simulacrum
[rust.git] / tests / ui / deriving / deriving-with-helper.rs
1 // check-pass
2 // compile-flags: --crate-type=lib
3
4 #![feature(decl_macro)]
5 #![feature(lang_items)]
6 #![feature(no_core)]
7 #![feature(rustc_attrs)]
8
9 #![no_core]
10
11 #[rustc_builtin_macro]
12 macro derive() {}
13
14 #[rustc_builtin_macro(Default, attributes(default))]
15 macro Default() {}
16
17 mod default {
18     pub trait Default {
19         fn default() -> Self;
20     }
21
22     impl Default for u8 {
23         fn default() -> u8 {
24             0
25         }
26     }
27 }
28
29 #[lang = "sized"]
30 trait Sized {}
31
32 #[derive(Default)]
33 enum S {
34     #[default] // OK
35     Foo,
36 }