Skip to content

core: Switch to unconditional no_std#3323

Merged
jplatte merged 2 commits intomainfrom
jplatte/core-no-std
Sep 5, 2025
Merged

core: Switch to unconditional no_std#3323
jplatte merged 2 commits intomainfrom
jplatte/core-no-std

Conversation

@jplatte
Copy link
Contributor

@jplatte jplatte commented Jun 22, 2025

… and update imports accordingly.

Motivation

Makes the code less weird, and makes std dependencies clearer by not using the prelude anymore.

Solution

See individual commits.

@hds if you like this, I can convert the remaining crates that currently have #![cfg_attr(not(feature = "std"), no_std)] to this style in follow-up PRs.

@jplatte jplatte requested review from a team and hawkw as code owners June 22, 2025 19:04
@jplatte jplatte force-pushed the jplatte/core-no-std branch from 364cacb to b6e7321 Compare June 22, 2025 20:40
Copy link
Contributor

@djc djc left a comment

Choose a reason for hiding this comment

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

I like it!

In other crates, we've set up #![warn(clippy::alloc_instead_of_core, clippy::std_instead_of_core)] which might provide a better development experience?

Sorry for the slow feedback -- mentioning me on GitHub might work better than Discord.

@jplatte
Copy link
Contributor Author

jplatte commented Sep 5, 2025

Sorry for the slow feedback -- mentioning me on GitHub might work better than Discord.

No worries, this is still plenty fast in terms of feedback on tracing PRs 🫠

@djc
Copy link
Contributor

djc commented Sep 5, 2025

Do you have privileges in this repo? If not, I guess I can just merge it.

… except std::sync::Mutex, which there is a polyfill for.
@jplatte jplatte force-pushed the jplatte/core-no-std branch from b6e7321 to f42f840 Compare September 5, 2025 09:05
@jplatte jplatte enabled auto-merge (rebase) September 5, 2025 09:06
@jplatte jplatte merged commit fad6de7 into main Sep 5, 2025
55 of 56 checks passed
@jplatte jplatte deleted the jplatte/core-no-std branch September 5, 2025 09:14
hds added a commit that referenced this pull request Nov 24, 2025
# 0.1.35 (November 24, 2025)

### Added

- Switch to unconditional `no_std` ([#3323])
- Improve code generation at trace points significantly ([#3398])

### Fixed

- Add missing `dyn` keyword in `Visit` documentation code sample ([#3387])

### Documented

- Add favicon for extra pretty docs ([#3351])

[#3323]: https://github.com/tokio-rs/tracing/pull/#3323
[#3351]: https://github.com/tokio-rs/tracing/pull/#3351
[#3387]: https://github.com/tokio-rs/tracing/pull/#3387
[#3398]: https://github.com/tokio-rs/tracing/pull/#3398
hds added a commit that referenced this pull request Nov 24, 2025
# 0.1.35 (November 24, 2025)

### Added

- Switch to unconditional `no_std` ([#3323])
- Improve code generation at trace points significantly ([#3398])

### Fixed

- Add missing `dyn` keyword in `Visit` documentation code sample ([#3387])

### Documented

- Add favicon for extra pretty docs ([#3351])

[#3323]: https://github.com/tokio-rs/tracing/pull/#3323
[#3351]: https://github.com/tokio-rs/tracing/pull/#3351
[#3387]: https://github.com/tokio-rs/tracing/pull/#3387
[#3398]: https://github.com/tokio-rs/tracing/pull/#3398
hds added a commit that referenced this pull request Nov 26, 2025
# 0.1.35 (November 26, 2025)

### Added

- Switch to unconditional `no_std` ([#3323])
- Improve code generation at trace points significantly ([#3398])

### Fixed

- Add missing `dyn` keyword in `Visit` documentation code sample ([#3387])

### Documented

- Add favicon for extra pretty docs ([#3351])

[#3323]: https://github.com/tokio-rs/tracing/pull/#3323
[#3351]: https://github.com/tokio-rs/tracing/pull/#3351
[#3387]: https://github.com/tokio-rs/tracing/pull/#3387
[#3398]: https://github.com/tokio-rs/tracing/pull/#3398
hds added a commit that referenced this pull request Nov 26, 2025
# 0.1.35 (November 26, 2025)

### Added

- Switch to unconditional `no_std` ([#3323])
- Improve code generation at trace points significantly ([#3398])

### Fixed

- Add missing `dyn` keyword in `Visit` documentation code sample ([#3387])

### Documented

- Add favicon for extra pretty docs ([#3351])

[#3323]: https://github.com/tokio-rs/tracing/pull/#3323
[#3351]: https://github.com/tokio-rs/tracing/pull/#3351
[#3387]: https://github.com/tokio-rs/tracing/pull/#3387
[#3398]: https://github.com/tokio-rs/tracing/pull/#3398
hds added a commit that referenced this pull request Nov 26, 2025
# 0.1.35 (November 26, 2025)

### Added

- Switch to unconditional `no_std` ([#3323])
- Improve code generation at trace points significantly ([#3398])

### Fixed

- Add missing `dyn` keyword in `Visit` documentation code sample ([#3387])

### Documented

- Add favicon for extra pretty docs ([#3351])

[#3323]: https://github.com/tokio-rs/tracing/pull/#3323
[#3351]: https://github.com/tokio-rs/tracing/pull/#3351
[#3387]: https://github.com/tokio-rs/tracing/pull/#3387
[#3398]: https://github.com/tokio-rs/tracing/pull/#3398
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.

2 participants