Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bd7f422

Browse files
authoredOct 29, 2023
Rollup merge of rust-lang#117312 - RalfJung:memcpy-assumptions, r=Mark-Simulacrum
memcpy assumptions: link to source showing that GCC makes the same assumption I finally stumbled upon a source showing that GCC also generates overlapping `memcpy`. So if we're linking major C compilers making such assumptions here, let's have both clang and GCC.
2 parents 0267cbe + b329c69 commit bd7f422

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎library/core/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
//! assumptions about their semantics: For `memcpy`, `memmove`, `memset`, `memcmp`, and `bcmp`, if
2727
//! the `n` parameter is 0, the function is assumed to not be UB. Furthermore, for `memcpy`, if
2828
//! source and target pointer are equal, the function is assumed to not be UB.
29-
//! (Note that these are [standard assumptions](https://reviews.llvm.org/D86993) among compilers.)
29+
//! (Note that these are standard assumptions among compilers:
30+
//! [clang](https://reviews.llvm.org/D86993) and [GCC](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32667) do the same.)
3031
//! These functions are often provided by the system libc, but can also be provided by the
3132
//! [compiler-builtins crate](https://crates.io/crates/compiler_builtins).
3233
//! Note that the library does not guarantee that it will always make these assumptions, so Rust

0 commit comments

Comments
 (0)
Please sign in to comment.