turbo_tasks_macros/
lib.rs1#![allow(internal_features)]
2#![feature(proc_macro_diagnostic)]
3#![feature(allow_internal_unstable)]
4
5mod assert_fields;
6mod derive;
7mod func;
8mod function_macro;
9mod global_name;
10mod primitive_macro;
11mod task_input_attr_macro;
12mod value_impl_macro;
13mod value_macro;
14mod value_trait_macro;
15
16mod expand;
17mod ident;
18mod primitive_input;
19mod self_filter;
20mod turbofmt_macro;
21mod value_trait_arguments;
22
23use proc_macro::TokenStream;
24use proc_macro_error::proc_macro_error;
25
26#[proc_macro_derive(NonLocalValue, attributes(turbo_tasks))]
27pub fn derive_non_local_value_attr(input: TokenStream) -> TokenStream {
28 derive::derive_non_local_value(input)
29}
30
31#[proc_macro_derive(OperationValue, attributes(turbo_tasks))]
32pub fn derive_operation_value_attr(input: TokenStream) -> TokenStream {
33 derive::derive_operation_value(input)
34}
35
36#[proc_macro_derive(ValueDebug, attributes(turbo_tasks))]
37pub fn derive_value_debug_attr(input: TokenStream) -> TokenStream {
38 derive::derive_value_debug(input)
39}
40
41#[proc_macro_derive(ValueDebugFormat, attributes(turbo_tasks))]
42pub fn derive_value_debug_format_attr(input: TokenStream) -> TokenStream {
43 derive::derive_value_debug_format(input)
44}
45
46#[proc_macro_derive(DeterministicHash, attributes(turbo_tasks))]
47pub fn derive_deterministic_hash(input: TokenStream) -> TokenStream {
48 derive::derive_deterministic_hash(input)
49}
50
51#[doc = include_str!("../../turbo-tasks/FORMATTING.md")]
53#[proc_macro_derive(ValueToString, attributes(value_to_string))]
54pub fn derive_value_to_string(input: TokenStream) -> TokenStream {
55 derive::value_to_string_macro::derive_value_to_string(input)
56}
57
58#[proc_macro_attribute]
63pub fn task_storage(_args: TokenStream, input: TokenStream) -> TokenStream {
64 derive::task_storage(input)
65}
66
67#[allow_internal_unstable(min_specialization, into_future, trivial_bounds)]
72#[proc_macro_error]
73#[proc_macro_attribute]
74pub fn value(args: TokenStream, input: TokenStream) -> TokenStream {
75 value_macro::value(args, input)
76}
77
78#[proc_macro_attribute]
79pub fn task_input(args: TokenStream, input: TokenStream) -> TokenStream {
80 task_input_attr_macro::task_input(args, input)
81}
82
83#[allow_internal_unstable(min_specialization, into_future, trivial_bounds)]
88#[proc_macro_error]
89#[proc_macro_attribute]
90pub fn value_trait(args: TokenStream, input: TokenStream) -> TokenStream {
91 value_trait_macro::value_trait(args, input)
92}
93
94#[allow_internal_unstable(min_specialization, into_future, trivial_bounds)]
95#[proc_macro_error]
96#[proc_macro_attribute]
97pub fn function(args: TokenStream, input: TokenStream) -> TokenStream {
98 function_macro::function(args, input)
99}
100
101#[allow_internal_unstable(min_specialization, into_future, trivial_bounds)]
102#[proc_macro_error]
103#[proc_macro_attribute]
104pub fn test_tt(_args: TokenStream, input: TokenStream) -> TokenStream {
105 derive::derive_value_debug(input)
106}
107
108#[allow_internal_unstable(min_specialization, into_future, trivial_bounds)]
109#[proc_macro_error]
110#[proc_macro_attribute]
111pub fn value_impl(args: TokenStream, input: TokenStream) -> TokenStream {
112 value_impl_macro::value_impl(args, input)
113}
114
115#[allow_internal_unstable(min_specialization, into_future, trivial_bounds)]
116#[proc_macro_error]
117#[proc_macro]
118pub fn primitive(input: TokenStream) -> TokenStream {
119 primitive_macro::primitive(input)
120}
121
122#[doc = include_str!("../../turbo-tasks/FORMATTING.md")]
128#[proc_macro]
129pub fn turbofmt(input: TokenStream) -> TokenStream {
130 turbofmt_macro::turbofmt(input)
131}
132
133#[doc = include_str!("../../turbo-tasks/FORMATTING.md")]
139#[proc_macro]
140pub fn turbobail(input: TokenStream) -> TokenStream {
141 turbofmt_macro::turbobail(input)
142}