Update library/std/src/io/error/repr_bitpacked.rs

Co-authored-by: the8472 <the8472@users.noreply.github.com>
This commit is contained in:
Thom Chiovoloni
2021-08-10 11:07:30 -07:00
parent 9f7eb7d473
commit 06edf082c3
+1 -1
View File
@@ -214,7 +214,7 @@ unsafe fn decode_repr<C, F>(ptr: NonNull<()>, make_custom: F) -> ErrorData<C>
let kind_bits = (bits >> 32) as u32;
let kind = kind_from_prim(kind_bits).unwrap_or_else(|| {
debug_assert!(false, "Invalid io::error::Repr bits: `Repr({:#018x})`", bits);
// This means the `ptr` passed in was not valid, which voilates
// This means the `ptr` passed in was not valid, which violates
// the unsafe contract of `decode_repr`.
//
// Using this rather than unwrap meaningfully improves the code