Skip to content

use std as extern crate#6054

Open
Person-93 wants to merge 1 commit into
PyO3:mainfrom
Person-93:extern_std
Open

use std as extern crate#6054
Person-93 wants to merge 1 commit into
PyO3:mainfrom
Person-93:extern_std

Conversation

@Person-93
Copy link
Copy Markdown
Contributor

@Person-93 Person-93 commented May 18, 2026

This PR is to prepare for no_std support.

  • I've made the main crate no_std and added extern crate std instead.
  • I've also added a new top-level mod platform to hold all the upcoming std replacements. As of now, it just has a prelude which contains
    • Things from the alloc crate people generate use from std's prelude
    • the eprintln macro (we will need to find a replacement for this)
  • I've added import crate::platform::prelude::* to every file that uses things from the standard prelude.
  • The test_utils file could not import the prelude so it had to import directly from the alloc crate.
  • in py_format macro: replace use of ToOwned with Clone

@Person-93 Person-93 force-pushed the extern_std branch 2 times, most recently from c683aa6 to 43509a5 Compare May 18, 2026 07:30
@Person-93 Person-93 marked this pull request as draft May 18, 2026 07:38
@Person-93 Person-93 force-pushed the extern_std branch 10 times, most recently from 6371c15 to ecec57a Compare May 18, 2026 08:56
@Person-93 Person-93 marked this pull request as ready for review May 18, 2026 09:42
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.

1 participant