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

Diff for: gdk4-wayland/src/wayland_surface.rs

+1-6
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")]

Diff for: gdk4/src/content_provider.rs

+1-6
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 {

Diff for: gdk4/src/display.rs

+1-6
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,

Diff for: gdk4/src/drag_surface.rs

+1-6
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")]

Diff for: gdk4/src/draw_context.rs

+1-6
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> {

Diff for: gdk4/src/surface.rs

+1-6
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,

Diff for: gdk4/src/texture.rs

+1-6
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 {

Diff for: gdk4/src/toplevel.rs

+1-6
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,

Diff for: gtk4/src/accessible.rs

+1-6
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]) {

Diff for: gtk4/src/actionable.rs

+1-6
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>>) {

Diff for: gtk4/src/cell_area.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,12 @@ use glib::{translate::*, value::FromValue, Value};
44

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

7-
mod sealed {
8-
pub trait Sealed {}
9-
impl<T: super::IsA<super::CellArea>> Sealed for T {}
10-
}
11-
127
// rustdoc-stripper-ignore-next
138
/// Trait containing manually implemented methods of
149
/// [`CellArea`](crate::CellArea).
1510
#[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1611
#[allow(deprecated)]
17-
pub trait CellAreaExtManual: sealed::Sealed + IsA<CellArea> {
12+
pub trait CellAreaExtManual: IsA<CellArea> {
1813
#[doc(alias = "gtk_cell_area_add_with_properties")]
1914
fn add_with_properties(
2015
&self,

Diff for: gtk4/src/cell_layout.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@ use glib::translate::*;
44

55
use crate::{prelude::*, CellLayout, CellRenderer};
66

7-
mod sealed {
8-
pub trait Sealed {}
9-
impl<T: super::IsA<super::CellLayout>> Sealed for T {}
10-
}
117
// rustdoc-stripper-ignore-next
128
/// Trait containing manually implemented methods of
139
/// [`CellLayout`](crate::CellLayout).
1410
#[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1511
#[allow(deprecated)]
16-
pub trait CellLayoutExtManual: sealed::Sealed + IsA<CellLayout> + 'static {
12+
pub trait CellLayoutExtManual: IsA<CellLayout> + 'static {
1713
#[doc(alias = "gtk_cell_layout_set_attributes")]
1814
fn set_attributes(&self, cell: &impl IsA<CellRenderer>, attributes: &[(&str, i32)]) {
1915
self.as_ref().clear_attributes(cell);

Diff for: gtk4/src/color_chooser.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,12 @@ use libc::c_int;
66

77
use crate::{ffi, prelude::*, ColorChooser, Orientation};
88

9-
mod sealed {
10-
pub trait Sealed {}
11-
impl<T: super::IsA<super::ColorChooser>> Sealed for T {}
12-
}
13-
149
// rustdoc-stripper-ignore-next
1510
/// Trait containing manually implemented methods of
1611
/// [`ColorChooser`](crate::ColorChooser).
1712
#[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1813
#[allow(deprecated)]
19-
pub trait ColorChooserExtManual: sealed::Sealed + IsA<ColorChooser> + 'static {
14+
pub trait ColorChooserExtManual: IsA<ColorChooser> + 'static {
2015
#[doc(alias = "gtk_color_chooser_add_palette")]
2116
fn add_palette(&self, orientation: Orientation, colors_per_line: i32, colors: &[RGBA]) {
2217
unsafe {

Diff for: gtk4/src/combo_box.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,12 @@ use glib::translate::*;
44

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

7-
mod sealed {
8-
pub trait Sealed {}
9-
impl<T: super::IsA<super::ComboBox>> Sealed for T {}
10-
}
11-
127
// rustdoc-stripper-ignore-next
138
/// Trait containing manually implemented methods of
149
/// [`ComboBox`](crate::ComboBox).
1510
#[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1611
#[allow(deprecated)]
17-
pub trait ComboBoxExtManual: sealed::Sealed + IsA<ComboBox> + 'static {
12+
pub trait ComboBoxExtManual: IsA<ComboBox> + 'static {
1813
#[doc(alias = "gtk_combo_box_set_row_separator_func")]
1914
#[doc(alias = "set_row_separator_func")]
2015
fn unset_row_separator_func(&self) {

Diff for: gtk4/src/dialog.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,11 @@ impl Dialog {
4141
}
4242
}
4343

44-
mod sealed {
45-
pub trait Sealed {}
46-
impl<T: super::IsA<super::Dialog>> Sealed for T {}
47-
}
48-
4944
// rustdoc-stripper-ignore-next
5045
/// Trait containing manually implemented methods of [`Dialog`](crate::Dialog).
5146
#[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
5247
#[allow(deprecated)]
53-
pub trait DialogExtManual: sealed::Sealed + IsA<Dialog> + 'static {
48+
pub trait DialogExtManual: IsA<Dialog> + 'static {
5449
#[doc(alias = "gtk_dialog_add_buttons")]
5550
fn add_buttons(&self, buttons: &[(&str, ResponseType)]) {
5651
for &(text, id) in buttons {

Diff for: gtk4/src/drawing_area.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,10 @@ use glib::translate::*;
66

77
use crate::{ffi, prelude::*, DrawingArea};
88

9-
mod sealed {
10-
pub trait Sealed {}
11-
impl<T: super::IsA<super::DrawingArea>> Sealed for T {}
12-
}
13-
149
// rustdoc-stripper-ignore-next
1510
/// Trait containing manually implemented methods of
1611
/// [`DrawingArea`](crate::DrawingArea).
17-
pub trait DrawingAreaExtManual: sealed::Sealed + IsA<DrawingArea> + 'static {
12+
pub trait DrawingAreaExtManual: IsA<DrawingArea> + 'static {
1813
#[doc(alias = "gtk_drawing_area_set_draw_func")]
1914
#[doc(alias = "set_draw_func")]
2015
fn unset_draw_func(&self) {

Diff for: gtk4/src/editable.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,11 @@ use glib::{
99
use libc::{c_char, c_int, c_uchar};
1010

1111
use crate::{prelude::*, Editable};
12-
mod sealed {
13-
pub trait Sealed {}
14-
impl<T: super::IsA<super::Editable>> Sealed for T {}
15-
}
1612

1713
// rustdoc-stripper-ignore-next
1814
/// Trait containing manually implemented methods of
1915
/// [`Editable`](crate::Editable).
20-
pub trait EditableExtManual: sealed::Sealed + IsA<Editable> + 'static {
16+
pub trait EditableExtManual: IsA<Editable> + 'static {
2117
fn connect_insert_text<F>(&self, f: F) -> SignalHandlerId
2218
where
2319
F: Fn(&Self, &str, &mut i32) + 'static,

Diff for: gtk4/src/entry.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@ use glib::translate::*;
44

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

7-
mod sealed {
8-
pub trait Sealed {}
9-
impl<T: super::IsA<super::Entry>> Sealed for T {}
10-
}
11-
127
// rustdoc-stripper-ignore-next
138
/// Trait containing manually implemented methods of [`Entry`](crate::Entry).
14-
pub trait EntryExtManual: sealed::Sealed + IsA<Entry> + 'static {
9+
pub trait EntryExtManual: IsA<Entry> + 'static {
1510
#[doc(alias = "gtk_entry_get_invisible_char")]
1611
#[doc(alias = "get_invisible_char")]
1712
fn invisible_char(&self) -> Option<char> {

Diff for: gtk4/src/entry_buffer.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,11 @@ macro_rules! to_u16 {
3030
}
3131
)
3232
}
33-
mod sealed {
34-
pub trait Sealed {}
35-
impl<T: super::IsA<super::EntryBuffer>> Sealed for T {}
36-
}
3733

3834
// rustdoc-stripper-ignore-next
3935
/// Trait containing manually implemented methods of
4036
/// [`EntryBuffer`](crate::EntryBuffer).
41-
pub trait EntryBufferExtManual: sealed::Sealed + IsA<EntryBuffer> + 'static {
37+
pub trait EntryBufferExtManual: IsA<EntryBuffer> + 'static {
4238
#[doc(alias = "gtk_entry_buffer_delete_text")]
4339
fn delete_text(&self, position: u16, n_chars: Option<u16>) -> u16 {
4440
unsafe {

Diff for: gtk4/src/file_chooser.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,12 @@
33
use crate::{ffi, prelude::*, FileChooser};
44
use glib::translate::*;
55

6-
mod sealed {
7-
pub trait Sealed {}
8-
impl<T: super::IsA<super::FileChooser>> Sealed for T {}
9-
}
10-
116
// rustdoc-stripper-ignore-next
127
/// Trait containing manually implemented methods of
138
/// [`FileChooser`](crate::FileChooser).
149
#[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1510
#[allow(deprecated)]
16-
pub trait FileChooserExtManual: sealed::Sealed + IsA<FileChooser> + 'static {
11+
pub trait FileChooserExtManual: IsA<FileChooser> + 'static {
1712
#[doc(alias = "gtk_file_chooser_add_choice")]
1813
fn add_choice(&self, id: impl IntoGStr, label: impl IntoGStr, options: &[(&str, &str)]) {
1914
if options.is_empty() {

Diff for: gtk4/src/font_chooser.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,12 @@ use glib::translate::*;
44

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

7-
mod sealed {
8-
pub trait Sealed {}
9-
impl<T: super::IsA<super::FontChooser>> Sealed for T {}
10-
}
11-
127
// rustdoc-stripper-ignore-next
138
/// Trait containing manually implemented methods of
149
/// [`FontChooser`](crate::FontChooser).
1510
#[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1611
#[allow(deprecated)]
17-
pub trait FontChooserExtManual: sealed::Sealed + IsA<FontChooser> + 'static {
12+
pub trait FontChooserExtManual: IsA<FontChooser> + 'static {
1813
#[doc(alias = "gtk_font_chooser_set_filter_func")]
1914
#[doc(alias = "set_filter_func")]
2015
fn unset_filter_func(&self) {

Diff for: gtk4/src/media_stream.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@ use glib::translate::*;
44

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

7-
mod sealed {
8-
pub trait Sealed {}
9-
impl<T: super::IsA<super::MediaStream>> Sealed for T {}
10-
}
11-
12-
pub trait MediaStreamExtManual: sealed::Sealed + IsA<MediaStream> + 'static {
7+
pub trait MediaStreamExtManual: IsA<MediaStream> + 'static {
138
#[doc(alias = "gtk_media_stream_gerror")]
149
#[doc(alias = "gtk_media_stream_error")]
1510
#[doc(alias = "gerror")]

0 commit comments

Comments
 (0)