diff options
Diffstat (limited to 'vendor/derivative/src/paths.rs')
-rw-r--r-- | vendor/derivative/src/paths.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vendor/derivative/src/paths.rs b/vendor/derivative/src/paths.rs new file mode 100644 index 000000000..7a6ec7de3 --- /dev/null +++ b/vendor/derivative/src/paths.rs @@ -0,0 +1,10 @@ +//! Contains some standard paths. + +/// Return the path of the `discriminant` function, that is `::std::mem::discriminant`. +pub fn discriminant_path() -> syn::Path { + if cfg!(feature = "use_core") { + parse_quote!(::core::mem::discriminant) + } else { + parse_quote!(::std::mem::discriminant) + } +}
\ No newline at end of file |