Argument names in foreign functions, function types and trait methods are not resolved #33995
Labels
A-resolve
Area: Name resolution
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Arguments in foreign functions, function types and traits are pattern bindings like all other function arguments and supposedly they should be resolved in the same way, however they are not resolved at all.
It doesn't make much difference because these bindings can't be used in function bodies, however it makes some difference, for example foreign functions can reuse constant names for their arguments, while other functions can't (whether it's good or bad is a separate question).
Accidentally, some function arguments being unresolved also affect lints like
non_snake_case
, such lints don't report warnings for them. This may be reasonable for foreign functions though, because such functions may follow foreign naming conventions. If this lint is "fixed" it may affects crates likewinapi
(cc @retep998). This is not so reasonable for trait methods however.Examples:
The text was updated successfully, but these errors were encountered: