These are chat archives for rust-lang/rust

30th
Mar 2018
Ayushya Chitransh
@AyushyaChitransh
Mar 30 2018 06:15
can I specify which rust comiler to use in cargo.toml file?
Ayushya Chitransh
@AyushyaChitransh
Mar 30 2018 06:33
I found this to be a controversial thing and having multiple related issue on github.
Dylan DPC
@Dylan-DPC
Mar 30 2018 09:22
Hey :wave: any clue?
error[E0106]: missing lifetime specifier
 --> src/main.rs:7:17
  |
7 | #[derive(Debug, StructOpt)]
  |                 ^^^^^^^^^ expected lifetime parameter
i can't do <'a> or any other combinations :/
Andrey Lesnikov
@ozkriff
Mar 30 2018 09:25
Can you show the whole declaration?
Dylan DPC
@Dylan-DPC
Mar 30 2018 09:27
sure
#[derive(Debug, StructOpt)]
struct Foo<'a> {
    tool: &'a str,
    #[structopt(long = "version", short = "v")]
    version: String

}
Andrey Lesnikov
@ozkriff
Mar 30 2018 09:39
Are you sure that you really need this &'a str,?
Looks like StructOpt doesn't support structures with borrowed fields. Maybe tool: String, is good enough?
Dylan DPC
@Dylan-DPC
Mar 30 2018 09:49
ya it is
I had String first and i thought &str might be better :D
Andy Grove
@andygrove
Mar 30 2018 15:08
When I use extern crate is it correct that I need to put it in any source file in my project that needs to use that crate?
I thought there was a way to just put it in lib.rs but that doesn't seem to work
Dylan DPC
@Dylan-DPC
Mar 30 2018 15:33
no you don't have to mention it in every file. Placing it in the lib.rs / main.rs is enough
Ryan
@rnleach
Mar 30 2018 15:33
@andygrove Just put it in the lib.rs file. Then import with use statements.
Andy Grove
@andygrove
Mar 30 2018 16:08
thanks @rnleach
John-John Tedro
@udoprog
Mar 30 2018 19:51
Are there any instructions for how to build rust with certain backends (wasm32)? And is it possible to invoke rustc from the build directory correctly without installing it somewhere first?
Denis Lisov
@tanriol
Mar 30 2018 20:26
@udoprog Don't remember about building, but there's rustup toolchain link to make the toolchain you build available just like the other ones.
John-John Tedro
@udoprog
Mar 30 2018 21:11
@tanriol Hey, that's really neat. Thanks!