-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Add arg splat experiment initial tuple impl #153697
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
base: main
Are you sure you want to change the base?
Changes from all commits
5c03d8c
b1b2907
0d9e34a
cbd4ea8
3e52f90
69e9a95
5d6888e
8a1dfe1
ede9033
0d3a8d7
0e4aed3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| //! Attribute parsing for the `#[splat]` function argument overloading attribute. | ||
| //! This attribute modifies typecheck to support overload resolution, then modifies codegen for performance. | ||
|
|
||
| use super::prelude::*; | ||
|
|
||
| pub(crate) struct SplatParser; | ||
|
|
||
| impl NoArgsAttributeParser for SplatParser { | ||
| const PATH: &[Symbol] = &[sym::splat]; | ||
| const ON_DUPLICATE: OnDuplicate = OnDuplicate::Warn; | ||
| const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[ | ||
| // FIXME(splat): do we want to allow MacroCall if the macro creates an argument | ||
| Allow(Target::Param), | ||
| ]); | ||
| const CREATE: fn(Span) -> AttributeKind = AttributeKind::Splat; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1136,6 +1136,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { | |
| }; | ||
|
|
||
| // Split the rust-call tupled arguments off. | ||
| // FIXME(splat): un-tuple splatted arguments in codegen, for performance | ||
|
teor2345 marked this conversation as resolved.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why "for performance"? If this follows the RustCall approach, the ABI requires untupling for correctness. I am confused by this comment.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I see, I think I got confused by "splatted MIR lowering and tupling". This doesn't actually do anything on the ABI level yet, it passes things as structs. |
||
| let (first_args, untuple) = if sig.abi() == ExternAbi::RustCall | ||
| && let Some((tup, args)) = args.split_last() | ||
| { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.