]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #12662 - DorianListens:dscheidt/extract-function-duplicate-name, r...
authorbors <bors@rust-lang.org>
Sat, 2 Jul 2022 19:42:17 +0000 (19:42 +0000)
committerbors <bors@rust-lang.org>
Sat, 2 Jul 2022 19:42:17 +0000 (19:42 +0000)
fix: Extract Function produces duplicate fn names

This change fixes #10037, in more or less the most naive fashion
possible.

We continue to start with the hardcoded default of "fun_name", and now append a
counter to the end of it if that name is already in scope.

In the future, we can probably apply more heuristics here to wind up with more
useful names by default, but for now this resolves the immediate problem.


Trivial merge