turbo_tasks_macros/
lib.rs1#![allow(internal_features)]
2#![feature(proc_macro_diagnostic)]
3#![feature(allow_internal_unstable)]
4#![feature(box_patterns)]
5
6mod assert_fields;
7mod derive;
8mod func;
9mod function_macro;
10mod global_name;
11mod primitive_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(TraceRawVcs, attributes(turbo_tasks))]
27pub fn derive_trace_raw_vcs_attr(input: TokenStream) -> TokenStream {
28 derive::derive_trace_raw_vcs(input)
29}
30
31#[proc_macro_derive(NonLocalValue, attributes(turbo_tasks))]
32pub fn derive_non_local_value_attr(input: TokenStream) -> TokenStream {
33 derive::derive_non_local_value(input)
34}
35
36#[proc_macro_derive(OperationValue, attributes(turbo_tasks))]
37pub fn derive_operation_value_attr(input: TokenStream) -> TokenStream {
38 derive::derive_operation_value(input)
39}
40
41#[proc_macro_derive(ValueDebug, attributes(turbo_tasks))]
42pub fn derive_value_debug_attr(input: TokenStream) -> TokenStream {
43 derive::derive_value_debug(input)
44}
45
46#[proc_macro_derive(ValueDebugFormat, attributes(turbo_tasks))]
47pub fn derive_value_debug_format_attr(input: TokenStream) -> TokenStream {
48 derive::derive_value_debug_format(input)
49}
50
51#[proc_macro_derive(DeterministicHash, attributes(turbo_tasks))]
52pub fn derive_deterministic_hash(input: TokenStream) -> TokenStream {
53 derive::derive_deterministic_hash(input)
54}
55
56#[proc_macro_derive(TaskInput, attributes(turbo_tasks))]
57pub fn derive_task_input(input: TokenStream) -> TokenStream {
58 derive::derive_task_input(input)
59}
60
61#[doc = include_str!("../../turbo-tasks/FORMATTING.md")]
63#[proc_macro_derive(ValueToString, attributes(value_to_string))]
64pub fn derive_value_to_string(input: TokenStream) -> TokenStream {
65 derive::value_to_string_macro::derive_value_to_string(input)
66}
67
68#[proc_macro_attribute]
73pub fn task_storage(_args: TokenStream, input: TokenStream) -> TokenStream {
74 derive::task_storage(input)
75}
76
77#[allow_internal_unstable(min_specialization, into_future, trivial_bounds)]
82#[proc_macro_error]
83#[proc_macro_attribute]
84pub fn value(args: TokenStream, input: TokenStream) -> TokenStream {
85 value_macro::value(args, input)
86}
87
88#[allow_internal_unstable(min_specialization, into_future, trivial_bounds)]
93#[proc_macro_error]
94#[proc_macro_attribute]
95pub fn value_trait(args: TokenStream, input: TokenStream) -> TokenStream {
96 value_trait_macro::value_trait(args, input)
97}
98
99#[allow_internal_unstable(min_specialization, into_future, trivial_bounds)]
100#[proc_macro_error]
101#[proc_macro_attribute]
102pub fn function(args: TokenStream, input: TokenStream) -> TokenStream {
103 function_macro::function(args, input)
104}
105
106#[allow_internal_unstable(min_specialization, into_future, trivial_bounds)]
107#[proc_macro_error]
108#[proc_macro_attribute]
109pub fn test_tt(_args: TokenStream, input: TokenStream) -> TokenStream {
110 derive::derive_value_debug(input)
111}
112
113#[allow_internal_unstable(min_specialization, into_future, trivial_bounds)]
114#[proc_macro_error]
115#[proc_macro_attribute]
116pub fn value_impl(args: TokenStream, input: TokenStream) -> TokenStream {
117 value_impl_macro::value_impl(args, input)
118}
119
120#[allow_internal_unstable(min_specialization, into_future, trivial_bounds)]
121#[proc_macro_error]
122#[proc_macro]
123pub fn primitive(input: TokenStream) -> TokenStream {
124 primitive_macro::primitive(input)
125}
126
127#[doc = include_str!("../../turbo-tasks/FORMATTING.md")]
133#[proc_macro]
134pub fn turbofmt(input: TokenStream) -> TokenStream {
135 turbofmt_macro::turbofmt(input)
136}
137
138#[doc = include_str!("../../turbo-tasks/FORMATTING.md")]
144#[proc_macro]
145pub fn turbobail(input: TokenStream) -> TokenStream {
146 turbofmt_macro::turbobail(input)
147}