File 0318-erlang-module-doc-phash-2.patch of Package erlang

From e9fc311f97ed24b1fa21ab173ea0384481448522 Mon Sep 17 00:00:00 2001
From: Kjell Winblad <kjellwinblad@gmail.com>
Date: Thu, 3 Sep 2020 16:21:15 +0200
Subject: [PATCH 18/39] erlang module doc: phash/2

Deprecate and document deprecation
---
 erts/doc/src/erlang.xml              | 7 +++++++
 erts/preloaded/src/erlang.erl        | 1 +
 system/doc/general_info/DEPRECATIONS | 2 ++
 3 files changed, 10 insertions(+)

diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml
index fc96ac3f43..55e1074e30 100644
--- a/erts/doc/src/erlang.xml
+++ b/erts/doc/src/erlang.xml
@@ -4456,6 +4456,13 @@ RealSystem = system + MissedSystem</code>
       <fsummary>Portable hash function.</fsummary>
       <type_desc variable="Range">Range = 1..2^32, Hash = 1..Range</type_desc>
       <desc>
+        <warning>
+          <p>This function is deprecated as <seemfa
+          marker="erlang#phash2/2"><c>erlang:phash2/2</c></seemfa>
+          should be used for new code. Note that
+          <c>erlang:phash(X,N)</c> is not necessary equal to
+          <c>erlang:phash2(X,N)</c></p>
+        </warning>
         <p>Portable hash function that gives the same hash for
           the same Erlang term regardless of machine architecture and
           ERTS version (the BIF was introduced in ERTS 4.9.1.1).
diff --git a/erts/preloaded/src/erlang.erl b/erts/preloaded/src/erlang.erl
index 66695f784b..700b84bf25 100644
--- a/erts/preloaded/src/erlang.erl
+++ b/erts/preloaded/src/erlang.erl
@@ -60,6 +60,7 @@
 -deprecated([{now,0,
               "see the \"Time and Time Correction in Erlang\" "
               "chapter of the ERTS User's Guide for more information"}]).
+-deprecated([{phash,2, "use erlang:phash2/2 instead"}]).
 -removed([{hash,2,"use erlang:phash2/2 instead"}]).
 
 %% Get rid of autoimports of spawn to avoid clashes with ourselves.
diff --git a/system/doc/general_info/DEPRECATIONS b/system/doc/general_info/DEPRECATIONS
index 9df565e797..a3a24affaa 100644
--- a/system/doc/general_info/DEPRECATIONS
+++ b/system/doc/general_info/DEPRECATIONS
@@ -77,6 +77,8 @@ snmpm:async_get_bulk/6 since=23 remove=25
 snmpm:async_get_bulk/7 since=23 remove=25
 snmpm:async_get_bulk/8 since=23 remove=25
 
+erlang:phash/2 since=23
+
 #
 # Added in OTP 22.
 #
-- 
2.26.2

openSUSE Build Service is sponsored by