i'm trying to investigate this issue and i'm not totally sure how to debug it. there's something weird happening where if you use
include_dir to load in a large file, it causes rustc/rustdoc to overflow its main-thread stack
but if you translate the intended proc-macro output into code directly, it builds fine
OTOH, something must have changed between stable and nightly, because the memory usage doesn't balloon out of control on nightly :confused:
nor on beta, for that matter :thinking:
O_o So it seems to have accidentally gotten fixed... A regression test needs some large files, right? Can we generate them so we don't have to have them in git?
the rustdoc search index for the standard library is sufficient
it still takes ages to build tho
judging from what the person saw with
cargo expand, it looks like it's trying to load the files into byte literals during expansion?
i'm not sure how to reduce a test case, though - just manually writing
include_bytes!("search-index.js") isn't enough to trigger the behavior
the macro call may need to be written by a proc-macro? there may be some weird interaction with the
so it's literally about a macro that just dumps an
include_bytes! call without doing anything else?
potentially. i haven’t actually tried that
include_dir is just a directory scan and file name collection before printing a struct expression to the output token stream, including the
it does use
proc-macro-hack, but hopefully that’s not part of it
update: a trivial proc-macro that expands to
pub static ASDF: &'static [u8] = include_bytes!("search-index.js") is not enough to trigger the bug
...not even when going through
quote and using a string literal from outside the proc-macro
proc-macro-hack by itself will do it :expressionless: