-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Documentation for variadics #15387
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
Merged
alice-i-cecile
merged 21 commits into
bevyengine:main
from
BenjaminBrienen:Add-fake-variadics-to-Reflect-impls
Oct 2, 2024
Merged
Documentation for variadics #15387
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
7bf80dd
documentation for variadics
BenjaminBrienen 2ca4e15
fix error
BenjaminBrienen 6be5d4b
fix error
BenjaminBrienen b86eba7
wip
BenjaminBrienen 194db24
undo
BenjaminBrienen 737cd08
fmt
BenjaminBrienen 3da56be
temp
BenjaminBrienen 1cc17aa
wip
BenjaminBrienen f011ed9
cleanup
BenjaminBrienen 1e6fb99
fix
BenjaminBrienen 4405f16
add unused meta
BenjaminBrienen 819bcf1
doc errors
BenjaminBrienen d9a3b03
fix feature decl
BenjaminBrienen d16b04c
feedback
BenjaminBrienen 5d4351d
fmt
BenjaminBrienen 6292b91
feedback
BenjaminBrienen 06a681a
feedback and fixes
BenjaminBrienen 1d0cbb7
Merge branch 'main' into Add-fake-variadics-to-Reflect-impls
BenjaminBrienen 26bc84d
undo accidental changes
BenjaminBrienen 80e5379
undo strange change
BenjaminBrienen 0e3999d
undo accidental change
BenjaminBrienen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BenjaminBrienen marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -671,6 +671,7 @@ impl_reflect_tuple! {0: A, 1: B, 2: C, 3: D, 4: E, 5: F, 6: G, 7: H, 8: I, 9: J, | |
|
||
macro_rules! impl_type_path_tuple { | ||
($(#[$meta:meta])*) => { | ||
$(#[$meta])* | ||
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. I can remove this if wanted |
||
impl TypePath for () { | ||
fn type_path() -> &'static str { | ||
"()" | ||
|
@@ -732,29 +733,50 @@ all_tuples!( | |
#[cfg(feature = "functions")] | ||
const _: () = { | ||
macro_rules! impl_get_ownership_tuple { | ||
($($name: ident),*) => { | ||
($(#[$meta:meta])* $($name: ident),*) => { | ||
$(#[$meta])* | ||
$crate::func::args::impl_get_ownership!(($($name,)*); <$($name),*>); | ||
}; | ||
} | ||
|
||
all_tuples!(impl_get_ownership_tuple, 0, 12, P); | ||
all_tuples!( | ||
#[doc(fake_variadic)] | ||
impl_get_ownership_tuple, | ||
0, | ||
12, | ||
P | ||
); | ||
|
||
macro_rules! impl_from_arg_tuple { | ||
($($name: ident),*) => { | ||
($(#[$meta:meta])* $($name: ident),*) => { | ||
$(#[$meta])* | ||
$crate::func::args::impl_from_arg!(($($name,)*); <$($name: FromReflect + MaybeTyped + TypePath + GetTypeRegistration),*>); | ||
}; | ||
} | ||
|
||
all_tuples!(impl_from_arg_tuple, 0, 12, P); | ||
all_tuples!( | ||
#[doc(fake_variadic)] | ||
impl_from_arg_tuple, | ||
0, | ||
12, | ||
P | ||
); | ||
|
||
macro_rules! impl_into_return_tuple { | ||
($($name: ident),+) => { | ||
($(#[$meta:meta])* $($name: ident),+) => { | ||
$(#[$meta])* | ||
$crate::func::impl_into_return!(($($name,)*); <$($name: FromReflect + MaybeTyped + TypePath + GetTypeRegistration),*>); | ||
}; | ||
} | ||
|
||
// The unit type (i.e. `()`) is special-cased, so we skip implementing it here. | ||
all_tuples!(impl_into_return_tuple, 1, 12, P); | ||
all_tuples!( | ||
#[doc(fake_variadic)] | ||
impl_into_return_tuple, | ||
1, | ||
12, | ||
P | ||
); | ||
}; | ||
|
||
#[cfg(test)] | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should this only be enabled on
docsrs
and maybedocsrs_dep
to prevent the miniscule chance of it accidentally being depended on elsewhere?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.
That's what I have there, right?
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.
I meant that maybe
internal_features
should also be under acfg_attr
, should have been clearer