include!
is a smell and should be made obsolete for code-generating cargo packages
#21147
Labels
A-parser
Area: The parsing of Rust source code to an AST
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
In particular, we should somehow allow using
OUT_DIR
in the#[path]
of amod foo
, to allow parsing to proceed normally. Sinceinclude!
doesn't do textual inclusion, but rather AST splicing, and is rather blind, it doesn't pass in the correct context to allow things like outer attributes to work ininclude!
'd code, even if it'smod foo { include!("foo.rs"); }
. It's conservatively correct, but conservatively obnoxious.The text was updated successfully, but these errors were encountered: