Arg splat experiment - syntax impl#157605
Conversation
|
Some changes occurred in compiler/rustc_attr_parsing cc @jdonszelmann, @JonathanBrouwer Some changes occurred in compiler/rustc_hir/src/attrs cc @jdonszelmann, @JonathanBrouwer Some changes occurred in compiler/rustc_passes/src/check_attr.rs |
|
r? @TaKO8Ki rustbot has assigned @TaKO8Ki. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
|
||
| impl NoArgsAttributeParser for SplatParser { | ||
| const PATH: &[Symbol] = &[sym::splat]; | ||
| const ON_DUPLICATE: OnDuplicate = OnDuplicate::Warn; |
There was a problem hiding this comment.
Please use (the default value) of Error unless you have a good reason not to
| 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 |
There was a problem hiding this comment.
Attributes on macro calls are currently lost and not placed on the generated item, so this is impossible unless you change that
There was a problem hiding this comment.
I have no reason to change it, so I'll just remove the comment
|
Reminder, once the PR becomes ready for a review, use |
| if let Some(Param { ty, span, .. }) = &fn_decl.inputs.last() { | ||
| if let TyKind::CVarArgs = ty.kind { |
There was a problem hiding this comment.
nitpick, but... let chains time!
View all comments
This PR is part of the argument splatting lang experiment, and FFI overloading / C++ interop project goals:
I've split it from #153697 to make reviewing easier, see that PR for more details.
The PR is the initial implementation of the feature:
splatincomplete feature gate#[splat]attribute on function argumentsOnce this PR merges, I'll rebase #153697.