use sealed::sealed; #[sealed] pub trait AsRef where T: ?Sized, { fn as_ref(&self) -> &T; } #[sealed] impl AsRef for String { fn as_ref(&self) -> &str { &*self } } fn main() {}