]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: libproc_macro: Change drop rust interface
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Tue, 11 Apr 2023 11:53:13 +0000 (13:53 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:34:11 +0000 (18:34 +0100)
Change rust interface on drop function to take a mut pointer instead.
This will match the drop trait interface more closely.

libgrust/ChangeLog:

* libproc_macro/rust/bridge/ident.rs: Change drop
function interface.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
libgrust/libproc_macro/rust/bridge/ident.rs

index dbfa649d923c0c656493f0cdbe7edd88b16cb1d3..04169a46fad94677451a242d6eade8a927f31259 100644 (file)
@@ -6,7 +6,7 @@ use std::fmt;
 extern "C" {
     fn Ident__new(string: *const c_uchar, len: u64) -> Ident;
     fn Ident__new_raw(string: *const c_uchar, len: u64) -> Ident;
-    fn Ident__drop(ident: *const Ident);
+    fn Ident__drop(ident: *mut Ident);
     fn Ident__clone(ident: *const Ident) -> Ident;
 }
 
@@ -38,7 +38,7 @@ impl Ident {
 
 impl Drop for Ident {
     fn drop(&mut self) {
-        unsafe { Ident__drop(self as *const Ident) }
+        unsafe { Ident__drop(self as *mut Ident) }
     }
 }