about summary refs log tree commit diff
path: root/src/test/codegen/gdb_debug_script_load.rs
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-03-31 11:43:31 -0400
committerGitHub <noreply@github.com>2017-03-31 11:43:31 -0400
commiteeb075af257af00e57a21bffd20f1b6148a4b23d (patch)
treec1fc0af9eebd421c81da114ca4c8fc6cb587a67e /src/test/codegen/gdb_debug_script_load.rs
parentd2128fd16667e5b7ec3624fc1733bb573a80441a (diff)
parent2cf686f2cdd6446a3cd47df0305ead40fabe85df (diff)
downloadrust-eeb075af257af00e57a21bffd20f1b6148a4b23d.tar.gz
rust-eeb075af257af00e57a21bffd20f1b6148a4b23d.zip
Rollup merge of #40842 - Mic92:RawFd, r=aturon
Implement AsRawFd/IntoRawFd for RawFd

This is useful to build os abstraction like the nix crate does.
It allows to define functions, which accepts generic arguments
of data structures convertible to RawFd, including RawFd itself.
For example:

```
fn write<FD: AsRawFd>(fd: FD, buf: &[u8]) -> Result<usize>
write(file, buf);
```
instead of:
```
fn write(fd: RawFd, buf: &[u8]) -> Result<usize>
write(file.as_raw_fd(), buf);
```

cc @kamalmarhubi
Diffstat (limited to 'src/test/codegen/gdb_debug_script_load.rs')
0 files changed, 0 insertions, 0 deletions