Rollup merge of #120360 - compiler-errors:afit-sized-lol, r=lcnr

Don't fire `OPAQUE_HIDDEN_INFERRED_BOUND` on sized return of AFIT

Conceptually, we should probably not fire `OPAQUE_HIDDEN_INFERRED_BOUND` for methods like:

```
trait Foo { async fn bar() -> Self; }
```

Even though we technically cannot prove that `Self: Sized`, which is one of the item bounds of the `Output` type in the `-> impl Future<Output = Sized>` from the async desugaring.

This is somewhat justifiable along the same lines as how we allow regular methods to return `-> Self` even though `Self` isn't sized.

Fixes #113538

(side-note: some days i wonder if we should just remove the `OPAQUE_HIDDEN_INFERRED_BOUND` lint... it does make me sad that we have non-well-formed types in signatures, though.)
This commit is contained in:
Matthias Krüger 2024-01-26 14:43:32 +01:00 committed by GitHub
commit b11c3e3ed1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

Diff content is not available