Skip to content

concat_idents can create empty identifiers #50403

@ExpHP

Description

@ExpHP

I posted this casually on the tracking issue some months back:

An amusing fact about the current implementation of concat_idents! is that it will accept an empty
argument list, making it possible to construct the empty string as an identifier:

error[E0425]: cannot find value `` in this scope
 --> src/main.rs:5:5
  |
5 |     concat_idents!();
  |     ^^^^^^^^^^^^^^^^^ not found in this scope

(good luck actually doing anything with it)

I left it at that because I never thought there would be any serious discussion of stabilizing the feature. Never say never, huh?

This is an easy fix and I am working on a PR. I just made this issue so that I have a number to name the test case after. 🦆

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions