-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Rollup of 10 pull requests #120121
Commits on Dec 10, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 17edbe7 - Browse repository at this point
Copy the full SHA 17edbe7View commit details
Commits on Dec 19, 2023
-
Docs: Use non-SeqCst in module example of atomics
I done this for this reasons: 1. The example now shows that there is more Orderings than just SeqCst. 2. People who would copy from example would now have more suitable orderings for the job. 3. SeqCst is both much harder to reason about and not needed in most situations. IMHO, we should encourage people to think and use memory orderings that is suitable to task instead of blindly defaulting to SeqCst.
Configuration menu - View commit details
-
Copy full SHA for 1c5b2ce - Browse repository at this point
Copy the full SHA 1c5b2ceView commit details
Commits on Jan 12, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 46ad131 - Browse repository at this point
Copy the full SHA 46ad131View commit details
Commits on Jan 14, 2024
-
Move nonzero_integers macro call to bottom of module
This way all the other macros defined in this module, such as nonzero_leading_trailing_zeros, are available to call within the expansion of nonzero_integers. (Macros defined by macro_rules cannot be called from the same module above the location of the macro_rules.) In this commit the ability to call things like nonzero_leading_trailing_zeros is not immediately used, but later commits in this stack will be consolidating the entire API of NonZeroT to be generated through nonzero_integers, and will need to make use of some of the other macros to do that.
Configuration menu - View commit details
-
Copy full SHA for 56df3bb - Browse repository at this point
Copy the full SHA 56df3bbView commit details -
Define only a single NonZero type per macro call
Later in this stack, as the nonzero_integers macro is going to be responsible for producing a larger fraction of the API for the NonZero integer types, it will need to receive a number of additional arguments beyond the ones currently seen here. Additional arguments, especially named arguments across multiple lines, will turn out clearer if everything in one macro call is for the same NonZero type. This commit adopts a similar arrangement to what we do for generating the API of the integer primitives (`impl u8` etc), which also generate a single type's API per top-level macro call, rather than generating all 12 impl blocks for the 12 types from one macro call.
Configuration menu - View commit details
-
Copy full SHA for 54cb822 - Browse repository at this point
Copy the full SHA 54cb822View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9196d2a - Browse repository at this point
Copy the full SHA 9196d2aView commit details -
Format nonzero_integer macro calls same way we do the primitive int i…
…mpls The `key = $value` style will be beneficial as we introduce some more macro arguments here in later commits.
Configuration menu - View commit details
-
Copy full SHA for a6152cd - Browse repository at this point
Copy the full SHA a6152cdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3de0af1 - Browse repository at this point
Copy the full SHA 3de0af1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 81e1a7c - Browse repository at this point
Copy the full SHA 81e1a7cView commit details -
Configuration menu - View commit details
-
Copy full SHA for a78d9a6 - Browse repository at this point
Copy the full SHA a78d9a6View commit details -
Configuration menu - View commit details
-
Copy full SHA for f846ed5 - Browse repository at this point
Copy the full SHA f846ed5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 757ed25 - Browse repository at this point
Copy the full SHA 757ed25View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4291b3f - Browse repository at this point
Copy the full SHA 4291b3fView commit details -
Configuration menu - View commit details
-
Copy full SHA for b21b9cc - Browse repository at this point
Copy the full SHA b21b9ccView commit details -
Configuration menu - View commit details
-
Copy full SHA for c6d776e - Browse repository at this point
Copy the full SHA c6d776eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 63256af - Browse repository at this point
Copy the full SHA 63256afView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4419136 - Browse repository at this point
Copy the full SHA 4419136View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7f7c5af - Browse repository at this point
Copy the full SHA 7f7c5afView commit details -
Configuration menu - View commit details
-
Copy full SHA for 66cda3b - Browse repository at this point
Copy the full SHA 66cda3bView commit details -
Configuration menu - View commit details
-
Copy full SHA for c537132 - Browse repository at this point
Copy the full SHA c537132View commit details -
tidy error: /git/rust/library/core/src/num/nonzero.rs:67: malformed stability attribute: missing `feature` key tidy error: /git/rust/library/core/src/num/nonzero.rs:82: malformed stability attribute: missing `feature` key tidy error: /git/rust/library/core/src/num/nonzero.rs:98: malformed stability attribute: missing the `since` key tidy error: /git/rust/library/core/src/num/nonzero.rs:112: malformed stability attribute: missing `feature` key tidy error: /git/rust/library/core/src/num/nonzero.rs:450: malformed stability attribute: missing `feature` key some tidy checks failed
Configuration menu - View commit details
-
Copy full SHA for cdee1fe - Browse repository at this point
Copy the full SHA cdee1feView commit details
Commits on Jan 17, 2024
-
Configuration menu - View commit details
-
Copy full SHA for c1c7707 - Browse repository at this point
Copy the full SHA c1c7707View commit details
Commits on Jan 18, 2024
-
Configuration menu - View commit details
-
Copy full SHA for ec263df - Browse repository at this point
Copy the full SHA ec263dfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0373ce6 - Browse repository at this point
Copy the full SHA 0373ce6View commit details -
Configuration menu - View commit details
-
Copy full SHA for d95d6ce - Browse repository at this point
Copy the full SHA d95d6ceView commit details -
Remove no-longer-needed
allow(dead_code)
from the standard library`repr(transparent)` now silences the lint.
Configuration menu - View commit details
-
Copy full SHA for fb7762b - Browse repository at this point
Copy the full SHA fb7762bView commit details -
Remove no-longer-needed
allow(dead_code)
from the tests`repr(transparent)` now silences the lint.
Configuration menu - View commit details
-
Copy full SHA for 92cc57b - Browse repository at this point
Copy the full SHA 92cc57bView commit details -
Remove no-longer-needed
allow(dead_code)
from Miri tests`repr(transparent)` now silences the lint.
Configuration menu - View commit details
-
Copy full SHA for aeeaed9 - Browse repository at this point
Copy the full SHA aeeaed9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7fead95 - Browse repository at this point
Copy the full SHA 7fead95View commit details -
Configuration menu - View commit details
-
Copy full SHA for 35a9fc3 - Browse repository at this point
Copy the full SHA 35a9fc3View commit details
Commits on Jan 19, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 1a34342 - Browse repository at this point
Copy the full SHA 1a34342View commit details -
Rollup merge of rust-lang#118665 - dtolnay:signedness, r=Nilstrieb
Consolidate all associated items on the NonZero integer types into a single impl block per type **Before:** ```rust #[repr(transparent)] #[rustc_layout_scalar_valid_range_start(1)] pub struct NonZeroI8(i8); impl NonZeroI8 { pub const fn new(n: i8) -> Option<Self> ... pub const fn get(self) -> i8 ... } impl NonZeroI8 { pub const fn leading_zeros(self) -> u32 ... pub const fn trailing_zeros(self) -> u32 ... } impl NonZeroI8 { pub const fn abs(self) -> NonZeroI8 ... } ... ``` **After:** ```rust #[repr(transparent)] #[rustc_layout_scalar_valid_range_start(1)] pub struct NonZeroI8(i8); impl NonZeroI8 { pub const fn new(n: i8) -> Option<Self> ... pub const fn get(self) -> i8 ... pub const fn leading_zeros(self) -> u32 ... pub const fn trailing_zeros(self) -> u32 ... pub const fn abs(self) -> NonZeroI8 ... ... } ``` Having 6-7 different impl blocks per type is not such a problem in today's implementation, but becomes awful upon the switch to a generic `NonZero<T>` type (context: rust-lang#82363 (comment)). In the implementation from rust-lang#100428, there end up being **67** impl blocks on that type. <img src="https://github.com/rust-lang/rust/assets/1940490/5b68bd6f-8a36-4922-baa3-348e30dbfcc1" width="200"><img src="https://github.com/rust-lang/rust/assets/1940490/2cfec71e-c2cd-4361-a542-487f13f435d9" width="200"><img src="https://github.com/rust-lang/rust/assets/1940490/2fe00337-7307-405d-9036-6fe1e58b2627" width="200"> Without the refactor to a single impl block first, introducing `NonZero<T>` would be a usability regression compared to today's separate pages per type. With all those blocks expanded, Ctrl+F is obnoxious because you need to skip 12× past every match you don't care about. With all the blocks collapsed, Ctrl+F is useless. Getting to a state in which exactly one type's (e.g. `NonZero<u32>`) impl blocks are expanded while the rest are collapsed is annoying. After this refactor to a single impl block, we can move forward with making `NonZero<T>` a generic struct whose docs all go on the same rustdoc page. The rustdoc will have 12 impl blocks, one per choice of `T` supported by the standard library. The reader can expand a single one of those impl blocks e.g. `NonZero<u32>` to understand the entire API of that type. Note that moving the API into a generic `impl<T> NonZero<T> { ... }` is not going to be an option until after `NonZero<T>` has been stabilized, which may be months or years after its introduction. During the period while generic `NonZero` is unstable, it will be extra important to offer good documentation on all methods demonstrating the API being used through the stable aliases such as `NonZeroI8`. This PR follows a `key = $value` syntax for the macros which is similar to the macros we already use for producing a single large impl block on the integer primitives. https://github.com/rust-lang/rust/blob/1dd4db50620fb38a6382c22456a96ed7cddeff83/library/core/src/num/mod.rs#L288-L309 Best reviewed one commit at a time.
Configuration menu - View commit details
-
Copy full SHA for 122b3f9 - Browse repository at this point
Copy the full SHA 122b3f9View commit details -
Rollup merge of rust-lang#118798 - GnomedDev:use-atomicu8-backtrace, …
…r=Nilstrieb Use AtomicU8 instead of AtomicUsize in backtrace.rs Just a small inefficiency I saw when looking at std sources.
Configuration menu - View commit details
-
Copy full SHA for 2d828cd - Browse repository at this point
Copy the full SHA 2d828cdView commit details -
Rollup merge of rust-lang#119062 - compiler-errors:asm-in-let-else, r…
…=davidtwco,est31 Deny braced macro invocations in let-else Fixes rust-lang#119057 Pending T-lang decision cc `@dtolnay`
Configuration menu - View commit details
-
Copy full SHA for 2e4c6fc - Browse repository at this point
Copy the full SHA 2e4c6fcView commit details -
Rollup merge of rust-lang#119138 - AngelicosPhosphoros:use_proper_ato…
…mics_in_spinlock_example, r=Nilstrieb Docs: Use non-SeqCst in module example of atomics I done this for this reasons: 1. The example now shows that there is more Orderings than just SeqCst. 2. People who would copy from example would now have more suitable orderings for the job. 3. SeqCst is both much harder to reason about and not needed in most situations. IMHO, we should encourage people to think and use memory orderings that is suitable to task instead of blindly defaulting to SeqCst. r? `@m-ou-se`
Configuration menu - View commit details
-
Copy full SHA for f9076bb - Browse repository at this point
Copy the full SHA f9076bbView commit details -
Rollup merge of rust-lang#119907 - asquared31415:fn_trait_docs, r=Nil…
…strieb Update `fn()` trait implementation docs Fixes rust-lang#119903 This was FCP'd and approved for the 1.70.0 release, this is just a docs update to match that change.
Configuration menu - View commit details
-
Copy full SHA for 48ba721 - Browse repository at this point
Copy the full SHA 48ba721View commit details -
Rollup merge of rust-lang#120083 - Zalathar:no-profiler, r=wesleywiser
Warn when not having a profiler runtime means that coverage tests won't be run/blessed On a few occasions (e.g. rust-lang#118036, rust-lang#119984) people have been tripped up by the fact that half of the coverage test suite is skipped by default, because it `// needs-profiler-support` and the profiler runtime is not actually built in any of the default config profiles. (This is made worse by the fact that it isn't enabled in any of the PR CI jobs either. So people think that they've successfully blessed the test suite, and then get a rude surprise when their merge only fails in the full CI job suite.) This PR adds a simple warning to compiletest that should alert the user in some cases. It's not foolproof, but it should increase the chances of catching this problem earlier in the PR process.
Configuration menu - View commit details
-
Copy full SHA for 987445c - Browse repository at this point
Copy the full SHA 987445cView commit details -
Rollup merge of rust-lang#120107 - shepmaster:dead-code-repr-transpar…
…ent, r=Nilstrieb dead_code treats #[repr(transparent)] the same as #[repr(C)] In rust-lang#92972 we enabled linting on unused fields in tuple structs. In rust-lang#118297 that lint was enabled by default. That exposed issues like rust-lang#119659, where the fields of a struct marked `#[repr(transparent)]` were reported by the `dead_code` lint. The language team [decided](rust-lang#119659 (comment)) that the lint should treat `repr(transparent)` the same as `#[repr(C)]`. Fixes rust-lang#119659
Configuration menu - View commit details
-
Copy full SHA for 332f8f7 - Browse repository at this point
Copy the full SHA 332f8f7View commit details -
Rollup merge of rust-lang#120110 - invpt:patch-1, r=the8472
Update documentation for Vec::into_boxed_slice to be more clear about excess capacity Currently, the documentation for Vec::into_boxed_slice says that "if the vector has excess capacity, its items will be moved into a newly-allocated buffer with exactly the right capacity." This is misleading, as copies do not necessarily occur, depending on if the allocator supports in-place shrinking. I copied some of the wording from shrink_to_fit, though it could potentially still be worded better than this.
Configuration menu - View commit details
-
Copy full SHA for 7219bd2 - Browse repository at this point
Copy the full SHA 7219bd2View commit details -
Rollup merge of rust-lang#120113 - WaffleLapkin:🔥-1, r=compiler-errors
Remove myself from review rotation r? `@wesleywiser`
Configuration menu - View commit details
-
Copy full SHA for e35dfed - Browse repository at this point
Copy the full SHA e35dfedView commit details -
Rollup merge of rust-lang#120118 - kapilsinha:patch-1, r=Nilstrieb
Fix typo in documentation in base.rs
Configuration menu - View commit details
-
Copy full SHA for b4616f5 - Browse repository at this point
Copy the full SHA b4616f5View commit details