-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Weird mismatched-arg-count lint on gtx_pipeline! macro. #9887
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
It happens when for some reason (wrong type inference/trait solving, wrong macro expansion, unsupported features like const generics) we pick up the wrong function. It would really help if you can extract a reduced test case, but it's all right if you can't or don't have the time. |
This is still happening, and really confusing. Here's a small reproduction: fn foo(s: gfx::TextureSampler<[f32; 4]>) {
let (a, b, c, d);
s.bind_to(a, b, c, d);
} Hovering over bind_to shows
but going to the definition shows the following code: /// The "bind" logic portion of the PSO component.
/// Defines how the user data translates into the raw data set.
pub trait DataBind<R: c::Resources> {
/// The associated "data" type - a member of the PSO "data" struct.
type Data;
/// Dump the given data into the raw data set.
fn bind_to(&self,
&mut RawDataSet<R>,
&Self::Data,
&mut c::handle::Manager<R>,
&mut AccessInfo<R>);
} which clearly takes 4 parameters. I don't understand how we can have two different definitions here. |
The reason for that is that we fail to parse the param list properly here. Because of that error recovery kicks in which parses each path segment as a new parameter, so |
Given anonymous parameters are a hard error since the 2018 edition we could consider this a wontfix if it turns out to be too much work to fix in the parser |
If we do end up with a shared parser, we might have to fix this anyway. |
Well, it might be a wontfix-until-shared-parser then ;) |
|
I'm new-ish to rust and don't know if the error is in the code or in the analyzer.
Opening https://github.com/PistonDevelopers/piston-examples/blob/master/examples/cube.rs in vscode makes rust-analyzer complain about mismatched-arg-count on lines 25-32. The exact message is a bit stranger still:
The message says it expects 7 arguments, but found 4. Neither of these numbers make sense in any way I can think of.
Code of the macro:
Application of the macro:
The text was updated successfully, but these errors were encountered: