File 2534-compiler-Add-doc-support-for-deprecate_callback.patch of Package erlang
From d21abaa2486479ec52b635c265270fe69f881648 Mon Sep 17 00:00:00 2001
From: Lukas Larsson <lukas@erlang.org>
Date: Wed, 28 Feb 2024 15:59:56 +0100
Subject: [PATCH 4/6] compiler: Add doc support for deprecate_callback
---
bootstrap/lib/compiler/ebin/beam_doc.beam | Bin 21636 -> 21752 bytes
bootstrap/lib/stdlib/ebin/erl_lint.beam | Bin 93472 -> 108092 bytes
lib/compiler/src/beam_doc.erl | 22 +++++++++++-------
lib/compiler/test/beam_doc_SUITE.erl | 9 ++++---
.../test/beam_doc_SUITE_data/deprecated.erl | 11 +++++++++
lib/stdlib/src/erl_lint.erl | 6 +++++
6 files changed, 37 insertions(+), 11 deletions(-)
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl
index 1a5cdd51dc..4450b87a2d 100644
--- a/lib/stdlib/src/erl_lint.erl
+++ b/lib/stdlib/src/erl_lint.erl
@@ -357,6 +357,12 @@ format_error({deprecated_type, {M1, F1, A1}, String, Rel}) ->
format_error({deprecated_type, {M1, F1, A1}, String}) when is_list(String) ->
io_lib:format("the type ~p:~p~s is deprecated; ~s",
[M1, F1, gen_type_paren(A1), String]);
+format_error({deprecated_callback, {M1, F1, A1}, String, Rel}) ->
+ io_lib:format("the callback ~p:~p~s is deprecated and will be removed in ~s; ~s",
+ [M1, F1, gen_type_paren(A1), Rel, String]);
+format_error({deprecated_callback, {M1, F1, A1}, String}) when is_list(String) ->
+ io_lib:format("the callback ~p:~p~s is deprecated; ~s",
+ [M1, F1, gen_type_paren(A1), String]);
format_error({removed, MFA, ReplacementMFA, Rel}) ->
io_lib:format("call to ~s will fail, since it was removed in ~s; "
"use ~s", [format_mfa(MFA), Rel, format_mfa(ReplacementMFA)]);
--
2.35.3