Make Clone::clone a lang item · model-checking/verify-rust-std@8488ae6

Original file line numberDiff line numberDiff line change

@@ -160,6 +160,9 @@ pub trait Clone: Sized {

160160

/// ```

161161

#[stable(feature = "rust1", since = "1.0.0")]

162162

#[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")]

163166

fn clone(&self) -> Self;

164167
165168

/// Performs copy-assignment from `source`.