Skip to content

Commit 7de8804

Browse files
author
José Valim
committed
Remove previously deprecated code, enable new deprecations
1 parent 29addf9 commit 7de8804

File tree

12 files changed

+9
-401
lines changed

12 files changed

+9
-401
lines changed

lib/elixir/lib/access.ex

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ defprotocol Access do
4242
"""
4343
@spec get_and_update(t, term, (term -> {get, term})) :: {get, t} when get: var
4444
def get_and_update(container, key, fun)
45-
46-
@doc false
47-
Kernel.def access(container, key) do
48-
get(container, key)
49-
end
5045
end
5146

5247
defimpl Access, for: List do

lib/elixir/lib/application/behaviour.ex

Lines changed: 0 additions & 16 deletions
This file was deleted.

lib/elixir/lib/dict/behaviour.ex

Lines changed: 0 additions & 9 deletions
This file was deleted.

lib/elixir/lib/gen_event/behaviour.ex

Lines changed: 0 additions & 45 deletions
This file was deleted.

lib/elixir/lib/gen_server/behaviour.ex

Lines changed: 0 additions & 43 deletions
This file was deleted.

lib/elixir/lib/kernel.ex

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,6 @@ defmodule Kernel do
220220
:erlang.tuple_to_list(tuple)
221221
end
222222

223-
@doc false
224-
def set_elem(tuple, index, value) do
225-
:erlang.setelement(index + 1, tuple, value)
226-
end
227-
228223
@doc false
229224
def size(arg) do
230225
:erlang.size(arg)
@@ -1202,7 +1197,7 @@ defmodule Kernel do
12021197
end
12031198

12041199
@doc """
1205-
Sets the element in `tuple` at the zero-based `index` to the given `value`.
1200+
Puts the element in `tuple` at the zero-based `index` to the given `value`.
12061201
12071202
Inlined by the compiler.
12081203
@@ -2732,12 +2727,6 @@ defmodule Kernel do
27322727
"""
27332728
defmacro var!(var, context \\ nil)
27342729

2735-
defmacro var!(var, context) when is_atom(var) do
2736-
IO.write :stderr, "passing an atom to var! is deprecated\n" <>
2737-
Exception.format_stacktrace(Macro.Env.stacktrace(__CALLER__))
2738-
do_var!(var, [], context, __CALLER__)
2739-
end
2740-
27412730
defmacro var!({name, meta, atom}, context) when is_atom(name) and is_atom(atom) do
27422731
do_var!(name, meta, context, __CALLER__)
27432732
end
@@ -3271,23 +3260,6 @@ defmodule Kernel do
32713260
end
32723261
end
32733262

3274-
@doc false
3275-
defmacro defexception(name, fields, opts \\ []) do
3276-
{fields, opts} =
3277-
case is_list(fields) and Keyword.get(fields, :do, false) do
3278-
false -> {fields, opts}
3279-
other -> {Keyword.delete(fields, :do), [do: other]}
3280-
end
3281-
3282-
quote do
3283-
fields = unquote(fields)
3284-
Kernel.defmodule unquote(name) do
3285-
defexception fields
3286-
unquote(Keyword.get opts, :do)
3287-
end
3288-
end
3289-
end
3290-
32913263
@doc """
32923264
Defines a protocol.
32933265

lib/elixir/lib/list.ex

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -580,34 +580,6 @@ defmodule List do
580580
end
581581
end
582582

583-
@doc false
584-
def from_char_data(char_data) do
585-
case :unicode.characters_to_list(char_data) do
586-
result when is_list(result) ->
587-
{:ok, result}
588-
589-
{:error, _, _} = error ->
590-
error
591-
592-
{:incomplete, _, _} = incomplete ->
593-
incomplete
594-
end
595-
end
596-
597-
@doc false
598-
def from_char_data!(char_data) do
599-
case :unicode.characters_to_list(char_data) do
600-
result when is_list(result) ->
601-
result
602-
603-
{:error, encoded, rest} ->
604-
raise UnicodeConversionError, encoded: encoded, rest: rest, kind: :invalid
605-
606-
{:incomplete, encoded, rest} ->
607-
raise UnicodeConversionError, encoded: encoded, rest: rest, kind: :incomplete
608-
end
609-
end
610-
611583
## Helpers
612584

613585
# replace_at

lib/elixir/lib/string.ex

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,40 +1356,4 @@ defmodule String do
13561356
def to_float(string) do
13571357
:erlang.binary_to_float(string)
13581358
end
1359-
1360-
@doc false
1361-
def from_char_data(binary) when is_binary(binary) do
1362-
binary
1363-
end
1364-
1365-
def from_char_data(list) when is_list(list) do
1366-
case :unicode.characters_to_binary(list) do
1367-
result when is_binary(result) ->
1368-
{:ok, result}
1369-
1370-
{:error, _, _} = error ->
1371-
error
1372-
1373-
{:incomplete, _, _} = incomplete ->
1374-
incomplete
1375-
end
1376-
end
1377-
1378-
@doc false
1379-
def from_char_data!(binary) when is_binary(binary) do
1380-
binary
1381-
end
1382-
1383-
def from_char_data!(list) when is_list(list) do
1384-
case :unicode.characters_to_binary(list) do
1385-
result when is_binary(result) ->
1386-
result
1387-
1388-
{:error, encoded, rest} ->
1389-
raise UnicodeConversionError, encoded: encoded, rest: rest, kind: :invalid
1390-
1391-
{:incomplete, encoded, rest} ->
1392-
raise UnicodeConversionError, encoded: encoded, rest: rest, kind: :incomplete
1393-
end
1394-
end
13951359
end

0 commit comments

Comments
 (0)