These are chat archives for rust-lang/rust

1st
Feb 2018
Katharina
@spacekookie
Feb 01 2018 01:47
So, when I try to use bindgen it fails when it can't resolve things like #include<foo/foo.h> even though the headers are stored in foo/{foo,bar}.h. Anyone know what I have to do there?
Michal 'vorner' Vaner
@vorner
Feb 01 2018 08:04
@spacekookie If it's local files, you should prefer the #include "file.h" style. The <...> is for searching include paths. The other option is to add . to the path, but I think it is the wrong way to do it (but still common).
Katharina
@spacekookie
Feb 01 2018 11:40
@vorner Hey, well the includes are from an upstream project so I can't really change then. But I figured it out, I had to pass an "-I" argument and a path to clang and then it worked
Roman Proskuryakov
@kpp
Feb 01 2018 12:15

https://pastebin.com/cf3uZ6vr

@nimtiazm is there a leak?

Patrick Elsen
@xfbs
Feb 01 2018 12:45
Is there a .get(usize) method for arrays (eg. [u32; 10].get(x)?
Nvm yes there is
Patrick Elsen
@xfbs
Feb 01 2018 12:52
How do I turn an Option<&u64> into an Option<u64> ?
Paul Masurel
@fulmicoton
Feb 01 2018 12:53
opt.map(|val| *val) for instance?
maybe there is a nicer way.
Patrick Elsen
@xfbs
Feb 01 2018 12:53
Ahh found a way, opt.cloned() works. :)
Was thinking of map too but I thought there had to be something more convenient.. :p
Michal 'vorner' Vaner
@vorner
Feb 01 2018 12:54
I think there's .cloned() or something
But maybe it'll just make another copy of the reference 😇
Paul Masurel
@fulmicoton
Feb 01 2018 12:54
nice I did not know about cloned on Option.
nimtiazm
@nimtiazm
Feb 01 2018 13:04
@kpp Solved. I had to manually wait for child process to have it file handle released.
Roman Proskuryakov
@kpp
Feb 01 2018 13:12
Ah yes. I remember that 'feature'.
Patrick Elsen
@xfbs
Feb 01 2018 16:24
I like the fact that rust tests the code in documentation comments so much that I hacked together a small script in ruby to extract code in doxygen comments from C/C++ projects and add those as unit tests :+1:
Steve Klabnik
@steveklabnik
Feb 01 2018 16:24
:)