Skip to content

Commit

Permalink
Merge pull request #1649 from ehuss/cfg_attr-crate_name-crate_type
Browse files Browse the repository at this point in the history
Add restriction for cfg_attr with crate_type and crate_name
  • Loading branch information
traviscross authored Oct 22, 2024
2 parents d953a36 + 2766ec3 commit c26733c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/conditional-compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,8 @@ fn bewitched() {}
r[cfg.cfg_attr.restriction]
The `cfg_attr` attribute is allowed anywhere attributes are allowed.

The [`crate_type`] and [`crate_name`] attributes cannot be used with `cfg_attr`.

### The `cfg` macro

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

0 comments on commit c26733c

Please sign in to comment.