From 249a20d972489cf8eb0e9c3b126f358fc1643eb2 Mon Sep 17 00:00:00 2001 From: mlugg Date: Wed, 29 Jan 2025 06:51:23 +0000 Subject: [PATCH] langref: clarify restricted `@memcpy` semantics --- doc/langref.html.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index 2916033a5f..d32f8aeede 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -5120,9 +5120,8 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val

{#syntax#}source{#endsyntax#} must be a slice, a pointer to an array, or a many-item {#link|pointer|Pointers#}. It may have any alignment, and it may have any element type.

-

The {#syntax#}source{#endsyntax#} element type must support {#link|Type Coercion#} - into the {#syntax#}dest{#endsyntax#} element type. The element types may have - different ABI size, however, that may incur a performance penalty.

+

The {#syntax#}source{#endsyntax#} element type must have the same in-memory + representation as the {#syntax#}dest{#endsyntax#} element type.

Similar to {#link|for#} loops, at least one of {#syntax#}source{#endsyntax#} and {#syntax#}dest{#endsyntax#} must provide a length, and if two lengths are provided, they must be equal.