Commit 6484c65
authored
Rollup merge of #148279 - IntegralPilot:master, r=hkBst
rustc_builtin_macros: rename bench parameter to avoid collisions with user-defined function names
Resolves rust-lang/rust#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.File tree
0 file changed
+0
-0
lines changed0 file changed
+0
-0
lines changed
0 commit comments