These are chat archives for rust-lang/rust

20th
Jan 2019
John
@onFireForGod_gitlab
Jan 20 2019 06:27 UTC
[ Sat Jan 19 | 09:11 PM | forecast-service ]: rustup update && cargo update
info: syncing channel updates for 'stable-x86_64-apple-darwin'
info: syncing channel updates for 'nightly-x86_64-apple-darwin'
info: latest update on 2019-01-20, rust version 1.33.0-nightly (0c0c58528 2019-01-19)
error: component 'rls' for target 'x86_64-apple-darwin' is unavailable for download
info: checking for self-updates

       stable-x86_64-apple-darwin unchanged - rustc 1.32.0 (9fda7c223 2019-01-16)
  nightly-x86_64-apple-darwin update failed - rustc 1.32.0-nightly (f4a421ee3 2018-12-13)

    Updating crates.io index
    Updating proc-macro2 v0.4.25 -> v0.4.26
nightly is broken?
laurent bernabé
@loloof64
Jan 20 2019 10:42 UTC
Hi everyone :smile: In a subfolder of my project, I have at least a source file uci.rs and another computer.rs, where I want to call the Engine module from uci source. How can handle this import simply ? I am using the latest Rust stable from January 2019.
Zakarum
@omni-viral
Jan 20 2019 10:43 UTC
use super::uci::Engine;
laurent bernabé
@loloof64
Jan 20 2019 10:43 UTC
Thanks :smile: I'll try it right now :smile:
The compiler still complains that uci can't be found in super.
John
@onFireForGod_gitlab
Jan 20 2019 10:44 UTC
make it pub
Zakarum
@omni-viral
Jan 20 2019 10:45 UTC
It is irrelevant
John
@onFireForGod_gitlab
Jan 20 2019 10:45 UTC
specify in mod.rs pub mod uci
Zakarum
@omni-viral
Jan 20 2019 10:45 UTC
Now this is relevant
mod uci
John
@onFireForGod_gitlab
Jan 20 2019 10:45 UTC
and make sure Engine is also pub
laurent bernabé
@loloof64
Jan 20 2019 10:45 UTC
Ok,thanks :smile: I try it now
Zakarum
@omni-viral
Jan 20 2019 10:46 UTC
@onFireForGod_gitlab private symbols from this and parent module are visible
So Engine should be pub or pub(super) or pub(crate) to be visible from compute
laurent bernabé
@loloof64
Jan 20 2019 10:47 UTC
It works :smile: Thank you very much :smile:
John
@onFireForGod_gitlab
Jan 20 2019 10:47 UTC
хорошо-хорошо
Zakarum
@omni-viral
Jan 20 2019 10:47 UTC
Вот так то
)
laurent bernabé
@loloof64
Jan 20 2019 10:47 UTC
:smile:
Diego Antonio Rosario Palomino
@GunpowderGuy_gitlab
Jan 20 2019 14:47 UTC
@tanriol it probably is , im asking here anyways becuase i was told rust is not capable of running serialization systems at compile time , something about it requiring dynamic allocation
Denis Lisov
@tanriol
Jan 20 2019 20:03 UTC
Rust's const evaluation cannot run it at compile time yet... being more precise, it might run something or possibly even everything at compile time, but it cannot be guaranteed to do so. However, you can make a build script that generates the equivalent data structures.
David Holroyd
@dholroyd
Jan 20 2019 22:41 UTC
Can anyone point to best-practise examples of using kernel headers with bindgen?
e.g. right now I just put .header("/usr/include/linux/usbdevice_fs.h") in build.rs
works on my laptop!
but; maybe cross-compiling, uh...?
Denis Lisov
@tanriol
Jan 20 2019 22:46 UTC
I'd probably think about bundling them in your crate. The Linux kernel API is considered stable. One exception is if you want to use new features, but have fallback for older kernels too.
David Holroyd
@dholroyd
Jan 20 2019 22:48 UTC
thanks for the tip @tanriol !