Skip to content

Commit db2a069

Browse files
authored
last commit broke the right order of updating attributes (#114)
1 parent 9a411dc commit db2a069

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

compiler/rustc_builtin_macros/src/autodiff.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,6 @@ pub fn expand(
229229
span,
230230
};
231231

232-
// Now update for d_fn
233-
rustc_ad_attr.item.args = rustc_ast::AttrArgs::Delimited(rustc_ast::DelimArgs {
234-
dspan: DelimSpan::dummy(),
235-
delim: rustc_ast::token::Delimiter::Parenthesis,
236-
tokens: ts,
237-
});
238-
attr.kind = ast::AttrKind::Normal(rustc_ad_attr);
239-
240232
// Don't add it multiple times:
241233
let orig_annotatable: Annotatable = match item {
242234
Annotatable::Item(ref mut iitem) => {
@@ -262,6 +254,14 @@ pub fn expand(
262254
}
263255
};
264256

257+
// Now update for d_fn
258+
rustc_ad_attr.item.args = rustc_ast::AttrArgs::Delimited(rustc_ast::DelimArgs {
259+
dspan: DelimSpan::dummy(),
260+
delim: rustc_ast::token::Delimiter::Parenthesis,
261+
tokens: ts,
262+
});
263+
attr.kind = ast::AttrKind::Normal(rustc_ad_attr);
264+
265265
let d_annotatable = if is_impl {
266266
let assoc_item: AssocItemKind = ast::AssocItemKind::Fn(asdf);
267267
let d_fn = P(ast::AssocItem {
@@ -275,7 +275,7 @@ pub fn expand(
275275
});
276276
Annotatable::ImplItem(d_fn)
277277
} else {
278-
let mut d_fn = ecx.item(span, d_ident, thin_vec![attr.clone()], ItemKind::Fn(asdf));
278+
let mut d_fn = ecx.item(span, d_ident, thin_vec![attr.clone(), inline_never], ItemKind::Fn(asdf));
279279
d_fn.vis = vis;
280280
Annotatable::Item(d_fn)
281281
};

0 commit comments

Comments
 (0)