Skip to content

Theoretically test statics #1075

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

Merged
merged 3 commits into from
Sep 13, 2018
Merged

Theoretically test statics #1075

merged 3 commits into from
Sep 13, 2018

Conversation

tbu-
Copy link
Contributor

@tbu- tbu- commented Sep 5, 2018

There are none of them in libc except for __progname on Android, but
that one cannot be tested because it's not present in any header files.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

There are none of them in `libc` except for `__progname` on Android, but
that one cannot be tested because it's not present in any header files.
@tbu-
Copy link
Contributor Author

tbu- commented Sep 5, 2018

error: `std::sync::atomic::AtomicBool::new` is not yet stable as a const fn
  --> /checkout/target/aarch64-unknown-linux-musl/debug/build/libc-test-fbe7777b6c849b64/out/linux_fcntl.rs:40:41
   |
40 |             static FAILED: AtomicBool = AtomicBool::new(false);
   |                                         ^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: in Nightly builds, add `#![feature(const_atomic_bool_new)]` to the crate attributes to enable
error: `std::sync::atomic::AtomicUsize::new` is not yet stable as a const fn
  --> /checkout/target/aarch64-unknown-linux-musl/debug/build/libc-test-fbe7777b6c849b64/out/linux_fcntl.rs:41:42
   |
41 |             static NTESTS: AtomicUsize = AtomicUsize::new(0);
   |                                          ^^^^^^^^^^^^^^^^^^^
   |
   = help: in Nightly builds, add `#![feature(const_atomic_usize_new)]` to the crate attributes to enable

Seems like my changes in ctest increased the minimal Rust version.

@alexcrichton
Copy link
Member

Yes let's revert those changes in ctest, I'll be yanking 0.2.1 for that reason

@alexcrichton alexcrichton reopened this Sep 5, 2018
@alexcrichton
Copy link
Member

er, didn't mean to close

tbu- added a commit to tbu-/rust-ctest that referenced this pull request Sep 12, 2018
Being able to call `const fn` on stable is a relatively new addition.

CC rust-lang/libc#1075
Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@@ -432,6 +432,7 @@ fn main() {
cfg.skip_struct(move |ty| {
match ty {
"sockaddr_nl" => musl,
"ucontext_t" => true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come this is unconditionally ignored? Should it only be ignored on one platform?

@@ -639,6 +640,7 @@ fn main() {
s if ios && s.starts_with("RTV_") => true,
s if ios && s.starts_with("DLT_") => true,

"NFT_MSG_MAX" => true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this have a comment indicating why it's ignored?

@tbu-
Copy link
Contributor Author

tbu- commented Sep 13, 2018

My bad, I added these ignores because they failed on my machine, didn't mean to add them to the PR.

Will open an issue about them.

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Sep 13, 2018

📌 Commit eb6bdf3 has been approved by alexcrichton

bors added a commit that referenced this pull request Sep 13, 2018
Theoretically test statics

There are none of them in `libc` except for `__progname` on Android, but
that one cannot be tested because it's not present in any header files.
@bors
Copy link
Contributor

bors commented Sep 13, 2018

⌛ Testing commit eb6bdf3 with merge 878e6ae...

@bors
Copy link
Contributor

bors commented Sep 13, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 878e6ae to master...

@bors bors merged commit eb6bdf3 into rust-lang:master Sep 13, 2018
tgross35 pushed a commit to tgross35/ctest2 that referenced this pull request Apr 2, 2025
Being able to call `const fn` on stable is a relatively new addition.

CC rust-lang/libc#1075
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Apr 2, 2025
Being able to call `const fn` on stable is a relatively new addition.

CC rust-lang#1075
tgross35 pushed a commit to tgross35/ctest2 that referenced this pull request Apr 2, 2025
Being able to call `const fn` on stable is a relatively new addition.

CC rust-lang/libc#1075
sanstzu pushed a commit to sanstzu/rust-libc that referenced this pull request May 16, 2025
Being able to call `const fn` on stable is a relatively new addition.

CC rust-lang#1075
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants