Skip to content

Commit eb16919

Browse files
committed
Reorder unsafe macro cases
1 parent 28457db commit eb16919

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

compiler/rustc_feature/src/builtin_attrs.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -183,23 +183,23 @@ macro_rules! template {
183183
}
184184

185185
macro_rules! ungated {
186-
($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr, $encode_cross_crate:expr $(,)?) => {
186+
(unsafe $attr:ident, $typ:expr, $tpl:expr, $duplicates:expr, $encode_cross_crate:expr $(,)?) => {
187187
BuiltinAttribute {
188188
name: sym::$attr,
189189
encode_cross_crate: $encode_cross_crate,
190190
type_: $typ,
191-
safety: AttributeSafety::Normal,
191+
safety: AttributeSafety::Unsafe,
192192
template: $tpl,
193193
gate: Ungated,
194194
duplicates: $duplicates,
195195
}
196196
};
197-
(unsafe $attr:ident, $typ:expr, $tpl:expr, $duplicates:expr, $encode_cross_crate:expr $(,)?) => {
197+
($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr, $encode_cross_crate:expr $(,)?) => {
198198
BuiltinAttribute {
199199
name: sym::$attr,
200200
encode_cross_crate: $encode_cross_crate,
201201
type_: $typ,
202-
safety: AttributeSafety::Unsafe,
202+
safety: AttributeSafety::Normal,
203203
template: $tpl,
204204
gate: Ungated,
205205
duplicates: $duplicates,
@@ -208,45 +208,45 @@ macro_rules! ungated {
208208
}
209209

210210
macro_rules! gated {
211-
($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr, $encode_cross_crate:expr, $gate:ident, $msg:expr $(,)?) => {
211+
(unsafe $attr:ident, $typ:expr, $tpl:expr, $duplicates:expr, $encode_cross_crate:expr, $gate:ident, $msg:expr $(,)?) => {
212212
BuiltinAttribute {
213213
name: sym::$attr,
214214
encode_cross_crate: $encode_cross_crate,
215215
type_: $typ,
216-
safety: AttributeSafety::Normal,
216+
safety: AttributeSafety::Unsafe,
217217
template: $tpl,
218218
duplicates: $duplicates,
219219
gate: Gated(Stability::Unstable, sym::$gate, $msg, cfg_fn!($gate)),
220220
}
221221
};
222-
($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr, $encode_cross_crate:expr, $msg:expr $(,)?) => {
222+
(unsafe $attr:ident, $typ:expr, $tpl:expr, $duplicates:expr, $encode_cross_crate:expr, $msg:expr $(,)?) => {
223223
BuiltinAttribute {
224224
name: sym::$attr,
225225
encode_cross_crate: $encode_cross_crate,
226226
type_: $typ,
227-
safety: AttributeSafety::Normal,
227+
safety: AttributeSafety::Unsafe,
228228
template: $tpl,
229229
duplicates: $duplicates,
230230
gate: Gated(Stability::Unstable, sym::$attr, $msg, cfg_fn!($attr)),
231231
}
232232
};
233-
(unsafe $attr:ident, $typ:expr, $tpl:expr, $duplicates:expr, $encode_cross_crate:expr, $gate:ident, $msg:expr $(,)?) => {
233+
($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr, $encode_cross_crate:expr, $gate:ident, $msg:expr $(,)?) => {
234234
BuiltinAttribute {
235235
name: sym::$attr,
236236
encode_cross_crate: $encode_cross_crate,
237237
type_: $typ,
238-
safety: AttributeSafety::Unsafe,
238+
safety: AttributeSafety::Normal,
239239
template: $tpl,
240240
duplicates: $duplicates,
241241
gate: Gated(Stability::Unstable, sym::$gate, $msg, cfg_fn!($gate)),
242242
}
243243
};
244-
(unsafe $attr:ident, $typ:expr, $tpl:expr, $duplicates:expr, $encode_cross_crate:expr, $msg:expr $(,)?) => {
244+
($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr, $encode_cross_crate:expr, $msg:expr $(,)?) => {
245245
BuiltinAttribute {
246246
name: sym::$attr,
247247
encode_cross_crate: $encode_cross_crate,
248248
type_: $typ,
249-
safety: AttributeSafety::Unsafe,
249+
safety: AttributeSafety::Normal,
250250
template: $tpl,
251251
duplicates: $duplicates,
252252
gate: Gated(Stability::Unstable, sym::$attr, $msg, cfg_fn!($attr)),

0 commit comments

Comments
 (0)