Remove the AsAny helper trait

Trait upcasting (rust-lang/rust#65991) is stable since Rust 1.86, which
is already the MSRV, so dyn trait objects coerce to dyn Any directly.
Traits that needed AsAny now list Any as their supertrait, and the
as_any module is renamed to casting as only the impl_dyn_casting macro
remains.
This commit is contained in:
Olivier Goffart
2026-07-28 17:29:27 +00:00
parent c5eee2fb52
commit 874a1e31f1
8 changed files with 21 additions and 58 deletions

View File

@@ -5,6 +5,7 @@
//! methods, which return an iterator of [`MonitorHandle`]:
//! - [`ActiveEventLoop::available_monitors`][crate::event_loop::ActiveEventLoop::available_monitors].
//! - [`Window::available_monitors`][crate::window::Window::available_monitors].
use std::any::Any;
use std::borrow::Cow;
use std::fmt;
use std::num::{NonZeroU16, NonZeroU32};
@@ -13,8 +14,6 @@ use std::sync::Arc;
use dpi::{PhysicalPosition, PhysicalSize};
use crate::as_any::AsAny;
/// Handle to a monitor.
///
/// Allows you to retrieve basic information and metadata about a monitor.
@@ -54,7 +53,7 @@ impl PartialEq for MonitorHandle {
impl Eq for MonitorHandle {}
/// Provider of the [`MonitorHandle`].
pub trait MonitorHandleProvider: AsAny + fmt::Debug + Send + Sync {
pub trait MonitorHandleProvider: Any + fmt::Debug + Send + Sync {
/// Identifier for this monitor.
///
/// The representation of this modifier is not guaranteed and should be used only to compare