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

WASI: fix missing Iterator with rustc-dep-of-std #3854

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

youknowone
Copy link
Contributor

@youknowone youknowone commented Aug 19, 2024

#3681 (comment)

@tgross35 How can I correctly run local test of this build? I tried cargo build --target wasm32-wasip1 --features rustc-dep-of-std --no-default-features but it causes multiple patch-unrelated errors

❯ cargo build --target wasm32-wasip1 --features rustc-dep-of-std --no-default-features
error[E0432]: unresolved import `core::clone`
  --> src/lib.rs:46:11
   |
46 | use core::clone::Clone;
   |           ^^^^^ could not find `clone` in `core`

error[E0432]: unresolved import `core::ffi`
  --> src/lib.rs:48:5
   |
48 | use core::ffi;
   |     ^^^^^^^^^ no `ffi` in the root

@rustbot
Copy link
Collaborator

rustbot commented Aug 19, 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

tgross35 commented Aug 19, 2024

Thanks for the quick fix! I think you can test by temporarily patching this line

extern crate rustc_std_workspace_core as core;
to be extern crate core as core;. If that doesn't work then I wouldn't worry about testing with that feature. Please make sure wasi still builds locally without that feature, since we don't have it in CI (we should probably add it at some point).

Edit: realizing now that this only tests that the code builds but doesn’t actually verify without the prelude. Still useful, just not 100% accurate.

@youknowone
Copy link
Contributor Author

Thank you! I tested both with and without the feature and they look good. It doesn't complain about unused import.

@tgross35
Copy link
Contributor

Great, thanks!

@tgross35 tgross35 added this pull request to the merge queue Aug 19, 2024
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Aug 19, 2024
@tgross35 tgross35 changed the title [wasi] Add use core::iter::Iterator; WASI: fix missing Iterator with rustc-dep-of-std Aug 19, 2024
Merged via the queue into rust-lang:main with commit 179315a Aug 19, 2024
39 checks passed
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Aug 19, 2024
(backport <rust-lang#3854>)
(cherry picked from commit df33cf9)
@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 Aug 20, 2024
@youknowone youknowone deleted the wasi-select branch August 26, 2024 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review stable-applied This PR has been cherry-picked to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants