Skip to content
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

Fix index error in parameter conversion codes #631

Merged
merged 1 commit into from
Oct 19, 2019
Merged

Conversation

kngwyu
Copy link
Member

@kngwyu kngwyu commented Oct 15, 2019

Generated codes for argument conversion looks like

let mut output = [None; N];
let arg0 = match output[0] {
...
};

This PR fix this index not to increase for *args and **kwargs.
I hope this PR would fix our build status for the latest nightly.

.iter()
.enumerate()
.map(|(pos, _)| syn::Ident::new(&format!("arg{}", pos), Span::call_site()))
(0..spec.args.len())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just refactoring, not related to the core of this PR.

@@ -461,15 +455,15 @@ pub fn impl_arg_params(spec: &FnSpec<'_>, body: TokenStream) -> TokenStream {

let accept_args = bool_to_ident(spec.accept_args());
let accept_kwargs = bool_to_ident(spec.accept_kwargs());

let num_normal_params = params.len();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just refactoring, too.

@kngwyu kngwyu merged commit 2713977 into PyO3:master Oct 19, 2019
@kngwyu kngwyu deleted the output-fix branch October 19, 2019 03:40
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

Successfully merging this pull request may close these issues.

1 participant