Skip to content

Commit

Permalink
Auto merge of rust-lang#133360 - compiler-errors:rollup-a2o38tq, r=co…
Browse files Browse the repository at this point in the history
…mpiler-errors

Rollup of 8 pull requests

Successful merges:

 - rust-lang#132090 (Stop being so bail-y in candidate assembly)
 - rust-lang#132658 (Detect const in pattern with typo)
 - rust-lang#132911 (Pretty print async fn sugar in opaques and trait bounds)
 - rust-lang#133102 (aarch64 softfloat target: always pass floats in int registers)
 - rust-lang#133159 (Don't allow `-Zunstable-options` to take a value )
 - rust-lang#133208 (generate-copyright: Now generates a library file too.)
 - rust-lang#133215 (Fix missing submodule in `./x vendor`)
 - rust-lang#133264 (implement OsString::truncate)

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Nov 23, 2024
2 parents a939801 + a4f797e commit 6548ad8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions std/src/ffi/os_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,11 +550,15 @@ impl OsString {
OsStr::from_inner_mut(self.inner.leak())
}

/// Provides plumbing to core `Vec::truncate`.
/// More well behaving alternative to allowing outer types
/// full mutable access to the core `Vec`.
/// Truncate the the `OsString` to the specified length.
///
/// # Panics
/// Panics if `len` does not lie on a valid `OsStr` boundary
/// (as described in [`OsStr::slice_encoded_bytes`]).
#[inline]
pub(crate) fn truncate(&mut self, len: usize) {
#[unstable(feature = "os_string_truncate", issue = "133262")]
pub fn truncate(&mut self, len: usize) {
self.as_os_str().inner.check_public_boundary(len);
self.inner.truncate(len);
}

Expand Down

0 comments on commit 6548ad8

Please sign in to comment.