diff --git a/rust-version b/rust-version index dd0af02836..c5327e4d2b 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -b6fa392238a459c29a47e2cf824d79a49a8ba039 +5fd2f06e99a985dd896684cb2c9f8c7090eca1ab diff --git a/tests/run-pass/wtf8.rs b/tests/run-pass/wtf8.rs new file mode 100644 index 0000000000..2b4da785f2 --- /dev/null +++ b/tests/run-pass/wtf8.rs @@ -0,0 +1,23 @@ +// ignore-linux: tests Windows-only APIs +// ignore-macos: tests Windows-only APIs + +use std::os::windows::ffi::{OsStrExt, OsStringExt}; +use std::ffi::{OsStr, OsString}; + +fn test1() { + let base = "a\té \u{7f}💩\r"; + let mut base: Vec = OsStr::new(base).encode_wide().collect(); + base.push(0xD800); + let _res = OsString::from_wide(&base); +} + +fn test2() { + let mut base: Vec = OsStr::new("aé ").encode_wide().collect(); + base.push(0xD83D); + let mut _res: Vec = OsString::from_wide(&base).encode_wide().collect(); +} + +fn main() { + test1(); + test2(); +}