You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current version of Rust, this works as intended: The type cannot change with the struct update syntax. On nightly with #![feature(type_changing_struct_update)], your second function compiles successfully. See #86555.
I tried this code playground:
I expected to see this happen:
Since all fields with a lifetime were replaced by owned values I expected
make_owned2
to compile.Instead, this happened:
The compiler is unable to understand, that the remaining fields don't influence the lifetime of the struct.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: