We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 385970f commit 6e83ebeCopy full SHA for 6e83ebe
src/doc/unstable-book/src/compiler-flags/crate-attr.md
@@ -0,0 +1,16 @@
1
+# `crate-attr`
2
+
3
+The tracking issue for this feature is: [#138287](https://github.com/rust-lang/rust/issues/138287).
4
5
+------------------------
6
7
+The `-Z crate-attr` flag allows you to inject attributes into the crate root.
8
+For example, `-Z crate-attr=crate_name="test"` acts as if `#![crate_name="test"]` were present before the first source line of the crate root.
9
10
+To inject multiple attributes, pass `-Z crate-attr` multiple times.
11
12
+Formally, the expansion behaves as follows:
13
+1. The crate is parsed as if `-Z crate-attr` were not present.
14
+2. The attributes in `-Z crate-attr` are parsed.
15
+3. The attributes are injected at the top of the crate root.
16
+4. Macro expansion is performed.
0 commit comments