Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
553a690
Specify target specific linker for riscv64gc-gnu job
Hoverbear Jun 24, 2024
8016940
Tweak a confusing comment in `create_match_candidates`
Zalathar Jun 24, 2024
050595a
core: VaArgSafe is an unsafe trait
workingjubilee Jun 25, 2024
c2f1072
Tweak `FlatPat::new` to avoid a temporarily-invalid state
Zalathar Jun 25, 2024
c7b579a
Add missing slash in const_eval_select doc comment
cyrgani Jun 25, 2024
2155c6c
#126333 remove `PathBuf::as_mut_vec` reference at top of `PathBuf::_p…
tnuha Jun 23, 2024
b08cd69
inner truncate methods for UEFI platforms
tnuha Jun 23, 2024
7e187e8
remove references to `PathBuf::as_mut_vec` in `PathBuf::_set_extension`
tnuha Jun 23, 2024
aa46a33
`PathBuf::as_mut_vec` removed and verified for UEFI and Windows platf…
tnuha Jun 25, 2024
d30d85f
Delegation: ast lowering refactor
Bryanskiy Jun 25, 2024
6997b68
Detect unused structs which derived Default
mu001999 Jun 25, 2024
58bbade
Rollup merge of #126302 - mu001999-contrib:ignore/default, r=michaelw…
matthiaskrgr Jun 25, 2024
9d7e146
Rollup merge of #126885 - Borgerr:rm_internal_pathbuf_asmutvec, r=wor…
matthiaskrgr Jun 25, 2024
e29cc5d
Rollup merge of #126916 - ferrocene:hoverbear/riscv64gc-gnu-specify-l…
matthiaskrgr Jun 25, 2024
6077c0e
Rollup merge of #126926 - Zalathar:candidate-per-arm, r=Nadrieril
matthiaskrgr Jun 25, 2024
3795c56
Rollup merge of #126927 - workingjubilee:vaargsafe-is-unsafe, r=joboet
matthiaskrgr Jun 25, 2024
7e1489c
Rollup merge of #126932 - Zalathar:flat-pat, r=Nadrieril
matthiaskrgr Jun 25, 2024
e970017
Rollup merge of #126946 - cyrgani:patch-1, r=compiler-errors
matthiaskrgr Jun 25, 2024
4ebd69c
Rollup merge of #126947 - Bryanskiy:delegation-lowering-refactoring, …
matthiaskrgr Jun 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
inner truncate methods for UEFI platforms
  • Loading branch information
tnuha committed Jun 25, 2024
commit b08cd69684e4b121399b3ea0f9ee6cc4a51cad07
5 changes: 5 additions & 0 deletions library/std/src/ffi/os_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,11 @@ impl OsString {
pub(crate) fn as_mut_vec_for_path_buf(&mut self) -> &mut Vec<u8> {
self.inner.as_mut_vec_for_path_buf()
}

#[inline]
pub(crate) fn truncate(&mut self, len: usize) {
self.inner.truncate(len);
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
6 changes: 3 additions & 3 deletions library/std/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,7 @@ impl PathBuf {

// absolute `path` replaces `self`
if path.is_absolute() || path.prefix().is_some() {
self.as_mut_vec().truncate(0);
self.inner.truncate(0);

// verbatim paths need . and .. removed
} else if comps.prefix_verbatim() && !path.inner.is_empty() {
Expand Down Expand Up @@ -1350,7 +1350,7 @@ impl PathBuf {
// `path` has a root but no prefix, e.g., `\windows` (Windows only)
} else if path.has_root() {
let prefix_len = self.components().prefix_remaining();
self.as_mut_vec().truncate(prefix_len);
self.inner.truncate(prefix_len);

// `path` is a pure relative path
} else if need_sep {
Expand Down Expand Up @@ -1383,7 +1383,7 @@ impl PathBuf {
pub fn pop(&mut self) -> bool {
match self.parent().map(|p| p.as_u8_slice().len()) {
Some(len) => {
self.as_mut_vec().truncate(len);
self.inner.truncate(len);
true
}
None => false,
Expand Down
5 changes: 5 additions & 0 deletions library/std/src/sys/os_str/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ impl Buf {
pub(crate) fn as_mut_vec_for_path_buf(&mut self) -> &mut Vec<u8> {
&mut self.inner
}

#[inline]
pub(crate) fn truncate(&mut self, len: usize) {
self.inner.truncate(len);
}
}

impl Slice {
Expand Down