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(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#[doc = include_str!("../../turbo-tasks/FORMATTING.md")]
58#[proc_macro_derive(ValueToString, attributes(value_to_string))]
59pub fn derive_value_to_string(input: TokenStream) -> TokenStream {
60 derive::value_to_string_macro::derive_value_to_string(input)
61}
62
63#[proc_macro_attribute]
68pub fn task_storage(_args: TokenStream, input: TokenStream) -> TokenStream {
69 derive::task_storage(input)
70}
71
72#[allow_internal_unstable(min_specialization, into_future, trivial_bounds)]
77#[proc_macro_error]
78#[proc_macro_attribute]
79pub fn value(args: TokenStream, input: TokenStream) -> TokenStream {
80 value_macro::value(args, input)
81}
82
83#[proc_macro_attribute]
84pub fn task_input(args: TokenStream, input: TokenStream) -> TokenStream {
85 task_input_attr_macro::task_input(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}