rust/library
Matthias Krüger 02134611ce
Rollup merge of #111057 - xfix:tcpstream-as-raw-fd-inline, r=m-ou-se
Make sure the implementation of TcpStream::as_raw_fd is fully inlined

Currently the following function:

```rust
use std::os::fd::{AsRawFd, RawFd};
use std::net::TcpStream;

pub fn as_raw_fd(socket: &TcpStream) -> RawFd {
    socket.as_raw_fd()
}
```

Is optimized to the following:

```asm
example::as_raw_fd:
        push    rax
        call    qword ptr [rip + <std::net::tcp::TcpStream as std::sys_common::AsInner<std::sys_common::net::TcpStream>>::as_inner@GOTPCREL]
        mov     rdi, rax
        call    qword ptr [rip + std::sys_common::net::TcpStream::socket@GOTPCREL]
        mov     rdi, rax
        pop     rax
        jmp     qword ptr [rip + _ZN73_$LT$std..sys..unix..net..Socket$u20$as$u20$std..os..fd..raw..AsRawFd$GT$9as_raw_fd17h633bcf7e481df8bbE@GOTPCREL]
```

I think it would make more sense to inline trivial functions used within `TcpStream::AsRawFd`.
2023-05-01 17:10:25 +02:00
..
alloc Auto merge of #103406 - Jules-Bertholet:from_clone_slice_to_box, r=dtolnay 2023-04-30 13:58:00 +00:00
backtrace@8ad84ca5ad Bump version of object and related crates 2023-04-19 12:42:20 +08:00
core Rollup merge of #110823 - compiler-errors:tweak-await-span, r=b-naber 2023-05-01 01:09:47 +02:00
panic_abort
panic_unwind
portable-simd Make sure that signatures aren't accidental refinements 2023-04-28 17:36:49 +00:00
proc_macro Auto merge of #109002 - michaelvanstraten:master, r=petrochenkov 2023-04-21 10:47:27 +00:00
profiler_builtins
rtstartup
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Rollup merge of #111057 - xfix:tcpstream-as-raw-fd-inline, r=m-ou-se 2023-05-01 17:10:25 +02:00
stdarch@b655243782
test handle cfg(bootstrap) 2023-04-28 08:47:55 -07:00
unwind