Skip to content

[WIP] move std::io::Error to core#153915

Draft
max-heller wants to merge 2 commits intorust-lang:mainfrom
max-heller:io-error-in-core
Draft

[WIP] move std::io::Error to core#153915
max-heller wants to merge 2 commits intorust-lang:mainfrom
max-heller:io-error-in-core

Conversation

@max-heller
Copy link
Contributor

WIP rebased version of @programmerjake's #116685, as suggested in rust-lang/libs-team#755 (comment).

This is compiling for at least aarch64-apple-darwin, but will likely fail for most other targets. Going to get CI passing-ish, then try replacing the AtomicPtr vtables with externally defined items as suggested in the original PR:

I use AtomicPtr to fill in the parts that are needed from alloc/std, but that should probably be replaced with something like #[panic_handler] or #[global_allocator] except where it resolves to a null pointer instead of erroring if not provided.

@rustbot rustbot added A-tidy Area: The tidy tool O-itron Operating System: ITRON S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 15, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Co-authored-by: Jacob Lifshay <programmerjake@gmail.com>
@rust-log-analyzer

This comment has been minimized.

@max-heller
Copy link
Contributor Author

then try replacing the AtomicPtr vtables with externally defined items as suggested in the original PR

Initial attempt using #[rustc_std_internal_symbol] unsurprisingly doesn't work for non-trivial programs unless std is linked, looking into how to make this work more like #[panic_handler]

@max-heller

This comment was marked as resolved.

@rustbot rustbot removed the O-itron Operating System: ITRON label Mar 15, 2026
@rust-log-analyzer
Copy link
Collaborator

The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
fmt: checked 6751 files
tidy check
tidy [rustdoc_json (src)]: `rustdoc-json-types` modified, checking format version
tidy: Skipping binary file check, read-only filesystem
tidy [style (library)]: /checkout/library/core/src/lib.rs:298: TODO is used for tasks that should be done before merging a PR; If you want to leave a message in the codebase use FIXME
tidy [style (library)]: /checkout/library/core/src/io/error.rs:905: undocumented unsafe
tidy [style (library)]: /checkout/library/core/src/io/error/repr_bitpacked.rs:159: undocumented unsafe
tidy [style (library)]: /checkout/library/core/src/io/error/repr_bitpacked.rs:171: undocumented unsafe
tidy [style (library)]: /checkout/library/core/src/io/error/repr_bitpacked.rs:188: undocumented unsafe
tidy [style (library)]: /checkout/library/core/src/io/error/repr_bitpacked.rs:204: undocumented unsafe
tidy [style (library)]: /checkout/library/core/src/io/error/repr_bitpacked.rs:210: undocumented unsafe
tidy [style (library)]: /checkout/library/core/src/io/error/repr_bitpacked.rs:216: undocumented unsafe
tidy [style (library)]: /checkout/library/core/src/io/error/repr_bitpacked.rs:224: undocumented unsafe
tidy [style (library)]: /checkout/library/core/src/io/error/repr_bitpacked.rs:233: undocumented unsafe
tidy [style (library)]: /checkout/library/core/src/io/error/repr_bitpacked.rs:264: undocumented unsafe
tidy [style (library)]: FAIL
removing old virtual environment
creating virtual environment at '/checkout/obj/build/venv' using 'python3.10' and 'venv'
creating virtual environment at '/checkout/obj/build/venv' using 'python3.10' and 'virtualenv'
Requirement already satisfied: pip in ./build/venv/lib/python3.10/site-packages (26.0.1)
linting python files
---
linting javascript files
Running eslint on rustdoc JS files
info: ES-Check: there were no ES version matching errors!  🎉
typechecking javascript files
tidy: The following check failed: style (library)
Command `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools-bin/rust-tidy --root-path=/checkout --cargo-path=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo --output-dir=/checkout/obj/build --concurrency=4 --npm-path=/node/bin/yarn --ci=true --extra-checks=py,cpp,js,spellcheck` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:1618:23
Executed at: src/bootstrap/src/core/build_steps/test.rs:1387:29

Command has failed. Rerun with -v to see more details.
Bootstrap failed while executing `test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck`
Build completed unsuccessfully in 0:03:02
  local time: Sun Mar 15 16:49:40 UTC 2026
  network time: Sun, 15 Mar 2026 16:49:40 GMT
##[error]Process completed with exit code 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tidy Area: The tidy tool S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants