Skip to content

Commit 3de203e

Browse files
Freax13toku-sa-n
andauthored
add errors section in doc comments
Co-authored-by: Hiroki Tokunaga <[email protected]>
1 parent 11f64f6 commit 3de203e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/registers/control.rs

+4
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,10 @@ mod x86_64 {
254254

255255
impl Cr2 {
256256
/// Read the current page fault linear address from the CR2 register.
257+
///
258+
/// # Errors
259+
///
260+
/// This method returns a [`VirtAddrNotValid`] error if the CR2 register contains a non-canonical address. Call [`Cr2::read_raw`] to handle such cases.
257261
#[inline]
258262
pub fn read() -> Result<VirtAddr, VirtAddrNotValid> {
259263
VirtAddr::try_new(Self::read_raw())

0 commit comments

Comments
 (0)