Files
rust/tests/pretty
Guillaume Gomez aebbe6bb5f Rollup merge of #155644 - aerooneqq:delegation-self-ty-propagation-2, r=petrochenkov
delegation: support self ty propagation for functions in free to trait reuse

This PR adds support for self types specified in free to trait reuse. Up to this point we always generated `Self` despite the fact whether self type was specified or not. Now we use it in signature inheritance. Moreover we no more generate `Self` for static methods. Part of rust-lang/rust#118212.

```rust
trait Trait<T> {
  fn foo<const B: bool>(&self) {}
  fn bar() {}
}

impl<T> Trait<T> for usize {}

reuse <usize as Trait>::foo;

// Desugaring (no `Self` as usize is specified)
fn foo<T, const B: bool>(self: &usize) {
  <usize as Trait::<T>>::foo::<B>(self)
}

reuse Trait::bar;

// Desugaring (no `Self` as static method)
fn bar<T>() {
  Trait::<T>::bar(); //~ERROR: type annotations needed
}
```

r? @petrochenkov
2026-04-23 14:42:46 +02:00
..
2026-01-13 08:47:48 +01:00
2024-02-22 16:04:05 +00:00
2026-04-08 15:01:38 +01:00
2025-04-03 21:41:58 +00:00
2024-02-22 16:04:05 +00:00
2025-02-24 14:31:19 +01:00
2025-04-03 21:41:58 +00:00
2023-01-11 09:32:08 +00:00
2024-02-22 16:04:05 +00:00
2023-01-11 09:32:08 +00:00
2025-04-15 11:14:23 +02:00
2024-08-18 19:46:53 +02:00
2025-03-21 09:35:31 +01:00
2024-02-22 16:04:05 +00:00