Skip to content

Commit 809971a

Browse files
committed
Remove redundant warnings
1 parent 2539f85 commit 809971a

File tree

2 files changed

+1
-34
lines changed

2 files changed

+1
-34
lines changed

lib/elixir/src/elixir_erl_compiler.erl

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ handle_file_error(File, {Line, Module, Desc}) ->
136136

137137
%% Mention the capture operator in make_fun
138138
custom_format(sys_core_fold, {ignored, {no_effect, {erlang, make_fun, 3}}}) ->
139-
"the result of the capture operator & (:erlang.make_fun/3) is never used";
139+
"the result of the capture operator & (Function.capture/3) is never used";
140140

141141
%% Make no_effect clauses pretty
142142
custom_format(sys_core_fold, {ignored, {no_effect, {erlang, F, A}}}) ->
@@ -162,17 +162,6 @@ custom_format(sys_core_fold, {nomatch, {shadow, Line, {ErlName, ErlArity}}}) ->
162162
[Name, Arity, Line]
163163
);
164164

165-
%% Handle literal eval failures
166-
custom_format(sys_core_fold, {failed, {eval_failure, {Mod, Name, Arity}, Error}}) ->
167-
#{'__struct__' := Struct} = 'Elixir.Exception':normalize(error, Error),
168-
{ExMod, ExName, ExArgs} = elixir_rewrite:erl_to_ex(Mod, Name, lists:duplicate(Arity, nil)),
169-
Call = 'Elixir.Exception':format_mfa(ExMod, ExName, length(ExArgs)),
170-
Trimmed = case Call of
171-
<<"Kernel.", Rest/binary>> -> Rest;
172-
_ -> Call
173-
end,
174-
["the call to ", Trimmed, " will fail with ", elixir_aliases:inspect(Struct)];
175-
176165
custom_format([], Desc) ->
177166
io_lib:format("~p", [Desc]);
178167

lib/elixir/test/elixir/kernel/warning_test.exs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,28 +1241,6 @@ defmodule Kernel.WarningTest do
12411241
purge(Sample)
12421242
end
12431243

1244-
test "eval failure warning" do
1245-
assert_warn_eval(
1246-
["nofile:2\n", "the call to Atom.to_string/1 will fail with ArgumentError"],
1247-
"""
1248-
defmodule Sample1 do
1249-
def foo, do: Atom.to_string "abc"
1250-
end
1251-
"""
1252-
)
1253-
1254-
assert_warn_eval(
1255-
["nofile:2\n", "the call to +/2 will fail with ArithmeticError"],
1256-
"""
1257-
defmodule Sample2 do
1258-
def foo, do: 1 + nil
1259-
end
1260-
"""
1261-
)
1262-
after
1263-
purge([Sample1, Sample2])
1264-
end
1265-
12661244
test "undefined function for behaviour" do
12671245
assert_warn_eval(
12681246
[

0 commit comments

Comments
 (0)