-
Notifications
You must be signed in to change notification settings - Fork 13.4k
trpl: ffi: clean up examples and push crates.io #29790
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
Conversation
c1dcf87
to
566330b
Compare
@@ -85,8 +101,11 @@ the allocated memory. The length is less than or equal to the capacity. | |||
# #![feature(libc)] | |||
# extern crate libc; | |||
# use libc::{c_int, size_t}; | |||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't usually add extra lines like this here, as they're not displayed anyway, and just take up space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I can take the spaces back out.
Why are these cfgs being added? |
I add the cfg business to make the examples compile in the playpen. If that stuff stays I guess they can also be changed from |
@@ -16,11 +27,14 @@ compile if snappy is installed: | |||
extern crate libc; | |||
use libc::size_t; | |||
|
|||
#[cfg(nope)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, I left out the #
here.
I just realized the cfg hack is way unnecessary, especially the |
Looks better now (to me). |
@bors: r+ rollup |
📌 Commit 9454fd4 has been approved by |
Thanks! |
…bnik Crates.io is now mentioned right at the top to try and head off the `#![feature(libc)]` error. In addition, the examples now all compile and run in the playpen. I also tweaked spacing in some of them. Fixes rust-lang#29762. r? @steveklabnik
⌛ Testing commit 9454fd4 with merge 517d23c... |
💔 Test failed - auto-linux-64-nopt-t |
Looks like a legit failure here. |
Ah yep, readline is installed in the playpen but not on the buildbot. |
Just be sure to tag the tests with |
The point was to not need |
Thanks @durka. I agree that we can't remove |
Well, you can remove them by stubbing out the FFI functions and hiding the stub code from rustdoc, but then part of the code in the example isn't tested, so it's not a perfect solution. |
Crates.io is now mentioned right at the top to try and head off the
#![feature(libc)]
error.In addition, the examples now all compile and run in the playpen. I also tweaked spacing in some of them.
Fixes #29762.
r? @steveklabnik