These are chat archives for rust-lang/rust

31st
Dec 2018
toxicafunk
@toxicafunk
Dec 31 2018 00:22
The thing is how to catch the error so you know what to fix
That's what I think @loloof64 is trying to accomplish
match Engine::new {...} or something similar
Ayush Prashar
@ayushprashar
Dec 31 2018 05:50
Hi guys...I was trying to create an API where in I declare my method in a trait defined in project1 and implement the same same method in another project project2. Both have separate toml files. Now I have this issue where in every declared module , I get an error `proc-macro` crate types cannot export any items other than functions tagged with `#[proc_macro_derive]` currently
can any one explain this to me?
Patrick Dignan
@dignan
Dec 31 2018 06:11
hi, i'm trying to implement some functionality where there's a channel that accepts requests that are contained in a holder with a response and a oneshot to use to pass information back to the caller. i'm using tokio for the oneshot and channel, but that's probably not relevant to the problem. all the requests/responses implement the same trait. i'd like the oneshot to be aware of the request/response type so that the caller can handle different implementors of the trait appropriately. i think i can use a giant enum for this, but there are lots of implementors so that'd be annoying and as well as less convenient ofr any new message types. i have a playground link the probably explains it better than a thousand words: https://play.rust-lang.org/?version=stable&mode=release&edition=2018&gist=47e4d7f6199f68cde0717a805fb60eba could i implement From somehow to make this work? is this design just wrong? should i just use the enum?
Denis Lisov
@tanriol
Dec 31 2018 16:17
@loloof64 How about making a PR to uci with a version of Engine::new that does not panic?
Zakarum
@omni-viral
Dec 31 2018 17:21

@loloof64 btw

|| {
    Engine::new(path);
}

is closure that returns () because of ;