-
Notifications
You must be signed in to change notification settings - Fork 734
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
davidbarsky
approved these changes
Mar 25, 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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Currently, compiling
tracing-core
withdefault-features = false
(i.e. for
no_std
targets) emits a few warnings. This is due to thespinlock implementation's use of the deprecated
atomic::spin_loop_hint
function (renamed to
hint::spin_loop
), and the use of deprecatedcompare_and_swap
instead ofcompare_exchange
methods. Now that ourMSRV is 1.49 (the version in which
hint::spin_loop
was stabilized), wecan 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 featureflagged to require
std
, but the module itself doesn't, so the importsare just hanging out and not getting used for anything. I went ahead and
fixed that as well.