Skip to content

Commit 6cd33d8

Browse files
committed
Auto merge of rust-lang#134901 - matthiaskrgr:rollup-b0wwuht, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - rust-lang#134870 (Fix sentence fragment in `pin` module docs) - rust-lang#134884 (Fix typos) - rust-lang#134892 (Added codegen test for elidings bounds check when indexes are manually checked) - rust-lang#134894 (Document how to run the split Docker pipelines) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 14ee63a + e178795 commit 6cd33d8

File tree

7 files changed

+48
-5
lines changed

7 files changed

+48
-5
lines changed

compiler/rustc_parse/src/parser/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ impl<'a> Parser<'a> {
755755
// When there are a few keywords in the last ten elements of `self.expected_token_types`
756756
// and the current token is an identifier, it's probably a misspelled keyword. This handles
757757
// code like `async Move {}`, misspelled `if` in match guard, misspelled `else` in
758-
// `if`-`else` and mispelled `where` in a where clause.
758+
// `if`-`else` and misspelled `where` in a where clause.
759759
if !expected_keywords.is_empty()
760760
&& !curr_ident.is_used_keyword()
761761
&& let Some(misspelled_kw) = find_similar_kw(curr_ident, &expected_keywords)

library/alloc/src/raw_vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ impl<A: Allocator> RawVecInner<A> {
420420
match Self::try_allocate_in(capacity, AllocInit::Uninitialized, alloc, elem_layout) {
421421
Ok(this) => {
422422
unsafe {
423-
// Make it more obvious that a subsquent Vec::reserve(capacity) will not allocate.
423+
// Make it more obvious that a subsequent Vec::reserve(capacity) will not allocate.
424424
hint::assert_unchecked(!this.needs_to_grow(0, capacity, elem_layout));
425425
}
426426
this

library/core/src/pin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@
595595
//! [drop-impl]: self#implementing-drop-for-types-with-address-sensitive-states
596596
//!
597597
//! The [`drop`] function takes [`&mut self`], but this is called *even if that `self` has been
598-
//! pinned*! Implementing [`Drop`] for a type with address-sensitive states, because if `self` was
598+
//! pinned*! Implementing [`Drop`] for a type with address-sensitive states requires some care, because if `self` was
599599
//! indeed in an address-sensitive state before [`drop`] was called, it is as if the compiler
600600
//! automatically called [`Pin::get_unchecked_mut`].
601601
//!

library/std/src/thread/current.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ pub(crate) fn set_current(thread: Thread) -> Result<(), Thread> {
136136
/// one thread and is guaranteed not to call the global allocator.
137137
#[inline]
138138
pub(crate) fn current_id() -> ThreadId {
139-
// If accessing the persistant thread ID takes multiple TLS accesses, try
139+
// If accessing the persistent thread ID takes multiple TLS accesses, try
140140
// to retrieve it from the current thread handle, which will only take one
141141
// TLS access.
142142
if !id::CHEAP {

src/ci/docker/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ DEPLOY=1 ./src/ci/docker/run.sh x86_64-gnu
2626
while locally, to the `obj/$image_name` directory. This is primarily to prevent
2727
strange linker errors when using multiple Docker images.
2828

29+
For some Linux workflows (for example `x86_64-gnu-llvm-18-N`), the process is more involved. You will need to see which script is executed for the given workflow inside the [`jobs.yml`](../github-actions/jobs.yml) file and pass it through the `DOCKER_SCRIPT` environment variable. For example, to reproduce the `x86_64-gnu-llvm-18-3` workflow, you can run the following script:
30+
31+
```
32+
DOCKER_SCRIPT=x86_64-gnu-llvm3.sh ./src/ci/docker/run.sh x86_64-gnu-llvm-18
33+
```
34+
2935
## Local Development
3036

3137
Refer to the [dev guide](https://rustc-dev-guide.rust-lang.org/tests/docker.html) for more information on testing locally.

src/doc/rustc/src/platform-support/android.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ Currently the `riscv64-linux-android` target requires the following architecture
6565
### aarch64-linux-android on Nightly compilers
6666

6767
As soon as `-Zfixed-x18` compiler flag is supplied, the [`ShadowCallStack` sanitizer](https://releases.llvm.org/7.0.1/tools/clang/docs/ShadowCallStack.html)
68-
instrumentation is also made avaiable by supplying the second compiler flag `-Zsanitizer=shadow-call-stack`.
68+
instrumentation is also made available by supplying the second compiler flag `-Zsanitizer=shadow-call-stack`.

tests/codegen/slice-indexing.rs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,40 @@ pub unsafe fn str_get_unchecked_mut_by_range(x: &mut str, r: Range<usize>) -> &m
6060
// CHECK: sub nuw i64
6161
x.get_unchecked_mut(r)
6262
}
63+
64+
// CHECK-LABEL: @slice_repeated_indexing(
65+
#[no_mangle]
66+
pub fn slice_repeated_indexing(dst: &mut [u8], offset: usize) {
67+
let mut i = offset;
68+
// CHECK: panic_bounds_check
69+
dst[i] = 1;
70+
i += 1;
71+
// CHECK: panic_bounds_check
72+
dst[i] = 2;
73+
i += 1;
74+
// CHECK: panic_bounds_check
75+
dst[i] = 3;
76+
i += 1;
77+
// CHECK: panic_bounds_check
78+
dst[i] = 4;
79+
}
80+
81+
// CHECK-LABEL: @slice_repeated_indexing_coalesced(
82+
#[no_mangle]
83+
pub fn slice_repeated_indexing_coalesced(dst: &mut [u8], offset: usize) {
84+
let mut i = offset;
85+
if i.checked_add(4).unwrap() <= dst.len() {
86+
// CHECK-NOT: panic_bounds_check
87+
dst[i] = 1;
88+
i += 1;
89+
// CHECK-NOT: panic_bounds_check
90+
dst[i] = 2;
91+
i += 1;
92+
// CHECK-NOT: panic_bounds_check
93+
dst[i] = 3;
94+
i += 1;
95+
// CHECK-NOT: panic_bounds_check
96+
dst[i] = 4;
97+
}
98+
// CHECK: ret
99+
}

0 commit comments

Comments
 (0)