Skip to content

Commit c26733c

Browse files
authored
Merge pull request #1649 from ehuss/cfg_attr-crate_name-crate_type
Add restriction for cfg_attr with crate_type and crate_name
2 parents d953a36 + 2766ec3 commit c26733c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/conditional-compilation.md

+4
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,8 @@ fn bewitched() {}
445445
r[cfg.cfg_attr.restriction]
446446
The `cfg_attr` attribute is allowed anywhere attributes are allowed.
447447

448+
The [`crate_type`] and [`crate_name`] attributes cannot be used with `cfg_attr`.
449+
448450
### The `cfg` macro
449451

450452
r[cfg.macro]
@@ -476,6 +478,8 @@ println!("I'm running on a {} machine!", machine_kind);
476478
[`cfg`]: #the-cfg-attribute
477479
[`cfg` macro]: #the-cfg-macro
478480
[`cfg_attr`]: #the-cfg_attr-attribute
481+
[`crate_name`]: crates-and-source-files.md#the-crate_name-attribute
482+
[`crate_type`]: linkage.md
479483
[`target_feature` attribute]: attributes/codegen.md#the-target_feature-attribute
480484
[attribute]: attributes.md
481485
[attributes]: attributes.md

0 commit comments

Comments
 (0)