Skip to main content

## idents_would_merge

# Function idents_would_merge

Source

    fn idents_would_merge(tt1: &TokenTree, tt2: &TokenTree) -> bool

Expand description

Should two consecutive tokens be printed with a space between them?

Note: some old proc macros parse pretty-printed output, so changes here can break old code. For example:

- #63896: `#[allow(unused,` must be printed rather than `#[allow(unused ,`
- #73345: `#[allow(unused)]` must be printed rather than `# [allow(unused)]`

Returns `true` if both token trees are identifier-like tokens that would merge into a single token if printed without a space between them. E.g. `ident` + `where` would merge into `identwhere`.