-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Hygiene not taken into account for name resolution (wrong type inference with izip!
)
#11681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
10 tasks
Another example from #17448: use itertools::izip;
fn main() {
let mut yp_sn = vec![0;5];
let yp = vec![0;5];
let x = vec![0;5];
for (x, yp_sn, _yp) in izip!(x, yp_sn.iter_mut(), yp) {
*yp_sn = x;
}
} , which triggers a false positive |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 inferVec<PathExpr>
. The reason for this seems to be our expansion of theizip!(params, param_use_nodes, arguments)
macro call:note the
.map(|((a,b),b)| (a,b,b))
. This seems to be a hygiene issue, where the differentb
s come from different macro expansions and so we need to consider hygiene to correctly resolve them.Part of #8961.
The text was updated successfully, but these errors were encountered: