mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-17 05:58:12 +00: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:
1 parent
c9dbf40f11
commit
a2e4c31e8e
3 files changed
+27
-31
No files matched your search
@@ -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