Skip to content

Hygiene not taken into account for name resolution (wrong type inference with izip!) #11681

Closed
@flodiebold

Description

@flodiebold

In this line:
https://github.com/rust-analyzer/rust-analyzer/blob/69e5bd5a2532cfe47e5517d720eb70cbf3f4a908/crates/ide_assists/src/handlers/inline_call.rs#L347
we infer the wrong type for expr, namely we infer Vec<PathExpr>. The reason for this seems to be our expansion of the izip!(params, param_use_nodes, arguments) macro call:

$crate::__std_iter::IntoIterator::into_iter(params).zip(param_use_nodes).zip(arguments).map(|((a,b),b)|(a,b,b))

note the .map(|((a,b),b)| (a,b,b)). This seems to be a hygiene issue, where the different bs come from different macro expansions and so we need to consider hygiene to correctly resolve them.

Part of #8961.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-hygieneA-macromacro expansionA-tytype system / type inference / traits / method resolutionC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions