-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstdlib-markers.toml
More file actions
240 lines (203 loc) · 7.6 KB
/
stdlib-markers.toml
File metadata and controls
240 lines (203 loc) · 7.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# This file contains a set of markers on stdlib functions that form an allowlist
# of low-level functions to be used in conjunction with the
# --side-effect-markers analysis mode. The functions and modules marked here use
# features that are typically conservatively assumed to be side effects, but in
# this case are vetted and trusted.
#
# Note also that this uses two unstable marker assignment instructions
# (_internal_on_all_module_children and _internal_can_fail_resolve_silently)
# that are considered internal and unstable, meaning their semantics may change
# at any time without warning.
###############################################
# Trusted modules
###############################################
[["alloc::vec"]]
marker = "std:vec"
_internal_can_fail_resolve_silently = true
_internal_on_all_module_children = true
[["alloc::vec"]]
marker = "std:slice"
_internal_can_fail_resolve_silently = true
_internal_on_all_module_children = true
[["core::slice"]]
marker = "std:slice"
_internal_can_fail_resolve_silently = true
_internal_on_all_module_children = true
[["alloc::string"]]
marker = "std:string"
_internal_can_fail_resolve_silently = true
_internal_on_all_module_children = true
[["std::collection::hash_map"]]
marker = "std:hashmap"
_internal_can_fail_resolve_silently = true
_internal_on_all_module_children = true
[["std::collection::btree"]]
marker = "std:btree"
_internal_can_fail_resolve_silently = true
_internal_on_all_module_children = true
# Impls of global allocator.
# "alloc::alloc::\{impl#0\}",
# Since Artem uses regexes this is enough, we use the module and impl instead
[["alloc::alloc::Global"]]
marker = "std:allocation"
_internal_can_fail_resolve_silently = true
_internal_on_all_module_children = true
###############################################
# Allowed Functions
###############################################
# Panicking infrastructure.
[["core::panicking::assert_failed"]]
marker = "std:panic"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
[["core::panicking::const_panic_fmt"]]
marker = "std:panic"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
[["core::panicking::panic"]]
marker = "std:panic"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
[["core::panicking::panic_display"]]
marker = "std:panic"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
[["core::panicking::panic_fmt"]]
marker = "std:panic"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
[["core::panicking::panic_nounwind"]]
marker = "std:panic"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
[["core::panicking::panic_nounwind_fmt"]]
marker = "std:panic"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
# Couldn't find this one in the actual source code
# "core::panicking::panic_str",
[["core::panicking::unreachable_display"]]
marker = "std:panic"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
# Alloc infrastructure.
[["alloc::alloc::alloc"]]
marker = "std:allocation"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
[["alloc::alloc::alloc_zeroed"]]
marker = "std:allocation"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
[["alloc::alloc::dealloc"]]
marker = "std:allocation"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
[["alloc::alloc::realloc"]]
marker = "std:allocation"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
# Since Artem uses regexes this is enough, we use the module and impl instead.
# I was hoping I could just put the impl into the allowed modules, but the parser
# complains, so instead I have the functions separately here.
# "alloc::alloc::\{impl#1\}",
[["<alloc::alloc::Global as alloc::alloc::Allocator>::grow"]]
marker = "std:allocation"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
[["<alloc::alloc::Global as alloc::alloc::Allocator>::deallocate"]]
marker = "std:allocation"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
[["<alloc::alloc::Global as alloc::alloc::Allocator>::shrink"]]
marker = "std:allocation"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
# Alloc error handler.
[["alloc::alloc::__rust_alloc_error_handler"]]
marker = "std:allocation"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
[["<core::ascii::Char as alloc::string::ToString>::to_string"]]
marker = "std:convert"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
[["<char as alloc::string::ToString>::to_string"]]
marker = "std:convert"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
[["<bool as alloc::string::ToString>::to_string"]]
marker = "std:convert"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
[["<u8 as alloc::string::ToString>::to_string"]]
marker = "std:convert"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
[["<i8 as alloc::string::ToString>::to_string"]]
marker = "std:convert"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
[["<alloc::string::String as alloc::string::ToString>::to_string"]]
marker = "std:convert"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
# Can parse, but we don't support the lifetime parameter in *our* resolution code
# "<alloc::borrow::Cow<'_, str> as alloc::string::ToString>::to_string",
# Format strings.
[["core::fmt::Formatter::new"]]
marker = "std:fmt"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
[["alloc::fmt::format"]]
marker = "std:fmt"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true
# "core::fmt::rt::\{impl#1\}::new",
# Rust 1.70 calls to memcmp to compare slices.
# This is removed in further versions.
# "core::slice::cmp::\{extern#0\}::memcmp",
# Architecture-dependent intrinsics.
# "core::core_arch",
# Pointer-address conversion primitives.
# Couldn't find this in the source
# "core::ptr::invalid",
# Couldn't find this in the source
# "core::ptr::invalid_mut",
# This rewrite will likely fail
# "core::ptr::const_ptr::addr", *
# Actually it works parsing wise but gets "UnsupportedType", because it's not a regular ADT type. So needs some more filling in holes in `resolve`.
# "<*const _>::addr",
# This rewrite will likely fail
# "core::ptr::mut_ptr::addr", *
# Same result around resolving this sort of type
# "<*mut _>::addr",
[["core::ptr::alignment::Alignment::new_unchecked"]]
marker = "std:allocation"
on_argument = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
on_return = true
_internal_can_fail_resolve_silently = true