about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2023-04-11 21:45:19 +0000
committerMaybe Waffle <waffle.lapkin@gmail.com>2023-04-11 21:45:19 +0000
commitad92677008c23655744c92951c322dc5e453e6f9 (patch)
tree5be064b34438aa44626aedbffda948019b4efaeb /compiler/rustc_data_structures/src
parent12fd610e01bbab0c58170618caf03ac7d9ddb406 (diff)
Fix doc test
Diffstat (limited to 'compiler/rustc_data_structures/src')
-rw-r--r--compiler/rustc_data_structures/src/tagged_ptr.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_data_structures/src/tagged_ptr.rs b/compiler/rustc_data_structures/src/tagged_ptr.rs
index 8ad2b2a41fd..511566bb575 100644
--- a/compiler/rustc_data_structures/src/tagged_ptr.rs
+++ b/compiler/rustc_data_structures/src/tagged_ptr.rs
@@ -60,8 +60,12 @@ pub unsafe trait Pointer: Deref {
     ///
     /// ```rust
     /// # use std::ops::Deref;
-    /// # type Self = &'static u64;
-    /// bits_for::<Self::Target>()
+    /// # use rustc_data_structures::tagged_ptr::bits_for;
+    /// # struct T;
+    /// # impl Deref for T { type Target = u8; fn deref(&self) -> &u8 { &0 } }
+    /// # impl T {
+    /// const BITS: usize = bits_for::<<Self as Deref>::Target>();
+    /// # }
     /// ```
     ///
     /// [`Self::Target`]: Deref::Target