about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-12-29 23:16:13 +0000
committerbors <bors@rust-lang.org>2024-12-29 23:16:13 +0000
commit6cd33d889d0cd554e195d0eb9a38af88152b786f (patch)
tree6a6dd2bc5ea2f3d518fcc133cac873f6ef203ec3
parent14ee63a3c651bb7a243c8b07333749ab4b152e13 (diff)
parente178795dbae6bd0e11b24db250fb5dfb8b0211b0 (diff)
downloadrust-6cd33d889d0cd554e195d0eb9a38af88152b786f.tar.gz
rust-6cd33d889d0cd554e195d0eb9a38af88152b786f.zip
Auto merge of #134901 - matthiaskrgr:rollup-b0wwuht, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #134870 (Fix sentence fragment in `pin` module docs)
 - #134884 (Fix typos)
 - #134892 (Added codegen test for elidings bounds check when indexes are manually checked)
 - #134894 (Document how to run the split Docker pipelines)

r? `@ghost`
`@rustbot` modify labels: rollup
-rw-r--r--compiler/rustc_parse/src/parser/diagnostics.rs2
-rw-r--r--library/alloc/src/raw_vec.rs2
-rw-r--r--library/core/src/pin.rs2
-rw-r--r--library/std/src/thread/current.rs2
-rw-r--r--src/ci/docker/README.md6
-rw-r--r--src/doc/rustc/src/platform-support/android.md2
-rw-r--r--tests/codegen/slice-indexing.rs37
7 files changed, 48 insertions, 5 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs
index 7df7e732925..9ee6c2fae1a 100644
--- a/compiler/rustc_parse/src/parser/diagnostics.rs
+++ b/compiler/rustc_parse/src/parser/diagnostics.rs
@@ -755,7 +755,7 @@ impl<'a> Parser<'a> {
         // When there are a few keywords in the last ten elements of `self.expected_token_types`
         // and the current token is an identifier, it's probably a misspelled keyword. This handles
         // code like `async Move {}`, misspelled `if` in match guard, misspelled `else` in
-        // `if`-`else` and mispelled `where` in a where clause.
+        // `if`-`else` and misspelled `where` in a where clause.
         if !expected_keywords.is_empty()
             && !curr_ident.is_used_keyword()
             && let Some(misspelled_kw) = find_similar_kw(curr_ident, &expected_keywords)
diff --git a/library/alloc/src/raw_vec.rs b/library/alloc/src/raw_vec.rs
index 2c7cdcf0cfb..e93ff2f9023 100644
--- a/library/alloc/src/raw_vec.rs
+++ b/library/alloc/src/raw_vec.rs
@@ -420,7 +420,7 @@ impl<A: Allocator> RawVecInner<A> {
         match Self::try_allocate_in(capacity, AllocInit::Uninitialized, alloc, elem_layout) {
             Ok(this) => {
                 unsafe {
-                    // Make it more obvious that a subsquent Vec::reserve(capacity) will not allocate.
+                    // Make it more obvious that a subsequent Vec::reserve(capacity) will not allocate.
                     hint::assert_unchecked(!this.needs_to_grow(0, capacity, elem_layout));
                 }
                 this
diff --git a/library/core/src/pin.rs b/library/core/src/pin.rs
index f18a45083ff..83730285636 100644
--- a/library/core/src/pin.rs
+++ b/library/core/src/pin.rs
@@ -595,7 +595,7 @@
 //! [drop-impl]: self#implementing-drop-for-types-with-address-sensitive-states
 //!
 //! The [`drop`] function takes [`&mut self`], but this is called *even if that `self` has been
-//! pinned*! Implementing [`Drop`] for a type with address-sensitive states, because if `self` was
+//! pinned*! Implementing [`Drop`] for a type with address-sensitive states requires some care, because if `self` was
 //! indeed in an address-sensitive state before [`drop`] was called, it is as if the compiler
 //! automatically called [`Pin::get_unchecked_mut`].
 //!
diff --git a/library/std/src/thread/current.rs b/library/std/src/thread/current.rs
index 1048ef97356..3d2c288b360 100644
--- a/library/std/src/thread/current.rs
+++ b/library/std/src/thread/current.rs
@@ -136,7 +136,7 @@ pub(crate) fn set_current(thread: Thread) -> Result<(), Thread> {
 /// one thread and is guaranteed not to call the global allocator.
 #[inline]
 pub(crate) fn current_id() -> ThreadId {
-    // If accessing the persistant thread ID takes multiple TLS accesses, try
+    // If accessing the persistent thread ID takes multiple TLS accesses, try
     // to retrieve it from the current thread handle, which will only take one
     // TLS access.
     if !id::CHEAP {
diff --git a/src/ci/docker/README.md b/src/ci/docker/README.md
index 2f35e605026..508b7b40c01 100644
--- a/src/ci/docker/README.md
+++ b/src/ci/docker/README.md
@@ -26,6 +26,12 @@ DEPLOY=1 ./src/ci/docker/run.sh x86_64-gnu
 while locally, to the `obj/$image_name` directory. This is primarily to prevent
 strange linker errors when using multiple Docker images.
 
+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:
+
+```
+DOCKER_SCRIPT=x86_64-gnu-llvm3.sh ./src/ci/docker/run.sh x86_64-gnu-llvm-18
+```
+
 ## Local Development
 
 Refer to the [dev guide](https://rustc-dev-guide.rust-lang.org/tests/docker.html) for more information on testing locally.
diff --git a/src/doc/rustc/src/platform-support/android.md b/src/doc/rustc/src/platform-support/android.md
index 96499b0d801..54e7ddca32a 100644
--- a/src/doc/rustc/src/platform-support/android.md
+++ b/src/doc/rustc/src/platform-support/android.md
@@ -65,4 +65,4 @@ Currently the `riscv64-linux-android` target requires the following architecture
 ### aarch64-linux-android on Nightly compilers
 
 As soon as `-Zfixed-x18` compiler flag is supplied, the [`ShadowCallStack` sanitizer](https://releases.llvm.org/7.0.1/tools/clang/docs/ShadowCallStack.html)
-instrumentation is also made avaiable by supplying the second compiler flag `-Zsanitizer=shadow-call-stack`.
+instrumentation is also made available by supplying the second compiler flag `-Zsanitizer=shadow-call-stack`.
diff --git a/tests/codegen/slice-indexing.rs b/tests/codegen/slice-indexing.rs
index 3d284148db2..75112bb0c24 100644
--- a/tests/codegen/slice-indexing.rs
+++ b/tests/codegen/slice-indexing.rs
@@ -60,3 +60,40 @@ pub unsafe fn str_get_unchecked_mut_by_range(x: &mut str, r: Range<usize>) -> &m
     // CHECK: sub nuw i64
     x.get_unchecked_mut(r)
 }
+
+// CHECK-LABEL: @slice_repeated_indexing(
+#[no_mangle]
+pub fn slice_repeated_indexing(dst: &mut [u8], offset: usize) {
+    let mut i = offset;
+    // CHECK: panic_bounds_check
+    dst[i] = 1;
+    i += 1;
+    // CHECK: panic_bounds_check
+    dst[i] = 2;
+    i += 1;
+    // CHECK: panic_bounds_check
+    dst[i] = 3;
+    i += 1;
+    // CHECK: panic_bounds_check
+    dst[i] = 4;
+}
+
+// CHECK-LABEL: @slice_repeated_indexing_coalesced(
+#[no_mangle]
+pub fn slice_repeated_indexing_coalesced(dst: &mut [u8], offset: usize) {
+    let mut i = offset;
+    if i.checked_add(4).unwrap() <= dst.len() {
+        // CHECK-NOT: panic_bounds_check
+        dst[i] = 1;
+        i += 1;
+        // CHECK-NOT: panic_bounds_check
+        dst[i] = 2;
+        i += 1;
+        // CHECK-NOT: panic_bounds_check
+        dst[i] = 3;
+        i += 1;
+        // CHECK-NOT: panic_bounds_check
+        dst[i] = 4;
+    }
+    // CHECK: ret
+}