about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-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