Rollup of 9 pull requests - #160047
Conversation
The current documentation doesn't guarantee that these methods are safe to call for pointers derived from references to new unsized types that Rust may add in the future. Co-authored-by: Crystal Durham <cad97@cad97.com>
Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
Removes the `pub use rustc_hir_id as hir_id` re-export in `rustc_hir`. This was rarely used and bloated import suggestions a lot.
…r=fee1-dead,ShoyuVanilla Lint against iterator functions that panic when `N` is zero This PR extends the deny-by-default `unconditional_panic` lint, by linting on iterator functions that panics when `N` (chunks/windows size) is zero[^attr]. Those methods are [documented](https://doc.rust-lang.org/std/primitive.slice.html#panics-11) to panic if `N` is zero. ``` error: this operation will panic at runtime --> $DIR/const-n-is-zero.rs:11:13 | LL | let _ = s.array_windows::<0>(); | ^^^^^^^^^^^^^^^^^^^^^^ const parameter `N` is zero | = note: `#[deny(unconditional_panic)]` on by default ``` cc @rust-lang/libs-api [^attr]: this is done by introducing a new internal attribute on the const parameter: `#[rustc_panics_when_zero]`
…t, r=mejrs Allow `UnsafeCell` content access without `get` in `invalid_reference_casting` lint rust-lang#159730 relaxed the rules so that it's no longer necessary to use `UnsafeCell::raw_get` or `UnsafeCell::get` to access the content of an unsafe cell. As a consequence this means that code this like is no longer invalid: ```rust use std::cell::UnsafeCell; unsafe fn get_mut_unchecked<T>(ptr: &UnsafeCell<T>) -> &mut T { let t = ptr as *const UnsafeCell<T> as *mut T; unsafe { &mut *t } } ``` Fixes rust-lang#159915 cc @RalfJung
…r=JohnTitor Clarify preconditions of raw size/align methods The current documentation doesn't guarantee that these methods are safe to call for pointers derived from references to new unsized types that Rust may add in the future. Take 2 of rust-lang#103372, wording from @CAD97 in rust-lang#103372 (comment). Tracking issue: rust-lang#69835
Don't optimize across storage markers in SimplifyComparisonIntegral This PR rejects `SimplifyComparisonIntegral` candidates when either `StorageLive` or `StorageDead` for the compared local occurs between the comparison and the terminator. Since those candidates are rejected, the pass no longer relocates `StorageDead` into switch successors. This conservatively leaves one comparison in `issue_59352` unoptimized, so its MIR snapshots are updated. Resolves rust-lang#158231. r? @hanna-kruppe
…8, r=zedddie,Kivooeo Move tests batch 18 Hi, a few more tests. Part of rust-lang#133895 r? @Kivooeo
…ne, r=chenyukang Add codegen test for enum clone Closes rust-lang#69174
Make BorrowSet methods public again BorrowSet's methods were made private in rust-lang#159449 except for a couple used by Aquascope. I'd like to make these methods public again for Creusot, which indeed makes more extensive use of BorrowSet. Technically only `locals_state_at_exit` exposes information that is not already available in the current API (and Creusot does make use of it to call `Place::ignore_borrow`). The other fields can be reconstructed via `iter`, but it seems unnecessary to restrict the efficient access provided by the other methods to rustc's own analyses as opposed to third-party consumers.
Refactor rustc_hir re-exports Probably best reviewed commit by commit. I've been trying to split up rustc_hir and attributes.. This PR prepares for part of that, by cleaning up import paths and moving around some stuff. (See also rust-lang#159602 rust-lang#159659 and rust-lang#159893 for some previous work)
… r=clarfonthey Correct tracking issue for `casefold` feature To rust-lang#157000.
|
@bors r+ rollup=never p=100 |
This comment has been minimized.
This comment has been minimized.
|
@bors treeclosed- |
|
Tree is now open for merging. |
|
📌 Perf builds for each rolled up PR:
previous master: bf9944f0b8 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
|
A job failed! Check out the build log: (web) (plain enhanced) (plain) Click to see the possible cause of the failure (guessed by this bot) |
|
Finished benchmarking commit (e7b5955): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Our benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -3.4%, secondary 0.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -0.1%, secondary -1.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.2%, secondary 0.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 487.856s -> 490.22s (0.48%) |
Successful merges:
Nis zero #153563 (Lint against iterator functions that panic whenNis zero )UnsafeCellcontent access withoutgetininvalid_reference_castinglint #159960 (AllowUnsafeCellcontent access withoutgetininvalid_reference_castinglint)casefoldfeature #160041 (Correct tracking issue forcasefoldfeature)r? @ghost
Create a similar rollup