These are chat archives for rust-lang/rust

7th
Oct 2017
David Harvey-Macaulay
@alteous
Oct 07 2017 10:08
Can I use the doc attribute like this? This errors with unexpected token: concat.
#[doc = concat!(concat!("Shader code for the ", stringify!($doc)), " pipeline.")]
Jonas Platte
@jplatte
Oct 07 2017 10:18
@alteous I think it's the nested concat that causes problems. Try
#[doc = concat!("Shader code for the ", stringify!($doc), " pipeline.")]
Or maybe just
#[doc = concat!("Shader code for the ", $doc, " pipeline.")]
David Harvey-Macaulay
@alteous
Oct 07 2017 10:22
Nope :frowning:
Jonas Platte
@jplatte
Oct 07 2017 10:28
Hmmm... Now that I think of it, it might not be possible yet to call macros in attributes. But I'm sure there is a workaround..
Jonas Platte
@jplatte
Oct 07 2017 10:36
Oh hey I produced an ICE trying to find a solution: https://play.rust-lang.org/?gist=f4f4b3b5bd1c43110fa01ee967e804c4&version=stable
David Harvey-Macaulay
@alteous
Oct 07 2017 10:40
Blimey :smile:
Jonas Platte
@jplatte
Oct 07 2017 10:45
Hm, report is here: rust-lang/rust#42164 but unfortunately no mention of any workarounds
David Harvey-Macaulay
@alteous
Oct 07 2017 10:59
Oh well, nevermind. Thanks for searching around for me.
Christian Bourjau
@cbourjau
Oct 07 2017 13:27
Hi there! I have a rayon questiong. I have a par_iter() where I call map on. This gives me a long iterator over potentially very large objects. I then want to fold the iterator with reduce_with(). But It seems that the reduction only starts when all maps are done? Is there a way to start reducing before all map functions finished?