Code like this has an unconstrained return type.
This presently will fall back to deducing () as the return type. Previous attempts to stabilize the ! type have involved unconstrained return types deducing to !. This has directly caused UB in winit rust-windowing/winit#428 during both attempts to stabilize the never type.
rust-lang/rust#48950 (comment)
One recommended fix is to change the code to explicitly deduce the return type as () where appropriate.
let () = msg_send![layer, setBounds: bounds];
The first example is already UB because the return type of retain is *mut c_void but is currently being deduced as ().
So that should be changed to:
let _: *mut std::raw::c_void = msg_send![view, retain];
Code like this has an unconstrained return type.
This presently will fall back to deducing
()as the return type. Previous attempts to stabilize the!type have involved unconstrained return types deducing to!. This has directly caused UB in winit rust-windowing/winit#428 during both attempts to stabilize the never type.rust-lang/rust#48950 (comment)
One recommended fix is to change the code to explicitly deduce the return type as
()where appropriate.The first example is already UB because the return type of
retainis*mut c_voidbut is currently being deduced as().So that should be changed to: