diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2024-06-04 19:09:15 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2024-06-04 20:46:03 +0000 |
| commit | e7ad2da7f134c66779625a09b134b85ed1c7c7a9 (patch) | |
| tree | 4d06db8b1a550cd547e0e97bcb2b7e7c6c02ce25 /compiler/rustc_codegen_llvm/src/attributes.rs | |
| parent | 8c4db851a7bb64173832e6602638204ebbd373a8 (diff) | |
| download | rust-e7ad2da7f134c66779625a09b134b85ed1c7c7a9.tar.gz rust-e7ad2da7f134c66779625a09b134b85ed1c7c7a9.zip | |
When `derive`ing, account for HRTB on `BareFn` fields
When given
```rust
trait SomeTrait {
type SomeType<'a>;
}
struct Foo<T: SomeTrait> {
x: for<'a> fn(T::SomeType<'a>)
}
```
expand to
```rust
impl<T: ::core::clone::Clone + SomeTrait> ::core::clone::Clone for Foo<T>
where for<'a> T::SomeType<'a>: ::core::clone::Clone {
#[inline]
fn clone(&self) -> Foo<T> {
Foo { x: ::core::clone::Clone::clone(&self.x) }
}
}
```
instead of the previous invalid
```
impl<T: ::core::clone::Clone + SomeTrait> ::core::clone::Clone for Foo<T>
where T::SomeType<'a>: ::core::clone::Clone {
#[inline]
fn clone(&self) -> Foo<T> {
Foo { x: ::core::clone::Clone::clone(&self.x) }
}
}
```
Fix #122622.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/attributes.rs')
0 files changed, 0 insertions, 0 deletions
