Rollup merge of #128170 - saethlin:clone-fn, r=compiler-errors · model-checking/verify-rust-std@a152820 (original) (raw)

Original file line number Diff line number Diff line change
@@ -160,6 +160,9 @@ pub trait Clone: Sized {
160 160 /// ```
161 161 #[stable(feature = "rust1", since = "1.0.0")]
162 162 #[must_use = "cloning is often expensive and is not expected to have side effects"]
163 +// Clone::clone is special because the compiler generates MIR to implement it for some types.
164 +// See InstanceKind::CloneShim.
165 +#[cfg_attr(not(bootstrap), lang = "clone_fn")]
163 166 fn clone(&self) -> Self;
164 167
165 168 /// Performs copy-assignment from `source`.