Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Commit a282058

Browse files
author
Matteo Biggio
committed
glib: make RefCounted trait unsafe
1 parent b9f423a commit a282058

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

glib/src/subclass/shared.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
use crate::translate::*;
66

7-
pub trait RefCounted: Clone + Sized + 'static {
7+
pub unsafe trait RefCounted: Clone + Sized + 'static {
88
/// The inner type
99
type InnerType;
1010

@@ -18,7 +18,7 @@ pub trait RefCounted: Clone + Sized + 'static {
1818
unsafe fn from_raw(this: *const Self::InnerType) -> Self;
1919
}
2020

21-
impl<T> RefCounted for std::sync::Arc<T>
21+
unsafe impl<T> RefCounted for std::sync::Arc<T>
2222
where
2323
T: 'static,
2424
{
@@ -38,7 +38,7 @@ where
3838
}
3939
}
4040

41-
impl<T> RefCounted for std::rc::Rc<T>
41+
unsafe impl<T> RefCounted for std::rc::Rc<T>
4242
where
4343
T: 'static,
4444
{

0 commit comments

Comments
 (0)