These are chat archives for rust-lang/rust

15th
Apr 2016
@Ogeon thanks for your advice ... I just duplicated the code into the threads, but I think your solution is better
I want to split my code into different files. what's the right way to make them visible again?
If I just copy them over they are not visible anymore
(not using modules)
anyone? I tried multiple things ... I have the files main.rs, utils.rs and consts.rs
consts.rs for example:
const SBS:               &'static str = "sbs";
but utils.rs doesn't see SBS at all.
ok got it.
Erik Hedvall
@Ogeon
Apr 15 2016 10:07
Files becomes modules when you connect them with mod, so you'll have to use pub for things you want to use outside consts and utils.
it worked without pub if I wrote use my_ mod::SBS but required pub if I wrote use my_mod::*
very weird
Erik Hedvall
@Ogeon
Apr 15 2016 15:05
Globs are a bit strange. Anyway, use my_mod::SBS should require SBS to be public. I'd be surprised if it didn't.
The visibility check is one of the last phases, so it may look like it's available if you have any other errors.