File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,14 @@ pub const fn identity<T>(x: T) -> T {
150150/// follows:
151151///
152152/// ```
153+ /// # use core::ops::Deref;
154+ /// # struct SomeType;
155+ /// # impl Deref for SomeType {
156+ /// # type Target = [u8];
157+ /// # fn deref(&self) -> &[u8] {
158+ /// # &[]
159+ /// # }
160+ /// # }
153161/// impl<T> AsRef<T> for SomeType
154162/// where
155163/// T: ?Sized,
@@ -245,6 +253,19 @@ pub trait AsRef<T: ?Sized> {
245253/// implementation of `AsMut` as follows:
246254///
247255/// ```
256+ /// # use core::ops::{Deref, DerefMut};
257+ /// # struct SomeType;
258+ /// # impl Deref for SomeType {
259+ /// # type Target = [u8];
260+ /// # fn deref(&self) -> &[u8] {
261+ /// # &[]
262+ /// # }
263+ /// # }
264+ /// # impl DerefMut for SomeType {
265+ /// # fn deref_mut(&mut self) -> &mut [u8] {
266+ /// # &mut []
267+ /// # }
268+ /// # }
248269/// impl<T> AsMut<T> for SomeType
249270/// where
250271/// <SomeType as Deref>::Target: AsMut<T>,
You can’t perform that action at this time.
0 commit comments