std::concat_idents - Rust
Description: API documentation for the Rust `concat_idents` macro in crate `std`.
Keywords: rust, rustlang, rust-lang, concat_idents

# Macro std::concat_idents [−] [src]

    macro_rules! concat_idents {
        ($($e:ident),*) => { ... };
        ($($e:ident,)*) => { ... };
    }

🔬 This is a nightly-only experimental API. (`concat_idents_macro` #29599)

Concatenate identifiers into one identifier.

This macro takes any number of comma-separated identifiers, and concatenates them all into one, yielding an expression which is a new identifier. Note that hygiene makes it such that this macro cannot capture local variables. Also, as a general rule, macros are only allowed in item, statement or expression position. That means while you may use this macro for referring to existing variables, functions or modules etc, you cannot define a new one with it.

# Examples

    #![feature(concat_idents)]

    fn foobar() -> u32 { 23 }

    let f = concat_idents!(foo, bar);
    println!("{}", f());

    // fn concat_idents!(new, fun, name) { } // not usable in this way!Run

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
↑
  Move up in search results
↓
  Move down in search results
↹
  Switch tab
⏎
  Go to active search result
+ / -
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)