Skip to content

Commit d60d6de

Browse files
Don't seal manual traits that correspond to auto-generated types
As those have already the IsA<T> restriction which is an unsafe trait, implemented by the glib::wrapper! macro.
1 parent e4cc065 commit d60d6de

32 files changed

+32
-189
lines changed

gdk4-wayland/src/wayland_surface.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,10 @@ use wayland_client::{backend::ObjectId, protocol::wl_surface::WlSurface, Proxy};
1111
use crate::ffi;
1212
use crate::{prelude::*, WaylandSurface};
1313

14-
mod sealed {
15-
pub trait Sealed {}
16-
impl<T: super::IsA<super::WaylandSurface>> Sealed for T {}
17-
}
18-
1914
// rustdoc-stripper-ignore-next
2015
/// Trait containing manually implemented methods of
2116
/// [`WaylandSurface`](crate::WaylandSurface).
22-
pub trait WaylandSurfaceExtManual: sealed::Sealed + IsA<WaylandSurface> + 'static {
17+
pub trait WaylandSurfaceExtManual: IsA<WaylandSurface> + 'static {
2318
#[doc(alias = "gdk_wayland_surface_get_wl_surface")]
2419
#[doc(alias = "get_wl_surface")]
2520
#[cfg(feature = "wayland_crate")]

gdk4/src/content_provider.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@ use glib::translate::*;
44

55
use crate::{ffi, prelude::*, ContentProvider};
66

7-
mod sealed {
8-
pub trait Sealed {}
9-
impl<T: super::IsA<super::ContentProvider>> Sealed for T {}
10-
}
11-
127
// rustdoc-stripper-ignore-next
138
/// Trait containing manually implemented methods of
149
/// [`ContentProvider`](crate::ContentProvider).
15-
pub trait ContentProviderExtManual: sealed::Sealed + IsA<ContentProvider> {
10+
pub trait ContentProviderExtManual: IsA<ContentProvider> {
1611
#[doc(alias = "gdk_content_provider_get_value")]
1712
fn value(&self, type_: glib::Type) -> Result<glib::Value, glib::Error> {
1813
unsafe {

gdk4/src/display.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,10 @@ impl Backend {
5050
}
5151
}
5252

53-
mod sealed {
54-
pub trait Sealed {}
55-
impl<T: super::IsA<super::Display>> Sealed for T {}
56-
}
57-
5853
// rustdoc-stripper-ignore-next
5954
/// Trait containing manually implemented methods of
6055
/// [`Display`](crate::Display).
61-
pub trait DisplayExtManual: sealed::Sealed + IsA<Display> + 'static {
56+
pub trait DisplayExtManual: IsA<Display> + 'static {
6257
#[doc(alias = "gdk_display_translate_key")]
6358
fn translate_key(
6459
&self,

gdk4/src/drag_surface.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@ use glib::{
99

1010
use crate::{ffi, prelude::*, DragSurface, DragSurfaceSize};
1111

12-
mod sealed {
13-
pub trait Sealed {}
14-
impl<T: super::IsA<super::DragSurface>> Sealed for T {}
15-
}
16-
1712
// rustdoc-stripper-ignore-next
1813
/// Trait containing manually implemented methods of
1914
/// [`DragSurface`](crate::DragSurface).
20-
pub trait DragSurfaceExtManual: sealed::Sealed + IsA<DragSurface> {
15+
pub trait DragSurfaceExtManual: IsA<DragSurface> {
2116
#[cfg(feature = "v4_12")]
2217
#[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
2318
#[doc(alias = "compute-size")]

gdk4/src/draw_context.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@ use glib::translate::*;
44

55
use crate::{prelude::*, DrawContext};
66

7-
mod sealed {
8-
pub trait Sealed {}
9-
impl<T: super::IsA<super::DrawContext>> Sealed for T {}
10-
}
11-
127
// rustdoc-stripper-ignore-next
138
/// Trait containing manually implemented methods of
149
/// [`DrawContext`](crate::DrawContext).
15-
pub trait DrawContextExtManual: sealed::Sealed + IsA<DrawContext> + 'static {
10+
pub trait DrawContextExtManual: IsA<DrawContext> + 'static {
1611
#[doc(alias = "gdk_draw_context_get_frame_region")]
1712
#[doc(alias = "get_frame_region")]
1813
fn frame_region(&self) -> Option<cairo::Region> {

gdk4/src/surface.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@ use glib::translate::*;
44

55
use crate::{ffi, prelude::*, Surface};
66

7-
mod sealed {
8-
pub trait Sealed {}
9-
impl<T: super::IsA<super::Surface>> Sealed for T {}
10-
}
11-
127
// rustdoc-stripper-ignore-next
138
/// Trait containing manually implemented methods of
149
/// [`Surface`](crate::Surface).
15-
pub trait SurfaceExtManual: sealed::Sealed + IsA<Surface> + 'static {
10+
pub trait SurfaceExtManual: IsA<Surface> + 'static {
1611
#[doc(alias = "gdk_surface_create_similar_surface")]
1712
fn create_similar_surface(
1813
&self,

gdk4/src/texture.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@ use glib::translate::*;
44

55
use crate::{ffi, prelude::*, Texture};
66

7-
mod sealed {
8-
pub trait Sealed {}
9-
impl<T: super::IsA<super::Texture>> Sealed for T {}
10-
}
11-
127
// rustdoc-stripper-ignore-next
138
/// Trait containing manually implemented methods of
149
/// [`Texture`](crate::Texture).
15-
pub trait TextureExtManual: sealed::Sealed + IsA<Texture> + 'static {
10+
pub trait TextureExtManual: IsA<Texture> + 'static {
1611
#[doc(alias = "gdk_texture_download")]
1712
fn download(&self, data: &mut [u8], stride: usize) {
1813
unsafe {

gdk4/src/toplevel.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@ use glib::{
99

1010
use crate::{ffi, prelude::*, Toplevel, ToplevelSize};
1111

12-
mod sealed {
13-
pub trait Sealed {}
14-
impl<T: super::IsA<super::Toplevel>> Sealed for T {}
15-
}
16-
1712
// rustdoc-stripper-ignore-next
1813
/// Trait containing manually implemented methods of
1914
/// [`Toplevel`](crate::Toplevel).
20-
pub trait ToplevelExtManual: sealed::Sealed + IsA<Toplevel> {
15+
pub trait ToplevelExtManual: IsA<Toplevel> {
2116
fn connect_compute_size<F: Fn(&Toplevel, &mut ToplevelSize) + 'static>(
2217
&self,
2318
f: F,

gtk4/src/accessible.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ use crate::{
77
AccessibleProperty, AccessibleRelation, AccessibleSort, AccessibleState, AccessibleTristate,
88
Orientation,
99
};
10-
mod sealed {
11-
pub trait Sealed {}
12-
impl<T: super::IsA<super::Accessible>> Sealed for T {}
13-
}
14-
1510
// rustdoc-stripper-ignore-next
1611
/// Trait containing manually implemented methods of
1712
/// [`Accessible`](crate::Accessible).
@@ -30,7 +25,7 @@ mod sealed {
3025
/// gtk::AccessibleInvalidState::Grammar,
3126
/// )]);
3227
/// ```
33-
pub trait AccessibleExtManual: sealed::Sealed + IsA<Accessible> {
28+
pub trait AccessibleExtManual: IsA<Accessible> {
3429
#[doc(alias = "gtk_accessible_update_property")]
3530
#[doc(alias = "gtk_accessible_update_property_value")]
3631
fn update_property(&self, properties: &[Property]) {

gtk4/src/actionable.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@ use glib::{translate::*, Variant};
44

55
use crate::{prelude::*, Actionable};
66

7-
mod sealed {
8-
pub trait Sealed {}
9-
impl<T: super::IsA<super::Actionable>> Sealed for T {}
10-
}
11-
127
// rustdoc-stripper-ignore-next
138
/// Trait containing manually implemented methods of
149
/// [`Actionable`](crate::Actionable).
15-
pub trait ActionableExtManual: sealed::Sealed + IsA<Actionable> + 'static {
10+
pub trait ActionableExtManual: IsA<Actionable> + 'static {
1611
#[doc(alias = "gtk_actionable_set_action_target")]
1712
#[doc(alias = "gtk_actionable_set_action_target_value")]
1813
fn set_action_target(&self, target: Option<impl Into<Variant>>) {

0 commit comments

Comments
 (0)