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

core: fix warnings when compiling without std #2022

Merged
merged 2 commits into from
Mar 25, 2022
Merged

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Mar 25, 2022

Motivation

Currently, compiling tracing-core with default-features = false
(i.e. for no_std targets) emits a few warnings. This is due to the
spinlock implementation's use of the deprecated atomic::spin_loop_hint
function (renamed to hint::spin_loop), and the use of deprecated
compare_and_swap instead of compare_exchange methods. Now that our
MSRV is 1.49 (the version in which hint::spin_loop was stabilized), we
can fix these warnings.

Solution

This branch replaces the deprecated APIs.

Also, I noticed that one of the tests emits unused-imports warnings with
--no-default-features. This is because the actual tests are feature
flagged to require std, but the module itself doesn't, so the imports
are just hanging out and not getting used for anything. I went ahead and
fixed that as well.

@hawkw hawkw requested a review from a team as a code owner March 25, 2022 00:08
@hawkw hawkw enabled auto-merge (squash) March 25, 2022 00:08
@hawkw hawkw merged commit df9666b into v0.1.x Mar 25, 2022
@hawkw hawkw deleted the eliza/spin-loop-warnings branch March 25, 2022 00:27
hawkw added a commit that referenced this pull request Apr 1, 2022
# 0.1.24 (April 1, 2022)

This release fixes a bug where setting `NoSubscriber` as the local
default would not locally disable the current global default subscriber.

### Fixed

- Setting `NoSubscriber` as the local default now correctly disables the
  global default subscriber ([#2001])
- Fixed compilation warnings with the "std" feature disabled ([#2022])

### Changed

- Removed unnecessary use of `write!` and `format_args!` macros
  ([#1988])

[#1988]: #1988
[#2001]: #2001
[#2022]: #2022
hawkw added a commit that referenced this pull request Apr 1, 2022
# 0.1.24 (April 1, 2022)

This release fixes a bug where setting `NoSubscriber` as the local
default would not locally disable the current global default subscriber.

### Fixed

- Setting `NoSubscriber` as the local default now correctly disables the
  global default subscriber ([#2001])
- Fixed compilation warnings with the "std" feature disabled ([#2022])

### Changed

- Removed unnecessary use of `write!` and `format_args!` macros
  ([#1988])

[#1988]: #1988
[#2001]: #2001
[#2022]: #2022
kaffarell pushed a commit to kaffarell/tracing that referenced this pull request May 22, 2024
Currently, compiling `tracing-core` with `default-features = false`
(i.e. for `no_std` targets) emits a few warnings. This is due to the
spinlock implementation's use of the deprecated `atomic::spin_loop_hint`
function (renamed to `hint::spin_loop`), and the use of deprecated
`compare_and_swap` instead of `compare_exchange` methods. Now that our
MSRV is 1.49 (the version in which `hint::spin_loop` was stabilized), we
can fix these warnings.

This branch replaces the deprecated APIs.

Also, I noticed that one of the tests emits unused-imports warnings with
`--no-default-features`. This is because the actual tests are feature
flagged to require `std`, but the module itself doesn't, so the imports
are just hanging out and not getting used for anything. I went ahead and
fixed that as well.

Signed-off-by: Eliza Weisman <[email protected]>
kaffarell pushed a commit to kaffarell/tracing that referenced this pull request May 22, 2024
# 0.1.24 (April 1, 2022)

This release fixes a bug where setting `NoSubscriber` as the local
default would not locally disable the current global default subscriber.

### Fixed

- Setting `NoSubscriber` as the local default now correctly disables the
  global default subscriber ([tokio-rs#2001])
- Fixed compilation warnings with the "std" feature disabled ([tokio-rs#2022])

### Changed

- Removed unnecessary use of `write!` and `format_args!` macros
  ([tokio-rs#1988])

[tokio-rs#1988]: tokio-rs#1988
[tokio-rs#2001]: tokio-rs#2001
[tokio-rs#2022]: tokio-rs#2022
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