Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit ad92677

Browse files
committed
Fix doc test
1 parent 12fd610 commit ad92677

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

compiler/rustc_data_structures/src/tagged_ptr.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ pub unsafe trait Pointer: Deref {
6060
///
6161
/// ```rust
6262
/// # use std::ops::Deref;
63-
/// # type Self = &'static u64;
64-
/// bits_for::<Self::Target>()
63+
/// # use rustc_data_structures::tagged_ptr::bits_for;
64+
/// # struct T;
65+
/// # impl Deref for T { type Target = u8; fn deref(&self) -> &u8 { &0 } }
66+
/// # impl T {
67+
/// const BITS: usize = bits_for::<<Self as Deref>::Target>();
68+
/// # }
6569
/// ```
6670
///
6771
/// [`Self::Target`]: Deref::Target

0 commit comments

Comments
 (0)