From 2007ec324b2271931ebb71a30ff28d849efe0ada Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 17 Sep 2026 15:55:28 +0200 Subject: [PATCH] Bring back `AsId`, deprecated (#8586) Removing `AsId` broke downstream crates that name the trait in their own bounds or re-exports. It is back, but `#[deprecated]` * https://github.com/emilk/egui/pull/8584 --------- Co-authored-by: Claude Opus 5 --- crates/egui/src/id.rs | 7 +++++++ crates/egui/src/lib.rs | 3 +++ 2 files changed, 10 insertions(+) diff --git a/crates/egui/src/id.rs b/crates/egui/src/id.rs index cab9998d..82f5c17f 100644 --- a/crates/egui/src/id.rs +++ b/crates/egui/src/id.rs @@ -4,6 +4,13 @@ use core::num::NonZeroU64; use crate::{AsIdSalt, IdSalt}; +/// Deprecated +#[deprecated = "Use AsIdSalt or Id instead"] +pub trait AsId: core::hash::Hash + core::fmt::Debug {} + +#[expect(deprecated)] +impl AsId for T {} + /// A (hopefully) unique identity within this application. /// /// egui tracks widgets frame-to-frame using [`Id`]s. diff --git a/crates/egui/src/lib.rs b/crates/egui/src/lib.rs index 0596f9a8..5a88b7ed 100644 --- a/crates/egui/src/lib.rs +++ b/crates/egui/src/lib.rs @@ -505,6 +505,9 @@ pub use self::{ widgets::*, }; +#[expect(deprecated)] +pub use self::id::AsId; + // ---------------------------------------------------------------------------- /// Helper function that adds a label when compiling with debug assertions enabled.