2021-07-10 14:16:53 +00:00
|
|
|
// check-pass
|
|
|
|
// compile-flags: --crate-type=lib
|
|
|
|
|
|
|
|
#![feature(decl_macro)]
|
|
|
|
#![feature(lang_items)]
|
|
|
|
#![feature(no_core)]
|
|
|
|
#![feature(rustc_attrs)]
|
|
|
|
|
|
|
|
#![no_core]
|
|
|
|
|
|
|
|
#[rustc_builtin_macro]
|
|
|
|
macro derive() {}
|
|
|
|
|
|
|
|
#[rustc_builtin_macro(Default, attributes(default))]
|
|
|
|
macro Default() {}
|
|
|
|
|
|
|
|
mod default {
|
|
|
|
pub trait Default {
|
|
|
|
fn default() -> Self;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for u8 {
|
|
|
|
fn default() -> u8 {
|
|
|
|
0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[lang = "sized"]
|
|
|
|
trait Sized {}
|
|
|
|
|
|
|
|
#[derive(Default)]
|
2021-06-30 00:22:52 +00:00
|
|
|
enum S {
|
2021-07-10 14:16:53 +00:00
|
|
|
#[default] // OK
|
2021-06-30 00:22:52 +00:00
|
|
|
Foo,
|
2021-07-10 14:16:53 +00:00
|
|
|
}
|