-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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 5 pull requests #63671
Rollup of 5 pull requests #63671
Commits on Aug 16, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 56ebd57 - Browse repository at this point
Copy the full SHA 56ebd57View commit details -
Configuration menu - View commit details
-
Copy full SHA for b7b4c3a - Browse repository at this point
Copy the full SHA b7b4c3aView commit details -
Configuration menu - View commit details
-
Copy full SHA for b21ee49 - Browse repository at this point
Copy the full SHA b21ee49View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1613fda - Browse repository at this point
Copy the full SHA 1613fdaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b02b9f - Browse repository at this point
Copy the full SHA 7b02b9fView commit details -
Configuration menu - View commit details
-
Copy full SHA for bde1924 - Browse repository at this point
Copy the full SHA bde1924View commit details -
Configuration menu - View commit details
-
Copy full SHA for 170d933 - Browse repository at this point
Copy the full SHA 170d933View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4eeb623 - Browse repository at this point
Copy the full SHA 4eeb623View commit details -
Configuration menu - View commit details
-
Copy full SHA for dab967a - Browse repository at this point
Copy the full SHA dab967aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1141136 - Browse repository at this point
Copy the full SHA 1141136View commit details -
Configuration menu - View commit details
-
Copy full SHA for 78264f5 - Browse repository at this point
Copy the full SHA 78264f5View commit details -
Configuration menu - View commit details
-
Copy full SHA for ae1e201 - Browse repository at this point
Copy the full SHA ae1e201View commit details -
Configuration menu - View commit details
-
Copy full SHA for 810dfd7 - Browse repository at this point
Copy the full SHA 810dfd7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a641f7 - Browse repository at this point
Copy the full SHA 7a641f7View commit details
Commits on Aug 17, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 5f7716d - Browse repository at this point
Copy the full SHA 5f7716dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 25d8a0a - Browse repository at this point
Copy the full SHA 25d8a0aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d242b3 - Browse repository at this point
Copy the full SHA 0d242b3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ab1d5c - Browse repository at this point
Copy the full SHA 9ab1d5cView commit details -
Configuration menu - View commit details
-
Copy full SHA for a9efa73 - Browse repository at this point
Copy the full SHA a9efa73View commit details -
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 4821663 - Browse repository at this point
Copy the full SHA 4821663View commit details -
Configuration menu - View commit details
-
Copy full SHA for 689c210 - Browse repository at this point
Copy the full SHA 689c210View commit details -
Configuration menu - View commit details
-
Copy full SHA for f19087d - Browse repository at this point
Copy the full SHA f19087dView commit details -
Configuration menu - View commit details
-
Copy full SHA for ba03283 - Browse repository at this point
Copy the full SHA ba03283View commit details -
Configuration menu - View commit details
-
Copy full SHA for 72d9fe8 - Browse repository at this point
Copy the full SHA 72d9fe8View commit details -
Configuration menu - View commit details
-
Copy full SHA for b79ce1b - Browse repository at this point
Copy the full SHA b79ce1bView commit details -
Configuration menu - View commit details
-
Copy full SHA for d479ff2 - Browse repository at this point
Copy the full SHA d479ff2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1064d41 - Browse repository at this point
Copy the full SHA 1064d41View commit details -
Configuration menu - View commit details
-
Copy full SHA for a7c34f1 - Browse repository at this point
Copy the full SHA a7c34f1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9bd7083 - Browse repository at this point
Copy the full SHA 9bd7083View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3288be5 - Browse repository at this point
Copy the full SHA 3288be5View commit details -
Rollup merge of rust-lang#62451 - SimonSapin:new_uninit, r=RalfJung
Add APIs for uninitialized Box, Rc, and Arc. (Plus get_mut_unchecked) Assigning `MaybeUninit::<Foo>::uninit()` to a local variable is usually free, even when `size_of::<Foo>()` is large. However, passing it for example to `Arc::new` [causes at least one copy](https://youtu.be/F1AquroPfcI?t=4116) (from the stack to the newly allocated heap memory) even though there is no meaningful data. It is theoretically possible that a Sufficiently Advanced Compiler could optimize this copy away, but this is [reportedly unlikely to happen soon in LLVM](https://youtu.be/F1AquroPfcI?t=5431). This PR proposes two sets of features: * Constructors for containers (`Box`, `Rc`, `Arc`) of `MaybeUninit<T>` or `[MaybeUninit<T>]` that do not initialized the data, and unsafe conversions to the known-initialized types (without `MaybeUninit`). The constructors are guaranteed not to make unnecessary copies. * On `Rc` and `Arc`, an unsafe `get_mut_unchecked` method that provides `&mut T` access without checking the reference count. `Arc::get_mut` involves multiple atomic operations whose cost can be non-trivial. `Rc::get_mut` is less costly, but we add `Rc::get_mut_unchecked` anyway for symmetry with `Arc`. These can be useful independently, but they will presumably be typical when the new constructors of `Rc` and `Arc` are used. An alternative with a safe API would be to introduce `UniqueRc` and `UniqueArc` types that have the same memory layout as `Rc` and `Arc` (and so zero-cost conversion to them) but are guaranteed to have only one reference. But introducing entire new types feels “heavier” than new constructors on existing types, and initialization of `MaybeUninit<T>` typically requires unsafe code anyway. Summary of new APIs (all unstable in this PR): ```rust impl<T> Box<T> { pub fn new_uninit() -> Box<MaybeUninit<T>> {…} } impl<T> Box<MaybeUninit<T>> { pub unsafe fn assume_init(self) -> Box<T> {…} } impl<T> Box<[T]> { pub fn new_uninit_slice(len: usize) -> Box<[MaybeUninit<T>]> {…} } impl<T> Box<[MaybeUninit<T>]> { pub unsafe fn assume_init(self) -> Box<[T]> {…} } impl<T> Rc<T> { pub fn new_uninit() -> Rc<MaybeUninit<T>> {…} } impl<T> Rc<MaybeUninit<T>> { pub unsafe fn assume_init(self) -> Rc<T> {…} } impl<T> Rc<[T]> { pub fn new_uninit_slice(len: usize) -> Rc<[MaybeUninit<T>]> {…} } impl<T> Rc<[MaybeUninit<T>]> { pub unsafe fn assume_init(self) -> Rc<[T]> {…} } impl<T> Arc<T> { pub fn new_uninit() -> Arc<MaybeUninit<T>> {…} } impl<T> Arc<MaybeUninit<T>> { pub unsafe fn assume_init(self) -> Arc<T> {…} } impl<T> Arc<[T]> { pub fn new_uninit_slice(len: usize) -> Arc<[MaybeUninit<T>]> {…} } impl<T> Arc<[MaybeUninit<T>]> { pub unsafe fn assume_init(self) -> Arc<[T]> {…} } impl<T: ?Sized> Rc<T> { pub unsafe fn get_mut_unchecked(this: &mut Self) -> &mut T {…} } impl<T: ?Sized> Arc<T> { pub unsafe fn get_mut_unchecked(this: &mut Self) -> &mut T {…} } ```
Configuration menu - View commit details
-
Copy full SHA for a3b6e8e - Browse repository at this point
Copy the full SHA a3b6e8eView commit details -
Rollup merge of rust-lang#63487 - sd234678:remove-meaningless-comment…
…s-in-src/test-2, r=Centril Remove meaningless comments in src/test Moved from rust-lang#63411
Configuration menu - View commit details
-
Copy full SHA for a396434 - Browse repository at this point
Copy the full SHA a396434View commit details -
Rollup merge of rust-lang#63657 - RalfJung:invalid_value, r=Centril
Crank up invalid value lint * Warn against uninit `bool` and `char`. * Warn against 0-init `NonNull` and friends * Detect transmute-from-0 as zero-initialization ([seen in the wild](glium/glium#1775 (comment)))
Configuration menu - View commit details
-
Copy full SHA for a00b4f1 - Browse repository at this point
Copy the full SHA a00b4f1View commit details -
Rollup merge of rust-lang#63667 - petrochenkov:deriveholders, r=matth…
…ewjasper resolve: Properly integrate derives and `macro_rules` scopes So, ```rust #[derive(A, B)] struct S; m!(); ``` turns into something like ```rust struct S; A_placeholder!( struct S; ); B_placeholder!( struct S; ); m!(); ``` during expansion. And for `m!()` its "`macro_rules` scope" (aka "legacy scope") should point to the `B_placeholder` call rather than to the derive container `#[derive(A, B)]`. `fn build_reduced_graph` now makes sure the legacy scope points to the right thing. (It's still a mystery for me why this worked before rust-lang#63535.) Unfortunately, placeholders from derives are currently treated separately from placeholders from other macros and need to be passed as `extra_placeholders` rather than a part of the AST fragment. That's fixable, but I wanted to keep this PR more minimal to close the regression faster. Fixes rust-lang#63651 r? @matthewjasper
Configuration menu - View commit details
-
Copy full SHA for b60f245 - Browse repository at this point
Copy the full SHA b60f245View commit details -
Rollup merge of rust-lang#63669 - Dante-Broggi:patch-1, r=jonas-schie…
…vink fix typos in mir/interpret
Configuration menu - View commit details
-
Copy full SHA for 4ec9703 - Browse repository at this point
Copy the full SHA 4ec9703View commit details