Skip to content

Commit 7a96158

Browse files
committedApr 28, 2023
Auto merge of rust-lang#110967 - matthiaskrgr:rollup-vfbl7gm, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#110877 (Provide better type hints when a type doesn't support a binary operator) - rust-lang#110917 (only error combining +whole-archive and +bundle for rlibs) - rust-lang#110921 (Use `NonNull::new_unchecked` and `NonNull::len` in `rustc_arena`.) - rust-lang#110927 (Encoder/decoder cleanups) - rust-lang#110944 (share BinOp::Offset between CTFE and Miri) - rust-lang#110948 (run-make test: using single quotes to not trigger the shell) - rust-lang#110957 (Fix an ICE in conflict error diagnostics) - rust-lang#110960 (fix false negative for `unused_mut`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents f495605 + 34ef13b commit 7a96158

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+449
-342
lines changed
 

‎compiler/rustc_arena/src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl<T> ArenaChunk<T> {
7474
#[inline]
7575
unsafe fn new(capacity: usize) -> ArenaChunk<T> {
7676
ArenaChunk {
77-
storage: NonNull::new(Box::into_raw(Box::new_uninit_slice(capacity))).unwrap(),
77+
storage: NonNull::new_unchecked(Box::into_raw(Box::new_uninit_slice(capacity))),
7878
entries: 0,
7979
}
8080
}
@@ -85,7 +85,7 @@ impl<T> ArenaChunk<T> {
8585
// The branch on needs_drop() is an -O1 performance optimization.
8686
// Without the branch, dropping TypedArena<u8> takes linear time.
8787
if mem::needs_drop::<T>() {
88-
let slice = &mut *(self.storage.as_mut());
88+
let slice = self.storage.as_mut();
8989
ptr::drop_in_place(MaybeUninit::slice_assume_init_mut(&mut slice[..len]));
9090
}
9191
}
@@ -104,7 +104,7 @@ impl<T> ArenaChunk<T> {
104104
// A pointer as large as possible for zero-sized elements.
105105
ptr::invalid_mut(!0)
106106
} else {
107-
self.start().add((*self.storage.as_ptr()).len())
107+
self.start().add(self.storage.len())
108108
}
109109
}
110110
}
@@ -288,7 +288,7 @@ impl<T> TypedArena<T> {
288288
// If the previous chunk's len is less than HUGE_PAGE
289289
// bytes, then this chunk will be least double the previous
290290
// chunk's size.
291-
new_cap = (*last_chunk.storage.as_ptr()).len().min(HUGE_PAGE / elem_size / 2);
291+
new_cap = last_chunk.storage.len().min(HUGE_PAGE / elem_size / 2);
292292
new_cap *= 2;
293293
} else {
294294
new_cap = PAGE / elem_size;
@@ -396,7 +396,7 @@ impl DroplessArena {
396396
// If the previous chunk's len is less than HUGE_PAGE
397397
// bytes, then this chunk will be least double the previous
398398
// chunk's size.
399-
new_cap = (*last_chunk.storage.as_ptr()).len().min(HUGE_PAGE / 2);
399+
new_cap = last_chunk.storage.len().min(HUGE_PAGE / 2);
400400
new_cap *= 2;
401401
} else {
402402
new_cap = PAGE;

‎compiler/rustc_ast_pretty/src/pp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ impl Printer {
360360

361361
fn check_stack(&mut self, mut depth: usize) {
362362
while let Some(&index) = self.scan_stack.back() {
363-
let mut entry = &mut self.buf[index];
363+
let entry = &mut self.buf[index];
364364
match entry.token {
365365
Token::Begin(_) => {
366366
if depth == 0 {

0 commit comments

Comments
 (0)
Please sign in to comment.