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

Rollup of 10 pull requests #120121

Merged
merged 41 commits into from
Jan 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
17edbe7
Use AtomicU8 instead of AtomicUsize in backtrace.rs
GnomedDev Dec 10, 2023
1c5b2ce
Docs: Use non-SeqCst in module example of atomics
AngelicosPhosphoros Dec 19, 2023
46ad131
update fn pointer trait impl docs
asquared31415 Jan 12, 2024
56df3bb
Move nonzero_integers macro call to bottom of module
dtolnay Dec 6, 2023
54cb822
Define only a single NonZero type per macro call
dtolnay Dec 6, 2023
9196d2a
Unindent nonzero_integer macro body
dtolnay Dec 6, 2023
a6152cd
Format nonzero_integer macro calls same way we do the primitive int i…
dtolnay Dec 6, 2023
3de0af1
Move 'impl FromStr for NonZero' into nonzero_integer macro
dtolnay Dec 6, 2023
81e1a7c
Move impl Div and Rem into nonzero_integer macro
dtolnay Dec 6, 2023
a78d9a6
Unindent nonzero_integer_impl_div_rem macro body
dtolnay Dec 6, 2023
f846ed5
Move leading_zeros and trailing_zeros methods into nonzero_integer macro
dtolnay Dec 6, 2023
757ed25
Move Neg impl into the macro that generates Div and Rem
dtolnay Dec 6, 2023
4291b3f
Move signedness dependent methods into the omnibus impl block
dtolnay Dec 6, 2023
b21b9cc
Unindent nonzero_integer_signedness_dependent_methods macro body
dtolnay Dec 6, 2023
c6d776e
Work around rustfmt doc attribute indentation bug
dtolnay Dec 6, 2023
63256af
Move nonzero_unsigned_signed_operations methods into the omnibus impl…
dtolnay Dec 6, 2023
4419136
Move is_power_of_two into unsigned part of signedness_dependent_methods
dtolnay Dec 6, 2023
7f7c5af
Move unsigned MIN and MAX into signedness_dependent_methods
dtolnay Dec 6, 2023
66cda3b
Move signed MIN and MAX into signedness_dependent_methods
dtolnay Dec 6, 2023
c537132
Move BITS into omnibus impl block
dtolnay Dec 6, 2023
cdee1fe
Unbreak tidy's feature parser
dtolnay Dec 6, 2023
c1c7707
Deny braced macro invocations in let-else
compiler-errors Dec 18, 2023
ec263df
Suggest wrapping mac args in parens rather than the whole expression
compiler-errors Dec 18, 2023
0373ce6
Warn when no profiler runtime means coverage tests won't be run/blessed
Zalathar Jan 18, 2024
d95d6ce
`dead_code` treats `#[repr(transparent)]` the same as `#[repr(C)]`
shepmaster Jan 18, 2024
fb7762b
Remove no-longer-needed `allow(dead_code)` from the standard library
shepmaster Jan 18, 2024
92cc57b
Remove no-longer-needed `allow(dead_code)` from the tests
shepmaster Jan 18, 2024
aeeaed9
Remove no-longer-needed `allow(dead_code)` from Miri tests
shepmaster Jan 18, 2024
7fead95
Remove myself from review rotation
WaffleLapkin Jan 18, 2024
35a9fc3
Clarify docs for Vec::into_boxed_slice, Vec::shrink_to_fit
invpt Jan 18, 2024
1a34342
Fix typo in documentation in base.rs
kapilsinha Jan 19, 2024
122b3f9
Rollup merge of #118665 - dtolnay:signedness, r=Nilstrieb
matthiaskrgr Jan 19, 2024
2d828cd
Rollup merge of #118798 - GnomedDev:use-atomicu8-backtrace, r=Nilstrieb
matthiaskrgr Jan 19, 2024
2e4c6fc
Rollup merge of #119062 - compiler-errors:asm-in-let-else, r=davidtwc…
matthiaskrgr Jan 19, 2024
f9076bb
Rollup merge of #119138 - AngelicosPhosphoros:use_proper_atomics_in_s…
matthiaskrgr Jan 19, 2024
48ba721
Rollup merge of #119907 - asquared31415:fn_trait_docs, r=Nilstrieb
matthiaskrgr Jan 19, 2024
987445c
Rollup merge of #120083 - Zalathar:no-profiler, r=wesleywiser
matthiaskrgr Jan 19, 2024
332f8f7
Rollup merge of #120107 - shepmaster:dead-code-repr-transparent, r=Ni…
matthiaskrgr Jan 19, 2024
7219bd2
Rollup merge of #120110 - invpt:patch-1, r=the8472
matthiaskrgr Jan 19, 2024
e35dfed
Rollup merge of #120113 - WaffleLapkin:🔥-1, r=compiler-errors
matthiaskrgr Jan 19, 2024
b4616f5
Rollup merge of #120118 - kapilsinha:patch-1, r=Nilstrieb
matthiaskrgr Jan 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Use AtomicU8 instead of AtomicUsize in backtrace.rs
  • Loading branch information
GnomedDev committed Dec 10, 2023
commit 17edbe7cad199e04345db5e810970576e8dc6f40
6 changes: 3 additions & 3 deletions library/std/src/backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ use crate::env;
use crate::ffi::c_void;
use crate::fmt;
use crate::panic::UnwindSafe;
use crate::sync::atomic::{AtomicUsize, Ordering::Relaxed};
use crate::sync::atomic::{AtomicU8, Ordering::Relaxed};
use crate::sync::LazyLock;
use crate::sys_common::backtrace::{lock, output_filename, set_image_base};
use crate::vec::Vec;
Expand Down Expand Up @@ -255,7 +255,7 @@ impl Backtrace {
// Cache the result of reading the environment variables to make
// backtrace captures speedy, because otherwise reading environment
// variables every time can be somewhat slow.
static ENABLED: AtomicUsize = AtomicUsize::new(0);
static ENABLED: AtomicU8 = AtomicU8::new(0);
match ENABLED.load(Relaxed) {
0 => {}
1 => return false,
Expand All @@ -268,7 +268,7 @@ impl Backtrace {
Err(_) => false,
},
};
ENABLED.store(enabled as usize + 1, Relaxed);
ENABLED.store(enabled as u8 + 1, Relaxed);
enabled
}

Expand Down
Loading