Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRaw pointer coercion #361
Conversation
mahkoh
added some commits
Oct 7, 2014
This comment has been minimized.
This comment has been minimized.
|
Yes Thank you This is a constant source of pain with the |
This comment has been minimized.
This comment has been minimized.
|
+1 (#16926) |
This comment has been minimized.
This comment has been minimized.
|
Definitely. I doubt that the current behavior is intended. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
+1 |
This comment has been minimized.
This comment has been minimized.
|
I was hesitant at first to allow these (philosophically we are dereferencing the raw pointer, which is unsafe, and then referencing with a different raw point), but since we don't actually do a dereference I think they are fine. I have a big RFCs on coercions almost ready which includes this change too. |
This comment has been minimized.
This comment has been minimized.
ghost
commented
Oct 9, 2014
|
Counterpoint: remove Pointers have no semantics, they just point to things. There is no difference between Pure Rust does not need it, references work better. C bindings don't need it either, just running bindgen won't give you the full story anyway. A C binding needs the full documentation encoded in a safe interface, not just individual unsafe signatures. |
pnkfelix
assigned
nrc
Oct 9, 2014
This comment has been minimized.
This comment has been minimized.
|
assigning to @nick29581 to shepherd |
This comment has been minimized.
This comment has been minimized.
ben0x539
commented
Oct 10, 2014
|
Should we then remove |
This comment has been minimized.
This comment has been minimized.
|
I'm not sure I agree with @Jurily about the need for const raw pointers. Even in C, constness is used as a hint for mutability and ownership transfer, allowing to catch many errors. |
This comment has been minimized.
This comment has been minimized.
ghost
commented
Oct 26, 2014
|
Rust can express the We already need
|
This comment has been minimized.
This comment has been minimized.
|
I do think it is worth talking about these things, but this particular RFC is just about some very simple and safe additions to the coercion rules. |
This comment has been minimized.
This comment has been minimized.
|
@nick29581: Do you think this RFC needs more details or discussion? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Feel free to add the content of this RFC to #401 if it's not already a superset. There was little debate here regarding the content of the RFC and I believe this RFC could be implemented quickly. There are enormous ergonomics benefits to be had for all those who work with lots of FFI code. Therefore I would appreciate it if this RFC could be merged and implemented quickly, even if it is later superseded by your RFC. |
This comment has been minimized.
This comment has been minimized.
alexcrichton
force-pushed the
rust-lang:master
branch
from
b9e2b8c
to
5020131
Oct 29, 2014
This comment has been minimized.
This comment has been minimized.
|
#401 has been accepted and I believe includes everything in this one. Closing for now, but if there is anything I've missed and I can re-open |
mahkoh commentedOct 7, 2014
*mut Tand&mut Tshould coerce to*const T.Rendered