doc(std): clarify `NonZero<T>` usage limitation in doc comment
Closesrust-lang/rust#142966
This PR clarifies `NonZero<T>` usage limitation in doc comment and fixes a typo.
r? libs
Only work-steal in the main loop for rustc_thread_pool
This PR is a replica of <https://github.com/rust-lang/rustc-rayon/pull/12> that only retained work-steal in the main loop for rustc_thread_pool.
r? `@oli-obk`
cc `@SparrowLii` `@Zoxc` `@cuviper`
Updates rust-lang/rust#113349
The feature currently completely breaks `x test`, core functionality of working on the standard library.
Therefore it should be disabled by default until that problem is fixed.
Having to wait a bit longer for a check build is nothing compared to completely mysterious build errors when testing.
When a trait bound fails due to the Self type parameter, adjust_fulfillment_errors
now correctly points to the corresponding function argument instead of incorrectly
pointing to other arguments.
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
There is one comment at a call site and one comment in the function
definition that are mostly saying the same thing. Fold the call site
comment into the function definition comment to reduce duplication.
There are actually some inaccuracies in the comments but let's
deduplicate before we address the inaccuracies.
compiler: rename BareFn to FnPtr
At some point "BareFn" was the chosen name for a "bare" function, without the niceties of `~fn`, `&fn`, or a few other ways of writing a function type. However, at some point the syntax for a "bare function" and any other function diverged even more. We started calling them what they are: function pointers, denoted by their own syntax.
However, we never changed the *internal* name for these, as this divergence was very gradual. Personally, I have repeatedly searched for "FnPtr" and gotten confused until I find the name is BareFn, only to forget this until the next time, since I don't routinely interact with the higher-level AST and HIR. But even tools that interact with these internal types only touch on them in a few places, making a migration easy enough. Let's use a more intuitive and obvious name, as this 12+ year old name has little to do with current Rust.
lib: more eagerly return `self.len()` from `ceil_char_boundary`
There is no reason to go through the complicated branch as it would
always return `self.len()` in this case. Also helps debug code somewhat
and I guess might make optimizations easier (although I haven't really a
sample to demonstrate this.)
ref. https://github.com/rust-lang/rust/issues/93743
Suggested by `@chrisduerr`
compiler: rename BareFn to FnPtr
At some point "BareFn" was the chosen name for a "bare" function, without the niceties of `~fn`, `&fn`, or a few other ways of writing a function type. However, at some point the syntax for a "bare function" and any other function diverged even more. We started calling them what they are: function pointers, denoted by their own syntax.
However, we never changed the *internal* name for these, as this divergence was very gradual. Personally, I have repeatedly searched for "FnPtr" and gotten confused until I find the name is BareFn, only to forget this until the next time, since I don't routinely interact with the higher-level AST and HIR. But even tools that interact with these internal types only touch on them in a few places, making a migration easy enough. Let's use a more intuitive and obvious name, as this 12+ year old name has little to do with current Rust.
Renamed retain_mut to retain on LinkedList as mentioned in the ACP
This is for proposal: https://github.com/rust-lang/libs-team/issues/250
The original check-in (https://github.com/rust-lang/rust/pull/114136) contained both methods **retain** and **retain_mut**, which does not conform to https://github.com/rust-lang/libs-team/issues/250#issuecomment-1766822671.
I updated the retain documentation to specify **&mut e**, removed the **retain** method and renamed **retain_mut** to **retain** to conform to the request.
The pull request doesn't really contain much that is new, just removes the unwanted method to meet the requirements.
I've run the tests "library/alloc" on the code and no issues.
Hopefully I'm not stepping on the original author's toes. I just ran across a need for the method and wondered why it was unstable.
mbe: Change `unused_macro_rules` to a `DenseBitSet`
Now that it only contains indexes, and no other information, a bitset provides a more compact and simpler representation.
This builds on <https://github.com/rust-lang/rust/pull/143416>. Only the last commit is new.
Align attr fixes
- Remove references to the superseded `repr(align)` syntax
- Allow the attribute on fn items in `extern` blocks
- Test attribute in combination with `async fn` and `dyn`
r? workingjubilee
Tracking issue: https://github.com/rust-lang/rust/issues/82232
`@rustbot` label A-attributes F-fn_align T-compiler
There is no reason to go through the complicated branch as it would
always return `self.len()` in this case. Also helps debug code somewhat
and I guess might make optimizations easier (although I haven't really a
sample to demonstrate this.)
ref. #93743
Suggested by @chrisduerr