tgoop.com/dereference_pointer_there/8570
Create:
Last Update:
Last Update:
#prog #rust
Changes to impl Trait
in Rust 2024
Starting in Rust 2024, we are changing the rules for when a generic parameter can be used in the hidden type of a return-position impl Trait
:
a new default that the hidden types for a return-position impl Trait
can use any generic parameter in scope, instead of only types (applicable only in Rust 2024);
a syntax to declare explicitly what types may be used (usable in any edition).
The new explicit syntax is called a "use bound": impl Trait + use<'x, T>
, for example, would indicate that the hidden type is allowed to use 'x
and T
(but not any other generic parameters in scope).
BY Блог*
Share with your friend now:
tgoop.com/dereference_pointer_there/8570