We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
rust-analyzer version: rust-analyzer version: 7e95c14ea 2022-05-17 stable
rust-analyzer version: 7e95c14ea 2022-05-17 stable
rustc version: rustc 1.63.0-nightly (cd282d7f7 2022-05-18)
rustc 1.63.0-nightly (cd282d7f7 2022-05-18)
relevant settings: OS: Ubuntu 20.04.4 LTS
OS: Ubuntu 20.04.4 LTS
I was learning wasmer by its examples and came across this lint.
wasmer
The origin macro is complicated so I extract the code and write a simple case to reproduce it :
#![allow(unused)] use std::marker::PhantomData; struct SomeFunc<Args = ()> { _phantom: PhantomData<Args>, } trait SomeTrait {} impl SomeTrait for i32 {} impl SomeTrait for f32 {} impl<Args> SomeFunc<Args> { fn new() -> Self { Self { _phantom: PhantomData, } } } macro_rules! impl_call { ( $( $x:ident ),* ) => { #[allow(unused_parens, non_snake_case)] impl<$( $x , )*> SomeFunc<( $( $x ),* )> where $( $x: SomeTrait, )* { pub fn call(&self, $( $x: $x, )* ) { } } }; } impl_call!(A1); impl_call!(A1, A2); fn main() { let f1 = SomeFunc::<i32>::new(); f1.call(10); let f2 = SomeFunc::<(i32, f32)>::new(); f2.call(10, 10.); // rust analyzer complains: expected 1 argument, found 2 }
cargo run works fine, but it seems rust-analyzer was confused at f2.call(...).
cargo run
f2.call(...)
By chance, I tried to switch the order of impl_call! macros into:
impl_call!
impl_call!(A1, A2); impl_call!(A1);
And the lint was gone! it's works just fine.
I suppose it might be a 🐞
BTW, I had search the existing issue, this is the closest one #9887 . but I'm not sure if it is the same reason.
The text was updated successfully, but these errors were encountered:
It's likely the same issue as #5441.
Sorry, something went wrong.
a670ff8
Successfully merging a pull request may close this issue.
rust-analyzer version:
rust-analyzer version: 7e95c14ea 2022-05-17 stable
rustc version:
rustc 1.63.0-nightly (cd282d7f7 2022-05-18)
relevant settings:
OS: Ubuntu 20.04.4 LTS
I was learning

wasmer
by its examples and came across this lint.The origin macro is complicated so I extract the code and write a simple case to reproduce it :
cargo run
works fine, but it seems rust-analyzer was confused atf2.call(...)
.By chance, I tried to switch the order of
impl_call!
macros into:And the lint was gone! it's works just fine.

I suppose it might be a 🐞
BTW, I had search the existing issue, this is the closest one #9887 . but I'm not sure if it is the same reason.
The text was updated successfully, but these errors were encountered: