Fix ForTypeRepr docs and test with proper instance

This commit is contained in:
Paolo Tranquilli
2025-08-19 12:46:16 +02:00
parent ce48202b6a
commit d38459a50a
9 changed files with 26 additions and 32 deletions

View File

@@ -1158,13 +1158,12 @@ class _:
@annotate(ForTypeRepr)
class _:
"""
A type with a higher-ranked `for` modifier. This is currently not valid Rust syntax (`for<...>` can
only be applied to traits to form a `TypeBound`).
A function pointer type with a `for` modifier.
For example:
```rust
fn foo(value: for<'a> usize) {} // DOESN'T COMPILE
// ^^^^^^^^^^^^^
type RefOp<X> = for<'a> fn(&'a X) -> &'a X;
// ^^^^^^^^^^^^^^^^^^^^^^^^^^
```
"""