]> git.lizzy.rs Git - rust.git/blob - src/test/ui/deriving/deriving-with-helper.rs
Permit `#[deprecated]` in stdlib
[rust.git] / src / test / 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 #![feature(derive_default_enum)]
9
10 #![no_core]
11
12 #[rustc_builtin_macro]
13 macro derive() {}
14
15 #[rustc_builtin_macro(Default, attributes(default))]
16 macro Default() {}
17
18 mod default {
19     pub trait Default {
20         fn default() -> Self;
21     }
22
23     impl Default for u8 {
24         fn default() -> u8 {
25             0
26         }
27     }
28 }
29
30 #[lang = "sized"]
31 trait Sized {}
32
33 #[derive(Default)]
34 enum S {
35     #[default] // OK
36     Foo,
37 }