about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNikolai Vazquez <hello@nikolaivazquez.com>2022-06-07 14:53:59 -0400
committerNikolai Vazquez <hello@nikolaivazquez.com>2022-06-07 14:53:59 -0400
commit246a80c32cca2c5e07f205cbcd327c3b2d9b4db1 (patch)
tree765493d65616a2997a936ffc1a3eb18bc33cb7bf
parent20ad8209288896259cd1829d2b057bc017315fce (diff)
downloadrust-246a80c32cca2c5e07f205cbcd327c3b2d9b4db1.tar.gz
rust-246a80c32cca2c5e07f205cbcd327c3b2d9b4db1.zip
Inline Windows `OsStrExt::encode_wide`
User crates currently produce much more code than necessary because the
optimizer fails to make assumptions about this method.
-rw-r--r--library/std/src/os/windows/ffi.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/std/src/os/windows/ffi.rs b/library/std/src/os/windows/ffi.rs
index a9493a94cac..96bab59d3f8 100644
--- a/library/std/src/os/windows/ffi.rs
+++ b/library/std/src/os/windows/ffi.rs
@@ -129,6 +129,7 @@ pub trait OsStrExt: Sealed {
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl OsStrExt for OsStr {
+    #[inline]
     fn encode_wide(&self) -> EncodeWide<'_> {
         self.as_inner().inner.encode_wide()
     }