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

Fix usage with rustc-dep-of-std #4158

Merged
merged 2 commits into from
Nov 28, 2024
Merged

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Nov 27, 2024

Since #4038 we use derive macros rather than manually implementing Clone
and Copy. However, this caused the build in std to start failing since the core prelude is not available. This provides the derive macros as well as derive itself.

Resolve this by using complete paths. Additionally allow internal_features to suppress the warning using link_cfg.

Includes a test that verifies build with rustc-dep-of-std enabled.

@rustbot
Copy link
Collaborator

rustbot commented Nov 27, 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

@tgross35
Copy link
Contributor Author

I'm going to wait for #4161 and then do the remaining fixes on top of that.

@bors
Copy link
Contributor

bors commented Nov 28, 2024

☔ The latest upstream changes (presumably #4161) made this pull request unmergeable. Please resolve the merge conflicts.

@tgross35 tgross35 force-pushed the fix-rustc-dep-of-std branch from 214a5f0 to 233684f Compare November 28, 2024 01:43
@tgross35 tgross35 force-pushed the fix-rustc-dep-of-std branch 5 times, most recently from 6087fbc to cfa7ce0 Compare November 28, 2024 03:25
@tgross35 tgross35 changed the title [wip] fix rustc dep of std Fix usage with rustc-dep-of-std Nov 28, 2024
@tgross35 tgross35 force-pushed the fix-rustc-dep-of-std branch from cfa7ce0 to f3b5b4c Compare November 28, 2024 03:32
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Nov 28, 2024
@tgross35 tgross35 marked this pull request as ready for review November 28, 2024 03:44
Since [1] we use derive macros rather than manually implementing `Clone`
and `Copy`. However, this caused the build in `std` to start failing
since the `core` prelude is not available. This provides the derive
macros as well as `derive` itself.

Resolve this by using complete paths. Additionally allow
`internal_features` to suppress the warning using `link_cfg`, and change
to using global paths for all uses of `core`.

Link: rust-lang#4038 [1]
Add a test that the crate builds correctly with the configuration that
is used in `std`.
@tgross35 tgross35 force-pushed the fix-rustc-dep-of-std branch from 1d7caa7 to 9839a9a Compare November 28, 2024 03:50
tgross35 added a commit to tgross35/rust-libc that referenced this pull request Nov 28, 2024
Since [1] we use derive macros rather than manually implementing `Clone`
and `Copy`. However, this caused the build in `std` to start failing
since the `core` prelude is not available. This provides the derive
macros as well as `derive` itself.

Resolve this by using complete paths. Additionally allow
`internal_features` to suppress the warning using `link_cfg`, and change
to using global paths for all uses of `core`.

Link: rust-lang#4038 [1]

(backport <rust-lang#4158>)
(cherry picked from commit d69ad56)
tgross35 added a commit to tgross35/rust-libc that referenced this pull request Nov 28, 2024
Add a test that the crate builds correctly with the configuration that
is used in `std`.

(backport <rust-lang#4158>)
(cherry picked from commit 9839a9a)
@tgross35 tgross35 added this pull request to the merge queue Nov 28, 2024
Merged via the queue into rust-lang:main with commit d76b3c8 Nov 28, 2024
45 checks passed
@tgross35 tgross35 deleted the fix-rustc-dep-of-std branch November 29, 2024 09:30
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Dec 9, 2024
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