Add bounds for associated types in derive macro

This commit is contained in:
hkalbasi 2023-04-07 19:33:14 +03:30
parent 972f1313eb
commit c54cb88950
5 changed files with 187 additions and 30 deletions

View file

@ -143,6 +143,12 @@ pub mod clone {
pub trait Clone: Sized {
fn clone(&self) -> Self;
}
impl<T> Clone for &T {
fn clone(&self) -> Self {
*self
}
}
// region:derive
#[rustc_builtin_macro]
pub macro Clone($item:item) {}