Skip to content

Commit cb53e97

Browse files
Vayun BiyaniVayun Biyani
Vayun Biyani
authored and
Vayun Biyani
committed
Fix enzyme build errors
1 parent ad27045 commit cb53e97

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Diff for: compiler/rustc_builtin_macros/src/autodiff.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ mod llvm_enzyme {
133133
let dcx = ecx.sess.dcx();
134134
// first get the annotable item:
135135
let (sig, is_impl): (FnSig, bool) = match &item {
136-
Annotatable::Item(ref iitem) => {
136+
Annotatable::Item(iitem) => {
137137
let sig = match &iitem.kind {
138138
ItemKind::Fn(box ast::Fn { sig, .. }) => sig,
139139
_ => {
@@ -143,7 +143,7 @@ mod llvm_enzyme {
143143
};
144144
(sig.clone(), false)
145145
}
146-
Annotatable::AssocItem(ref assoc_item, _) => {
146+
Annotatable::AssocItem(assoc_item, _) => {
147147
let sig = match &assoc_item.kind {
148148
ast::AssocItemKind::Fn(box ast::Fn { sig, .. }) => sig,
149149
_ => {
@@ -171,8 +171,8 @@ mod llvm_enzyme {
171171
let sig_span = ecx.with_call_site_ctxt(sig.span);
172172

173173
let (vis, primal) = match &item {
174-
Annotatable::Item(ref iitem) => (iitem.vis.clone(), iitem.ident.clone()),
175-
Annotatable::AssocItem(ref assoc_item, _) => {
174+
Annotatable::Item(iitem) => (iitem.vis.clone(), iitem.ident.clone()),
175+
Annotatable::AssocItem(assoc_item, _) => {
176176
(assoc_item.vis.clone(), assoc_item.ident.clone())
177177
}
178178
_ => {

Diff for: compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ pub use self::Enzyme_AD::*;
4242
#[cfg(llvm_enzyme)]
4343
pub mod Enzyme_AD {
4444
use libc::c_void;
45-
extern "C" {
45+
unsafe extern "C" {
4646
pub fn EnzymeSetCLBool(arg1: *mut ::std::os::raw::c_void, arg2: u8);
4747
}
48-
extern "C" {
48+
unsafe extern "C" {
4949
static mut EnzymePrintPerf: c_void;
5050
static mut EnzymePrintActivity: c_void;
5151
static mut EnzymePrintType: c_void;

0 commit comments

Comments
 (0)