-
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 19 pull requests #57503
Rollup of 19 pull requests #57503
Conversation
@bors r+ p=19 |
📌 Commit 7c590fe6699fa546f08ae8ed6d689403db11fd42 has been approved by |
⌛ Testing commit 7c590fe6699fa546f08ae8ed6d689403db11fd42 with merge 8d7aa49d2fc058a000d668024fe4fd65f81552fe... |
💔 Test failed - checks-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 |
Can't see any reason in any of the included PRs why this should time out, so... @bors retry |
⌛ Testing commit 7c590fe6699fa546f08ae8ed6d689403db11fd42 with merge 35f174f84f5f4fdb413c1cad5d4266593575647f... |
…nikomatsakis Stabilize `let` bindings and destructuring in constants and const fn r? @Centril This PR stabilizes the following features in constants and `const` functions: * irrefutable destructuring patterns (e.g. `const fn foo((x, y): (u8, u8)) { ... }`) * `let` bindings (e.g. `let x = 1;`) * mutable `let` bindings (e.g. `let mut x = 1;`) * assignment (e.g. `x = y`) and assignment operator (e.g. `x += y`) expressions, even where the assignment target is a projection (e.g. a struct field or index operation like `x[3] = 42`) * expression statements (e.g. `3;`) This PR does explicitly *not* stabilize: * mutable references (i.e. `&mut T`) * dereferencing mutable references * refutable patterns (e.g. `Some(x)`) * operations on `UnsafeCell` types (as that would need raw pointers and mutable references and such, not because it is explicitly forbidden. We can't explicitly forbid it as such values are OK as long as they aren't mutated.) * We are not stabilizing `let` bindings in constants that use `&&` and `||` short circuiting operations. These are treated as `&` and `|` inside `const` and `static` items right now. If we stopped treating them as `&` and `|` after stabilizing `let` bindings, we'd break code like `let mut x = false; false && { x = true; false };`. So to use `let` bindings in constants you need to change `&&` and `||` to `&` and `|` respectively.
…li-obk Const-stabilize `const_int_ops` + `const_ip` r? @oli-obk I've added T-lang since this affects intrinsics and the operational semantics of Rust's `const fn` fragment. This PR depends on rust-lang#57105 but the FCP intent does not. ## Stable APIs proposed for constification + `const_int_ops`: + `count_ones` + `count_zeros` + `leading_zeros` + `trailing_zeros` + `swap_bytes` + `from_be` + `from_le` + `to_be` + `to_le` + `const_ip` + `Ipv4Addr::new` ## Unstable APIs constified + `const_int_conversion`: + `reverse_bits`
Successful merges:
FieldPlacement::count
when count is too large #57042 (Don't callFieldPlacement::count
when count is too large)source
instead ofcause
#57192 (Change std::error::Error trait documentation to talk aboutsource
instead ofcause
)is_finite
(2x) andis_infinite
(1.6x). #57353 (Optimise floating pointis_finite
(2x) andis_infinite
(1.6x).)read-ownership
#57433 (Add link destination forread-ownership
)CrateNum::Invalid
. #57434 (RemoveCrateNum::Invalid
.)Failed merges:
r? @ghost