-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 12 pull requests #52791
Rollup of 12 pull requests #52791
Conversation
Some platforms don't actually have `libm` already linked in the test infrastructure, and then `dynamic_lib::tests::test_loading_cosine` would fail to find the "cos" symbol. Every platform running this test should have `libc` and "atoi" though, so try to use that symbol instead. Fixes rust-lang#45410.
Previously, using unknown as the vendor value would lead to the same result, but with the multiarch runtimes support in Clang, the target is now used to locate the runtime libraries and so the format is important. The denormalized format with omitted vendor component is the format we use with Clang and should be using for Rust as well.
…matsakis Do a basic sanity check for all constant values ## Motivation and high level overview There has been some back and forth in this PR between @RalfJung and me in here about the motivation for this change and the stance it takes on unsafe coding guidelines. The initial implementation ran its checks on every value read (so `*x`, `y = x`, ...). In unsafe code that isn't reasonable, because we might be invalidating invariants for a short time in order to build up a proper value. The current implementation is a lint that runs its checks statics and constants. There is no need to check array lengths and enum variants, because it's a hard error to end up with anything but a number, and that one even has to have the required bits to be defined. ## What checks are done? * Some type related checks * `char` needs to be a correct unicode character as defined by `char::from_u32` * A reference to a ZST must have the correct alignment (and be nonzero) * A reference to anything is dereferenced and its value is checked * Layout checks use the information from `ty::Layout` to check * all fields of structs * all elements of arrays * enum discriminants * the fields of an enum variant (the variant is decided by the discriminant) * whether any union field succeeds in being checked (if none match the memory pattern, the check fails) * if the value is in the range described by the layout (e.g. for `NonZero*` types) Changing the layout of a type will thus automatically cause the checks to check for the new layout. fixes rust-lang#51330 fixes rust-lang#51471 cc @RalfJung r? @eddyb
Suggest fix when encountering different mutability from impl to trait Closes rust-lang#52412 r? @estebank
…hton Minor improvements to bootstrap - prefer `Path`-specific methods to `String` ones - don't add file extensions if they are removed right afterwards
make memrchr use align_offset I hope I did not screw that up... Cc @oli-obk who authored the original rust-lang#44537
… r=GuillaumeGomez rustdoc: rework how default passes are chosen This is a refactor that changes how we select default passes, and changes the set of passes used for `--document-private-items`. It's groundwork for a bigger refactor i want to do. The major changes: * There are now two sets of "default passes": one set for "no flags given" and one for "document private items". * These sets can be selected by a new `DefaultPassOption` enum, which is selected from based on the presence of `--no-defaults` or `--document-private-items` CLI flags, or their associated crate attributes. * When printing the list of passes, we also print the list of passes for `--document-private-items` in addition to the "default defaults". * I added `propagate-doc-cfg` and `strip-priv-imports` to the "document private items" set. The former is to ensure items are properly tagged with the full set of cfg flags even when "document private items" is active. The latter is based on feedback and personal experience navigating the `rustc` docs, which use that flag. `strip-priv-imports` only removes non-pub `use` statements, so it should be harmless from a documentation standpoint to remove those items from "private items" documentation.
…dle, r=TimNN Impl Send & Sync for JoinHandle This is just a cosmetic change - it slightly relaxes and clarifies the public API without effectively promising any new guarantees. Currently we have [these auto trait implementations](https://doc.rust-lang.org/nightly/std/thread/struct.JoinHandle.html#synthetic-implementations): ```rust impl<T: Send> Send for JoinHandle<T> {} impl<T: Sync> Sync for JoinHandle<T> {} ``` Bound `T: Send` doesn't make much sense because `JoinHandle<T>` can be created only when `T: Send`. Note that [`JoinHandle::<T>::join`](https://doc.rust-lang.org/nightly/std/thread/struct.JoinHandle.html#method.join) doesn't require `T: Send` so why should the `Send` impl? And the `Sync` impl doesn't need `T: Sync` because `JoinHandle<T>` cannot even share `T` - it can only send it to the thread that calls `join`.
…ichton rustc_metadata: test loading atoi instead of cos Some platforms don't actually have `libm` already linked in the test infrastructure, and then `dynamic_lib::tests::test_loading_cosine` would fail to find the "cos" symbol. Every platform running this test should have `libc` and "atoi" though, so try to use that symbol instead. Fixes rust-lang#45410.
…chton Omit the vendor component in Fuchsia triple Previously, using unknown as the vendor value would lead to the same result, but with the multiarch runtimes support in Clang, the target is now used to locate the runtime libraries and so the format is important. The denormalized format with omitted vendor component is the format we use with Clang and should be using for Rust as well.
…r=pnkfelix Remove unused "-Zenable_nonzeroing_move_hints" flag Removing a dead option which seems to be a remnant of the old drop-flag system.
Incorporate a stray test `liballoc/repeat-generic-slice.rs` doesn't seem to be tested (I think it was intended to be placed in `run-pass`). This PR incorporates the test into `liballoc/tests`.
Fix doc comment for 'ptr::copy_to' method Fix error in doc comment for `ptr::copy_to` method.
revert accidental atty downgrade This got accidentally downgraded by rust-lang#52488 Cc @nikomatsakis @pnkfelix
@bors r+ p=1 |
📌 Commit 14d03a2 has been approved by |
⌛ Testing commit 14d03a2 with merge 55f99e097ce6cf887ca9153bf76069c09619f1f0... |
💔 Test failed - status-travis |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Successful merges:
Failed merges:
r? @ghost