Move deprecations along.

This commit is contained in:
Jonathan M Davis 2015-08-29 17:01:23 -07:00
parent f0bba25aca
commit 7b4abd0aa7
6 changed files with 32 additions and 151 deletions

View file

@ -96,7 +96,7 @@ auto restoredTime = SysTime.fromISOExtString(timeString);
$(WEB en.wikipedia.org/wiki/List_of_tz_database_time_zones, $(WEB en.wikipedia.org/wiki/List_of_tz_database_time_zones,
List of Time Zones)<br> List of Time Zones)<br>
Copyright: Copyright 2010 - 2011 Copyright: Copyright 2010 - 2015
License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0). License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: Jonathan M Davis and Kato Shoichi Authors: Jonathan M Davis and Kato Shoichi
Source: $(PHOBOSSRC std/_datetime.d) Source: $(PHOBOSSRC std/_datetime.d)
@ -685,10 +685,11 @@ public:
assertThrown!DateTimeException(SysTime(DateTime.init, seconds(1), UTC())); assertThrown!DateTimeException(SysTime(DateTime.init, seconds(1), UTC()));
} }
// @@@DEPRECATED_2016-08@@@
/++ /++
$(RED Scheduled for deprecation. Please use the overload which takes a $(RED Deprecated. Please use the overload which takes a
$(CXREF time, Duration) for the fractional seconds. This overload $(CXREF time, Duration) for the fractional seconds. This overload
will be deprecated in 2.068). will be removed in August 2016).
Params: Params:
dateTime = The $(LREF DateTime) to use to set this $(LREF SysTime)'s dateTime = The $(LREF DateTime) to use to set this $(LREF SysTime)'s
@ -702,7 +703,7 @@ public:
Throws: Throws:
$(LREF DateTimeException) if $(D fracSec) is negative. $(LREF DateTimeException) if $(D fracSec) is negative.
+/ +/
//deprecated("Please use the overload which takes a Duration instead of a FracSec.") deprecated("Please use the overload which takes a Duration instead of a FracSec.")
this(in DateTime dateTime, in FracSec fracSec, immutable TimeZone tz = null) @safe this(in DateTime dateTime, in FracSec fracSec, immutable TimeZone tz = null) @safe
{ {
immutable fracHNSecs = fracSec.hnsecs; immutable fracHNSecs = fracSec.hnsecs;
@ -723,7 +724,7 @@ public:
assert(0, "Date, TimeOfDay, or DateTime's constructor threw when it shouldn't have."); assert(0, "Date, TimeOfDay, or DateTime's constructor threw when it shouldn't have.");
} }
/+deprecated+/ unittest deprecated unittest
{ {
import std.format : format; import std.format : format;
@ -2107,15 +2108,16 @@ public:
} }
// @@@DEPRECATED_2016-08@@@
/++ /++
$(RED Scheduled for deprecation. Please use $(LREF fracSecs) instead of $(RED Deprecated. Please use $(LREF fracSecs) instead of fracSec. It
fracSec. It uses a $(CXREF time, Duration) to represent the uses a $(CXREF time, Duration) to represent the fractional seconds
fractional seconds instead of a $(CXREF time, FracSec). This instead of a $(CXREF time, FracSec). This overload will be removed
overload will be deprecated in 2.068). in August 2016).
Fractional seconds past the second. Fractional seconds past the second.
+/ +/
//deprecated("Please use fracSecs (with an s) rather than fracSec (without an s). It returns a Duration instead of a FracSec, as FracSec is being deprecated.") deprecated("Please use fracSecs (with an s) rather than fracSec (without an s). It returns a Duration instead of a FracSec, as FracSec is being deprecated.")
@property FracSec fracSec() @safe const nothrow @property FracSec fracSec() @safe const nothrow
{ {
try try
@ -2133,7 +2135,7 @@ public:
assert(0, "FracSec.from!\"hnsecs\"() threw."); assert(0, "FracSec.from!\"hnsecs\"() threw.");
} }
/+deprecated+/ unittest deprecated unittest
{ {
import std.range; import std.range;
import std.format : format; import std.format : format;
@ -2179,11 +2181,12 @@ public:
} }
// @@@DEPRECATED_2016-08@@@
/++ /++
$(RED Scheduled for deprecation. Please use $(LREF fracSecs) instead of $(RED Deprecated. Please use $(LREF fracSecs) instead of fracSec. It
fracSec. It uses a $(CXREF time, Duration) to represent the uses a $(CXREF time, Duration) to represent the fractional seconds
fractional seconds instead of a $(CXREF time, FracSec). This instead of a $(CXREF time, FracSec). This overload will be removed
overload will be deprecated in 2.068). in August 2016).
Fractional seconds past the second. Fractional seconds past the second.
@ -2194,7 +2197,7 @@ public:
Throws: Throws:
$(LREF DateTimeException) if $(D fracSec) is negative. $(LREF DateTimeException) if $(D fracSec) is negative.
+/ +/
//deprecated("Please use fracSecs (with an s) rather than fracSec (without an s). It takes a Duration instead of a FracSec, as FracSec is being deprecated.") deprecated("Please use fracSecs (with an s) rather than fracSec (without an s). It takes a Duration instead of a FracSec, as FracSec is being deprecated.")
@property void fracSec(FracSec fracSec) @safe @property void fracSec(FracSec fracSec) @safe
{ {
immutable fracHNSecs = fracSec.hnsecs; immutable fracHNSecs = fracSec.hnsecs;
@ -2223,7 +2226,7 @@ public:
adjTime = daysHNSecs + hnsecs; adjTime = daysHNSecs + hnsecs;
} }
/+deprecated+/ unittest deprecated unittest
{ {
import std.range; import std.range;
import std.format : format; import std.format : format;
@ -27766,15 +27769,7 @@ public:
this._utcOffset = utcOffset; this._utcOffset = utcOffset;
} }
/++ // Explicitly undocumented. It will be removed in August 2016. @@@DEPRECATED_2016-08@@@
$(RED Deprecated. Please use the overload which takes a Duration. This
overload will be removed in December 2014).
Params:
utcOffset = This time zone's offset from UTC in minutes with west of
negative (it is added to UTC to get the adjusted time).
stdName = The $(D stdName) for this time zone.
+/
deprecated("Please use the overload which takes a Duration.") deprecated("Please use the overload which takes a Duration.")
this(int utcOffset, string stdName = "") @safe immutable pure this(int utcOffset, string stdName = "") @safe immutable pure
{ {

View file

@ -364,12 +364,7 @@ T enforce(E : Throwable = Exception, T)(T value, lazy const(char)[] msg = null,
return value; return value;
} }
/++ // Explicitly undocumented. It will be removed in August 2016. @@@DEPRECATED_2016-08@@@
$(RED Deprecated. If passing the file or line number explicitly, please use
the overload of enforce which takes them as function arguments. Taking
them as template arguments causes unnecessary template bloat. This
overload will be removed in June 2015.)
+/
deprecated("Use the overload of enforce that takes file and line as function arguments.") deprecated("Use the overload of enforce that takes file and line as function arguments.")
T enforce(T, string file, size_t line = __LINE__) T enforce(T, string file, size_t line = __LINE__)
(T value, lazy const(char)[] msg = null) (T value, lazy const(char)[] msg = null)

View file

@ -3450,14 +3450,6 @@ auto dirEntries(string path, string pattern, SpanMode mode,
return filter!f(DirIterator(path, mode, followSymlink)); return filter!f(DirIterator(path, mode, followSymlink));
} }
// Explicitly undocumented. It will be removed in July 2015.
deprecated("Please use DirEntry constructor directly instead.")
DirEntry dirEntry(in char[] name)
{
return DirEntry(name.idup);
}
unittest unittest
{ {
import std.stdio : writefln; import std.stdio : writefln;

View file

@ -3144,25 +3144,7 @@ version (unittest)
/** // Explicitly undocumented. It will be removed in August 2016. @@@DEPRECATED_2016-08@@@
Execute $(D command) in a _command shell.
$(RED Deprecated. Please use $(LREF spawnShell) or $(LREF executeShell)
instead. This function will be removed in August 2015.)
Returns: If $(D command) is null, returns nonzero if the _command
interpreter is found, and zero otherwise. If $(D command) is not
null, returns -1 on error, or the exit status of command (which may
in turn signal an error in command's execution).
Note: On Unix systems, the homonym C function (which is accessible
to D programs as $(LINK2 core_stdc_stdlib.html, core.stdc.stdlib._system))
returns a code in the same format as $(LUCKY waitpid, waitpid),
meaning that C programs must use the $(D WEXITSTATUS) macro to
extract the actual exit code from the $(D system) call. D's $(D
system) automatically extracts the exit status.
*/
deprecated("Please use wait(spawnShell(command)) or executeShell(command) instead") deprecated("Please use wait(spawnShell(command)) or executeShell(command) instead")
int system(string command) int system(string command)
{ {
@ -3216,6 +3198,7 @@ version(Windows) extern(C) int spawnvp(int, in char *, in char **);
alias P_WAIT = _P_WAIT; alias P_WAIT = _P_WAIT;
alias P_NOWAIT = _P_NOWAIT; alias P_NOWAIT = _P_NOWAIT;
// Explicitly undocumented. It will be removed in August 2016. @@@DEPRECATED_2016-08@@@
deprecated("Please use spawnProcess instead") deprecated("Please use spawnProcess instead")
int spawnvp(int mode, string pathname, string[] argv) int spawnvp(int mode, string pathname, string[] argv)
{ {
@ -3241,6 +3224,7 @@ version (Posix)
private import core.sys.posix.unistd; private import core.sys.posix.unistd;
private import core.sys.posix.sys.wait; private import core.sys.posix.sys.wait;
// Explicitly undocumented. It will be removed in August 2016. @@@DEPRECATED_2016-08@@@
deprecated("Please use spawnProcess instead") deprecated("Please use spawnProcess instead")
int _spawnvp(int mode, in char *pathname, in char **argv) int _spawnvp(int mode, in char *pathname, in char **argv)
{ {
@ -3310,11 +3294,7 @@ version (StdDdoc)
Replaces the current process by executing a command, $(D pathname), with Replaces the current process by executing a command, $(D pathname), with
the arguments in $(D argv). the arguments in $(D argv).
$(RED Deprecated on Windows. From August 2015, these functions will $(BLUE This functions is Posix-Only.)
only be available on POSIX platforms. The reason is that they never
did what the documentation claimed they did, nor is it technically
possible to implement such behaviour on Windows. See below for more
information.)
Typically, the first element of $(D argv) is Typically, the first element of $(D argv) is
the command being executed, i.e. $(D argv[0] == pathname). The 'p' the command being executed, i.e. $(D argv[0] == pathname). The 'p'
@ -3405,6 +3385,7 @@ else
} }
else version (Windows) else version (Windows)
{ {
// Explicitly undocumented. It will be removed in August 2016. @@@DEPRECATED_2016-08@@@
private enum execvDeprecationMsg = private enum execvDeprecationMsg =
"Please consult the API documentation for more information: " "Please consult the API documentation for more information: "
~"http://dlang.org/phobos/std_process.html#.execv"; ~"http://dlang.org/phobos/std_process.html#.execv";
@ -3509,42 +3490,11 @@ else
} // version } // version
} }
/** // Explicitly undocumented. It will be removed in August 2016. @@@DEPRECATED_2016-08@@@
* Returns the process ID of the calling process, which is guaranteed to be
* unique on the system. This call is always successful.
*
* $(RED Deprecated. Please use $(LREF thisProcessID) instead.
* This function will be removed in August 2015.)
*
* Example:
* ---
* writefln("Current process id: %s", getpid());
* ---
*/
deprecated("Please use thisProcessID instead") deprecated("Please use thisProcessID instead")
alias getpid = core.thread.getpid; alias getpid = core.thread.getpid;
/** // Explicitly undocumented. It will be removed in August 2016. @@@DEPRECATED_2016-08@@@
Runs $(D_PARAM cmd) in a shell and returns its standard output. If
the process could not be started or exits with an error code,
throws ErrnoException.
$(RED Deprecated. Please use $(LREF executeShell) instead.
This function will be removed in August 2015.)
Example:
----
auto tempFilename = chomp(shell("mcookie"));
auto f = enforce(fopen(tempFilename), "w");
scope(exit)
{
fclose(f) == 0 || assert(false);
system(escapeShellCommand("rm", tempFilename));
}
... use f ...
----
*/
deprecated("Please use executeShell instead") deprecated("Please use executeShell instead")
string shell(string cmd) string shell(string cmd)
{ {
@ -3598,16 +3548,7 @@ deprecated unittest
assertThrown!ErrnoException(shell(cmd)); assertThrown!ErrnoException(shell(cmd));
} }
/** // Explicitly undocumented. It will be removed in August 2016. @@@DEPRECATED_2016-08@@@
Gets the value of environment variable $(D name) as a string. Calls
$(LINK2 core_stdc_stdlib.html#_getenv, core.stdc.stdlib._getenv)
internally.
$(RED Deprecated. Please use $(LREF environment.opIndex) or
$(LREF environment.get) instead. This function will be
removed in August 2015.)
*/
deprecated("Please use environment.opIndex or environment.get instead") deprecated("Please use environment.opIndex or environment.get instead")
string getenv(in char[] name) nothrow string getenv(in char[] name) nothrow
{ {
@ -3620,16 +3561,7 @@ string getenv(in char[] name) nothrow
return lastResult = value.idup; return lastResult = value.idup;
} }
/** // Explicitly undocumented. It will be removed in August 2016. @@@DEPRECATED_2016-08@@@
Sets the value of environment variable $(D name) to $(D value). If the
value was written, or the variable was already present and $(D
overwrite) is false, returns normally. Otherwise, it throws an
exception. Calls $(LINK2 core_sys_posix_stdlib.html#_setenv,
core.sys.posix.stdlib._setenv) internally.
$(RED Deprecated. Please use $(LREF environment.opIndexAssign) instead.
This function will be removed in August 2015.)
*/
version(StdDdoc) deprecated void setenv(in char[] name, in char[] value, bool overwrite); version(StdDdoc) deprecated void setenv(in char[] name, in char[] value, bool overwrite);
else version(Posix) else version(Posix)
deprecated("Please use environment.opIndexAssign instead.") deprecated("Please use environment.opIndexAssign instead.")
@ -3639,13 +3571,7 @@ else version(Posix)
core.sys.posix.stdlib.setenv(name.tempCString(), value.tempCString(), overwrite) == 0); core.sys.posix.stdlib.setenv(name.tempCString(), value.tempCString(), overwrite) == 0);
} }
/** // Explicitly undocumented. It will be removed in August 2016. @@@DEPRECATED_2016-08@@@
Removes variable $(D name) from the environment. Calls $(LINK2
core_sys_posix_stdlib.html#_unsetenv, core.sys.posix.stdlib._unsetenv) internally.
$(RED Deprecated. Please use $(LREF environment.remove) instead.
This function will be removed in August 2015.)
*/
version(StdDdoc) deprecated void unsetenv(in char[] name); version(StdDdoc) deprecated void unsetenv(in char[] name);
else version(Posix) else version(Posix)
deprecated("Please use environment.remove instead") deprecated("Please use environment.remove instead")

View file

@ -3427,16 +3427,6 @@ public:
return result; return result;
} }
// Explicitly undocumented. It will be removed in December 2014.
deprecated("Please use the overload of select which takes a Duration instead.")
static int select(SocketSet checkRead, SocketSet checkWrite, SocketSet checkError, long microseconds) @trusted
{
TimeVal tv;
tv.seconds = to!(tv.tv_sec_t )(microseconds / 1_000_000);
tv.microseconds = to!(tv.tv_usec_t)(microseconds % 1_000_000);
return select(checkRead, checkWrite, checkError, &tv);
}
/// Returns a new Address object for the current address family. /// Returns a new Address object for the current address family.
/// Can be overridden to support other addresses. /// Can be overridden to support other addresses.

View file

@ -132,16 +132,6 @@ final class ArchiveMember
@property ushort extractVersion() { return _extractVersion; } /// Read Only @property ushort extractVersion() { return _extractVersion; } /// Read Only
@property uint crc32() { return _crc32; } /// Read Only: cyclic redundancy check (CRC) value @property uint crc32() { return _crc32; } /// Read Only: cyclic redundancy check (CRC) value
// Explicitly undocumented. It will be removed in January 2015.
deprecated("Please use fileAttributes instead.")
@property ref inout(ushort) madeVersion() inout @safe pure nothrow
{ return _madeVersion; }
// Explicitly undocumented. It will be removed in January 2015.
deprecated("Please use fileAttributes instead.")
@property ref inout(uint) externalAttributes() inout @safe pure nothrow
{ return _externalAttributes; }
/// Read Only: size of data of member in compressed form. /// Read Only: size of data of member in compressed form.
@property uint compressedSize() { return _compressedSize; } @property uint compressedSize() { return _compressedSize; }
@ -249,13 +239,6 @@ final class ArchiveMember
**/ **/
@property CompressionMethod compressionMethod() { return _compressionMethod; } @property CompressionMethod compressionMethod() { return _compressionMethod; }
// Explicitly undocumented. It will be removed in January 2015.
deprecated("Please use the enum CompressionMethod to set this property instead.")
@property void compressionMethod(ushort cm)
{
compressionMethod = cast(CompressionMethod)(cm);
}
/** /**
* Write compression method used for this member * Write compression method used for this member
* See_Also: * See_Also: