-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
librustc: Implement a Pod
kind for types that can be memcpy
'd.
#10924
Conversation
Can you add a run-pass test like the following:
|
Also, should we put Pod in the prelude, like Send etc? |
|
re-r? @nikomatsakis |
Given that POD is implicitly copyable, I think you can simplify Cell like so:
|
Also, I think that
|
Regarding the prelude, I wasn't seeing it there, but that's probably because I only built rustc-stage1 or something. |
At least a single mention of what POD stands for ("Plain Old Data", I am told) would be nice to have in the |
Manual needs to be updated, and ideally the error for non-pod would say why. But, rules in the manual are a fine substitute. |
Updated. |
r+ if we resolve the matter of whether |
@nikomatsakis: even if it's tracing, it's not really POD as you're going to need some kind of special annotations + rooting API calls AFAICT |
On Mon, Dec 16, 2013 at 02:40:26AM -0800, Daniel Micay wrote:
I guess that will depend on precisely what annotations are required |
This will be used for the new `Cell`. r? @nikomatsakis
…r=Centri3,flip1995,Manishearth Don't lint manual_let_else in cases where ? would work Don't lint `manual_let_else` where the question mark operator `?` would be sufficient, that is, mostly in cases like: ```Rust let v = if let Some(v) = ex { v } else { return None }; ``` Also, this PR emits the `question_mark` lint for `let...else` patterns that could be written with `?` (also, only `return None` like cases). ``` changelog: [`manual_let_else`]: don't lint in cases where question_mark already lints changelog: [`question_mark`]: lint for `let Some(...) = ex else { return None };` ``` Fixes rust-lang#8755
This will be used for the new
Cell
.r? @nikomatsakis