+// compile-flags: --emit=link
// no-prefer-dynamic
#![crate_type = "proc-macro"]
-#![feature(repr128, proc_macro_hygiene, proc_macro_quote)]
+#![feature(repr128, proc_macro_quote)]
+#![allow(incomplete_features)]
+#![allow(clippy::field_reassign_with_default)]
+#![allow(clippy::eq_op)]
extern crate proc_macro;
};
output
}
+
+#[proc_macro_derive(FieldReassignWithDefault)]
+pub fn derive_foo(_input: TokenStream) -> TokenStream {
+ quote! {
+ #[derive(Default)]
+ struct A {
+ pub i: i32,
+ pub j: i64,
+ }
+ #[automatically_derived]
+ fn lint() {
+ let mut a: A = Default::default();
+ a.i = 42;
+ a;
+ }
+ }
+}