File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -269,9 +269,10 @@ pub mod builtin {
269
269
/// This macro takes any number of comma-separated identifiers, and
270
270
/// concatenates them all into one, yielding an expression which is a new
271
271
/// identifier. Note that hygiene makes it such that this macro cannot
272
- /// capture local variables, and macros are only allowed in item,
273
- /// statement or expression position, meaning this macro may be difficult to
274
- /// use in some situations.
272
+ /// capture local variables. Also, as a general rule, macros are only
273
+ /// allowed in item, statement or expression position. That means while
274
+ /// you may use this macro for referring to existing variables, functions or
275
+ /// modules etc, you cannot define a new one with it.
275
276
///
276
277
/// # Examples
277
278
///
@@ -283,6 +284,8 @@ pub mod builtin {
283
284
///
284
285
/// let f = concat_idents!(foo, bar);
285
286
/// println!("{}", f());
287
+ ///
288
+ /// // fn concat_idents!(new, fun, name) { } // not usable in this way!
286
289
/// # }
287
290
/// ```
288
291
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
You can’t perform that action at this time.
0 commit comments