Explain more clearly why `fn() -> T` can't be `#[derive(Clone)]` Closes #73480 The derived impls were generated with `rustc -Z unpretty=expanded main.rs` and the raw output is: ```rust struct Generate<T>(fn() -> T); #[automatically_derived] impl<T: ::core::marker::Copy> ::core::marker::Copy for Generate<T> { } #[automatically_derived] impl<T: ::core::clone::Clone> ::core::clone::Clone for Generate<T> { #[inline] fn clone(&self) -> Generate<T> { Generate(::core::clone::Clone::clone(&self.0)) } } ``` |
||
|---|---|---|
| .. | ||
| benches | ||
| primitive_docs | ||
| src | ||
| tests | ||
| Cargo.toml | ||