From 0516e3c1a90e973d5c7678775e87d41af3d80073 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 26 Sep 2022 17:17:13 +0200 Subject: [PATCH] 'read' is not covered yet (needs a PR to land) --- personal/_posts/2022-09-26-cargo-careful.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/personal/_posts/2022-09-26-cargo-careful.md b/personal/_posts/2022-09-26-cargo-careful.md index 234b8d4..28a85c9 100644 --- a/personal/_posts/2022-09-26-cargo-careful.md +++ b/personal/_posts/2022-09-26-cargo-careful.md @@ -5,7 +5,7 @@ reddit: /rust/comments/xogayv/cargo_careful_run_your_rust_code_with_extra/ --- Did you know that the standard library is full of useful checks that users never get to see? -There are plenty of debug assertions in the standard library that will do things like check that `char::from_u32_unchecked` is called on a valid `char`, that `CStr::from_bytes_with_nul_unchecked` does not have internal nul bytes, or that pointer functions such as `read`, `copy`, or `copy_nonoverlapping` are called on suitably aligned non-null (and non-overlapping) pointers. +There are plenty of debug assertions in the standard library that will do things like check that `char::from_u32_unchecked` is called on a valid `char`, that `CStr::from_bytes_with_nul_unchecked` does not have internal nul bytes, or that pointer functions such as `copy` or `copy_nonoverlapping` are called on suitably aligned non-null (and non-overlapping) pointers. However, the regular standard library that is distributed by rustup is compiled without debug assertions, so there is no easy way for users to benefit from all this extra checking. -- 2.30.2