Skip to content

Incorrect mismatched-arg-count in rustc #13631

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

Closed
RalfJung opened this issue Nov 18, 2022 · 10 comments
Closed

Incorrect mismatched-arg-count in rustc #13631

RalfJung opened this issue Nov 18, 2022 · 10 comments

Comments

@RalfJung
Copy link
Member

To reproduce, check out rustc and navigate to this line. RA reports an incorrect-arg-count there, but that is wrong -- the index function being called here is defined via a macro here. I have proc macros disabled so I am not surprised it cannot find that type, but it still should not report incorrect diagnostics. The type of field shows as &{unknown}, and when a method is called on an unknown type, RA shouldn't assume it knows which method that is and how many arguments it has.

@Veykril
Copy link
Member

Veykril commented Nov 18, 2022

Duplicate of #6975
r-a assumes it's implementing Index as that is in scope.

Curious but why do you have proc-macros disabled on rustc? They should work nowadays

@Veykril Veykril closed this as completed Nov 18, 2022
@RalfJung
Copy link
Member Author

RalfJung commented Nov 18, 2022

The comment in my vscode config says "These just make everything way too slow". The extra full check build that is required for proc macros to work just makes quickly editing some parts of rustc too annoying.

I have them enabled for my other Rust projects, just not in rustc.

@lnicola
Copy link
Member

lnicola commented Nov 18, 2022

It's not a full check, we have that RUSTC_WRAPPER hack. But of course, you can disable the diagnostic.

@Veykril
Copy link
Member

Veykril commented Nov 18, 2022

I assume the wrapper doesn't affect the x.py script too much

@RalfJung
Copy link
Member Author

RalfJung commented Nov 18, 2022

That hack caused quite a few problems in the past so I disabled it (globally). I usually want a check build anyway so I'd rather RA share the results of that with its proc macro support, than go over the code twice (with and without the wrapper). It's just in rustc where even check builds take several minutes that I am looking for ways to cut down startup time.

And yeah, no idea if RUSTC_WRAPPER will even have an effect in rustc.

@lnicola
Copy link
Member

lnicola commented Nov 18, 2022

Have you tried the option to disable cache warming?

@RalfJung
Copy link
Member Author

I did, for a bit. Then it seemed like tooltips with type information don't work reliably any more, so I went back to the default.

@RalfJung
Copy link
Member Author

Maybe I should try no cache warming + wrapper + proc macros in rustc again one day. But for now, disabling proc macros gets me pretty far and avoids many potential sources of bugs.^^

@lnicola
Copy link
Member

lnicola commented Nov 18, 2022

That's shouldn't be the case AFAICT. They might be delayed at times, but still work. I hope Code doesn't time them out.

@Veykril
Copy link
Member

Veykril commented Nov 18, 2022

Ye that sounds like a bug to me. Fwiw, we hopefully get rid of the wrapper hack in the (near 🤞) future rust-lang/rfcs#3344

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants