-
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 7 pull requests #32794
Rollup of 7 pull requests #32794
Conversation
Where T is a type that can be compared for equality bytewise, we can use memcmp. We can also use memcmp for PartialOrd, Ord for [u8] and by extension &str. This is an improvement for example for the comparison [u8] == [u8] that used to emit a loop that compared the slices byte by byte. One worry here could be that this introduces function calls to memcmp in contexts where it should really inline the comparison or even optimize it out, but llvm takes care of recognizing memcmp specifically.
The old test for Ord used no asserts, and appeared to have a wrong test. (!).
The initial implementation of specialization did not use the `fast_reject` mechanism when checking for overlap, which caused a serious performance regression in some cases. This commit modifies the specialization graph to use simplified types for fast rejection when possible, and along the way refactors the logic for building the specialization graph. Closes rust-lang#32499
This should avoid the trait impls showing up in rustdoc.
…lity in `typeck` and in `privacy::PrivacyVisitor`.
@bors r+ |
📌 Commit 2aa3338 has been approved by |
r? @nrc (rust_highfive has picked a reviewer for you, use r? to override) |
@bors r+ p=10 |
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit 2aa3338 has been approved by |
⌛ Testing commit 2aa3338 with merge 4c20e53... |
💔 Test failed - auto-linux-musl-64-opt |
…tsakis Lay groundwork for RFC 1422 and improve `PrivateItemsInPublicInterfacesVisitor` This PR lays groundwork for RFC 1422 (cc rust-lang#32409) and improves `PrivateItemsInPublicInterfacesVisitor`. More specifically, it - Refactors away `hir::Visibility::inherit_from`, the semantics of which are obsolete. - Makes `hir::Visibility` non-`Copy` so that we will be able to add new variants to represent `pub(restricted)` (for example, `Visibility::Restricted(Path)`). - Adds a new `Copy` type `ty::Visibility` that represents a visibility value, i.e. a characterization of where an item is accessible. This is able to represent `pub(restricted)` visibilities. - Improves `PrivateItemsInPublicInterfacesVisitor` so that it checks for items in an interface that are less visible than the interface. This fixes rust-lang#30079 but doesn't change any other behavior. r? @nikomatsakis
Specialize equality for [T] and comparison for [u8] to use memcmp when possible Specialize equality for [T] and comparison for [u8] to use memcmp when possible Where T is a type that can be compared for equality bytewise, we can use memcmp. We can also use memcmp for PartialOrd, Ord for [u8]. Use specialization to call memcmp in PartialEq for slices for certain element types. This PR does not change the user visible API since the implementation uses an intermediate trait. See commit messages for more information. The memcmp signature was changed from `*const i8` to `*const u8` which is in line with how the memcmp function is defined in C (taking const void * arguments, interpreting the values as unsigned bytes for purposes of the comparison).
Fix infinite loop in Arc::downgrade
Reinstate fast_reject for overlap checking The initial implementation of specialization did not use the `fast_reject` mechanism when checking for overlap, which caused a serious performance regression in some cases. This commit modifies the specialization graph to use simplified types for fast rejection when possible, and along the way refactors the logic for building the specialization graph. Closes rust-lang#32499 r? @nikomatsakis
Fix typos in atomic compare_exchange. Failure ordering can't be Release, not (not) Acquire. Seems like a typo copy-pasted all over.
…ors, r=eddyb resolve: Avoid emitting redundant path resolution errors This PR avoids emitting redundant path resolution errors in `resolve` (fixes rust-lang#32760). r? @eddyb
@bors r+ force |
📌 Commit b0f81a3 has been approved by |
PrivateItemsInPublicInterfacesVisitor
#32674, Specialize equality for [T] and comparison for [u8] to use memcmp when possible #32699, Fix the span for try shorthand expressions #32711, Fix infinite loop in Arc::downgrade #32745, Reinstate fast_reject for overlap checking #32748, Fix typos in atomic compare_exchange. #32757, resolve: Avoid emitting redundant path resolution errors #32789