mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Add bounds for associated types in derive macro
This commit is contained in:
parent
972f1313eb
commit
c54cb88950
5 changed files with 187 additions and 30 deletions
|
@ -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) {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue