-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Thread varargs through rust-analyzer #5378
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -30,7 +30,7 @@ impl ToChalk for Ty { | |||
Ty::Apply(apply_ty) => match apply_ty.ctor { | |||
TypeCtor::Ref(m) => ref_to_chalk(db, m, apply_ty.parameters), | |||
TypeCtor::Array => array_to_chalk(db, apply_ty.parameters), | |||
TypeCtor::FnPtr { num_args: _ } => { | |||
TypeCtor::FnPtr { num_args: _, is_varargs: _ } => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might be a problem since function pointers will lose their varargness if they go through Chalk. should probably be fine for now though, but at least a FIXME would be good. Alternatively, you could do is_varargs: false
here, then the varargs case would be handled by interning the type constructor (basically treating the type like a struct), which would mean that varargness would be preserved, but vararg function pointers wouldn't be treated as function pointers by Chalk.
Chalk issue tracking this: rust-lang/chalk#507
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, FIXME added
bors r=flodiebold |
This adds a varargs flag to various data structures and fills it from the AST.
Fixes #5374
cc @flodiebold for the typesystem/chalk changes