Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions glib/src/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ pub unsafe trait ObjectType:
///
/// The trait can only be implemented if the appropriate `ToGlibPtr`
/// implementations exist.
#[diagnostic::on_unimplemented(
message = "the trait `glib::object::IsA<{T}>` is not implemented for `{Self}`",
label = "requires `{Self}` to be a GObject that can be statically cast to `{T}`",
note = "if this is your own object, use the `glib::wrapper!` macro to implement this trait: https://gtk-rs.org/gtk-rs-core/stable/latest/docs/glib/macro.wrapper.html"
)]
pub unsafe trait IsA<T: ObjectType>:
ObjectType + Into<T> + AsRef<T> + std::borrow::Borrow<T>
{
Expand Down
Loading