about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorJoshua Nelson <jnelson@cloudflare.com>2022-05-26 15:10:46 -0500
committerJoshua Nelson <jnelson@cloudflare.com>2022-06-21 23:03:55 -0500
commited1e3512dc5e0b25c693b95f39281c97c7bd3819 (patch)
treee8f9df643aa4186387a055baf38edfac75bcfe04 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent3a8b0144c82197a70e919ad371d56f82c2282833 (diff)
downloadrust-ed1e3512dc5e0b25c693b95f39281c97c7bd3819.tar.gz
rust-ed1e3512dc5e0b25c693b95f39281c97c7bd3819.zip
`impl<T: AsRawFd> for {Arc,Box}<T>`
This allows implementing traits that require a raw FD on Arc and Box.

Previously, you'd have to add the function to the trait itself:

```rust
trait MyTrait {
    fn as_raw_fd(&self) -> RawFd;
}

impl<T: MyTrait> MyTrait for Arc<T> {
    fn as_raw_fd(&self) -> RawFd {
        (**self).as_raw_fd()
    }
}
```
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions