Skip to content

Commit 4f5d951

Browse files
committed
Auto merge of #3050 - RalfJung:rustup, r=RalfJung
Rustup
2 parents 2bd6b4d + 5659c10 commit 4f5d951

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
35e416303e6591a71ef6a91e006c602d2def3968
1+
a989e25f1b87949a886eab3da10324d14189fe95

src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#![feature(yeet_expr)]
99
#![feature(nonzero_ops)]
1010
#![feature(round_ties_even)]
11-
#![feature(os_str_bytes)]
1211
#![feature(lint_reasons)]
1312
#![feature(trait_upcasting)]
1413
// Configure clippy and other lints

src/shims/os_str.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub fn bytes_to_os_str<'tcx>(bytes: &[u8]) -> InterpResult<'tcx, &OsStr> {
2424
}
2525
#[cfg(not(unix))]
2626
pub fn bytes_to_os_str<'tcx>(bytes: &[u8]) -> InterpResult<'tcx, &OsStr> {
27-
// We cannot use `from_os_str_bytes_unchecked` here since we can't trust `bytes`.
27+
// We cannot use `from_encoded_bytes_unchecked` here since we can't trust `bytes`.
2828
let s = std::str::from_utf8(bytes)
2929
.map_err(|_| err_unsup_format!("{:?} is not a valid utf-8 string", bytes))?;
3030
Ok(OsStr::new(s))
@@ -83,7 +83,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
8383
ptr: Pointer<Option<Provenance>>,
8484
size: u64,
8585
) -> InterpResult<'tcx, (bool, u64)> {
86-
let bytes = os_str.as_os_str_bytes();
86+
let bytes = os_str.as_encoded_bytes();
8787
self.eval_context_mut().write_c_str(bytes, ptr, size)
8888
}
8989

src/shims/unix/fs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
13441344

13451345
let mut name = dir_entry.file_name(); // not a Path as there are no separators!
13461346
name.push("\0"); // Add a NUL terminator
1347-
let name_bytes = name.as_os_str_bytes();
1347+
let name_bytes = name.as_encoded_bytes();
13481348
let name_len = u64::try_from(name_bytes.len()).unwrap();
13491349

13501350
let dirent64_layout = this.libc_ty_layout("dirent64");
@@ -1698,7 +1698,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
16981698
Cow::Borrowed(resolved.as_ref()),
16991699
crate::shims::os_str::PathConversion::HostToTarget,
17001700
);
1701-
let mut path_bytes = resolved.as_os_str_bytes();
1701+
let mut path_bytes = resolved.as_encoded_bytes();
17021702
let bufsize: usize = bufsize.try_into().unwrap();
17031703
if path_bytes.len() > bufsize {
17041704
path_bytes = &path_bytes[..bufsize]

tests/utils/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use super::miri_extern;
66
pub fn host_to_target_path(path: OsString) -> PathBuf {
77
use std::ffi::{CStr, CString};
88

9-
// Once into_os_str_bytes is stable we can use it here.
9+
// Once into_encoded_bytes is stable we can use it here.
1010
// (Unstable features would need feature flags in each test...)
1111
let path = CString::new(path.into_string().unwrap()).unwrap();
1212
let mut out = Vec::with_capacity(1024);

0 commit comments

Comments
 (0)