File tree Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -138,14 +138,27 @@ The *`no_main` [attribute]* may be applied at the crate level to disable emittin
138138r[ crate.crate_name]
139139## The ` crate_name ` attribute
140140
141- r[ crate.crate_name.general ]
142- The * ` crate_name ` [ attribute] * may be applied at the crate level to specify the name of the crate with the [ MetaNameValueStr ] syntax .
141+ r[ crate.crate_name.intro ]
142+ The * ` crate_name ` [ attribute] * specifies the name of the crate.
143143
144- ``` rust
145- #![crate_name = " mycrate" ]
146- ```
144+ > [ !EXAMPLE]
145+ > ``` rust
146+ > #![crate_name = " mycrate" ]
147+ > ```
148+
149+ r [crate . crate_name. syntax]
150+ The `crate_name ` attribute uses the [MetaNameValueStr ] syntax to specify the name of the crate .
151+
152+ r [crate . crate_name. allowed- positions ]
153+ The `crate_name ` attribute may only be applied to the crate root .
154+
155+ r [crate . crate_name. duplicates]
156+ Only the first `crate_name ` attribute is used to determine the crate name .
157+
158+ > [! NOTE ]
159+ > `rustc ` currently warns on following duplicate `crate_name ` attributes . This may become an error in the future .
147160
148- r[ crate.crate_name.restriction ]
161+ r [crate . crate_name. required - format ]
149162The crate name must not be empty , and must only contain [Unicode alphanumeric ] or `_ ` (U + 005F) characters .
150163
151164[^ phase - distinction ]: This distinction would also exist in an interpreter .
You can’t perform that action at this time.
0 commit comments