Skip to content
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

[0.2]: Ensure all tests in the workspace are run and that const extern fn is always enabled #4152

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Nov 26, 2024

Backport #4151, excluding the last commit that removes the const-extern-fn feature.

@rustbot
Copy link
Collaborator

rustbot commented Nov 26, 2024

r? @JohnTitor

rustbot has assigned @JohnTitor.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Specifically, this should ensure that unit tests in the `libc` crate
don't get missed.

(backport <rust-lang#4151>)
(cherry picked from commit f553033)
In [1] this conditional was dropped in favor of a Cargo feature, which
was turned on by default in [2]. However, this did not help the case
where `--no-default-features` is passed.

Unfortunately we still can't drop this config entirely since `ctest`
cannot parse the syntax, so change back to useing a `cfg` to control
constness rather than a Cargo feature.

Additionally, remove a portion of the macro's comment that is no longer
relevant.

Fixes: rust-lang#4149

[1]: rust-lang#4105
[2]: rust-lang#4134

(backport <rust-lang#4151>)
(cherry picked from commit e18ee8c)
// Specifically, moving the 'cfg_if' into the macro body will *not* work. Doing so would cause the
// '#[cfg(libc_const_extern_fn)]' to be emitted into user code. The 'cfg' gate will not stop Rust
// from trying to parse the 'pub const unsafe extern fn', so users would get a compiler error even
// when the 'libc_const_extern_fn' feature is disabled.
Copy link
Contributor

Choose a reason for hiding this comment

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

it's no longer a feature.

@tgross35 tgross35 added this pull request to the merge queue Nov 26, 2024
Merged via the queue into rust-lang:libc-0.2 with commit 4843c55 Nov 26, 2024
45 checks passed
@tgross35 tgross35 deleted the backport-tests-and-const-extern branch November 26, 2024 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants