Skip to content

Commit 719ddf4

Browse files
authored
Rollup merge of rust-lang#148279 - IntegralPilot:master, r=hkBst
rustc_builtin_macros: rename bench parameter to avoid collisions with user-defined function names Resolves rust-lang#148275 by preventing name collisions in the `#[bench]` macro. Previously, a user-defined function named "b" could not be benchmarked because the macro-generated lambda identity collided with the same name. We now generate the lambda ident as `__bench_<function_name>`, ensuring it is always distinct from the user’s function. Because the prefix is applied recursively (e.g. benchmarking `__bench_b` produces a lambda ident `__bench___bench_b`), there is no possible function name that can equal its corresponding lambda ident. This guarantees that the user can safely bench a function of any valid name without risk of identifier collision.
2 parents 556701a + 156d0f6 commit 719ddf4

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)