mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 21:30:12 +01:00
We can now cast directly from `T*` to `U*`; stop going via `void*`. Also remove the conversion impl from `void*` as it's now subsumed by the general impl.
This commit is contained in:
@@ -51,9 +51,7 @@ fn Run() -> i32 {
|
||||
let port: u16 = 8081;
|
||||
address.sin6_port = Cpp.htons_wrap(port);
|
||||
|
||||
// TODO: Should be able to cast directly.
|
||||
let address_ptr: Cpp.sockaddr* =
|
||||
(&address as Cpp.void*) unsafe as Cpp.sockaddr*;
|
||||
let address_ptr: Cpp.sockaddr* = &address unsafe as Cpp.sockaddr*;
|
||||
// TODO: Should have an implicit conversion from
|
||||
// T* to Optional(const T*).
|
||||
// TODO: Should expose `sizeof` somehow.
|
||||
|
||||
Reference in New Issue
Block a user