Skip to content

Commit

Permalink
Merge pull request #3889 from jmdavis/deprecations
Browse files Browse the repository at this point in the history
Move deprecations along.
  • Loading branch information
JakobOvrum committed Dec 31, 2015
2 parents 13e74e9 + 0899d94 commit 35857ac
Show file tree
Hide file tree
Showing 27 changed files with 147 additions and 135 deletions.
39 changes: 0 additions & 39 deletions std/algorithm/iteration.d
Original file line number Diff line number Diff line change
Expand Up @@ -3285,45 +3285,6 @@ if (is(typeof(binaryFun!pred(r.front, s.front)) : bool)
return ret;
}
}

// Bidirectional functionality as suggested by Brad Roberts.
static if (isBidirectionalRange!Range && isBidirectionalRange!Separator)
{
//Deprecated. It will be removed in December 2015
deprecated("splitter!(Range, Range) cannot be iterated backwards (due to separator overlap).")
@property Range back()
{
ensureBackLength();
return _input[_input.length - _backLength .. _input.length];
}

//Deprecated. It will be removed in December 2015
deprecated("splitter!(Range, Range) cannot be iterated backwards (due to separator overlap).")
void popBack()
{
ensureBackLength();
if (_backLength == _input.length)
{
// done
_input = _input[0 .. 0];
_frontLength = _frontLength.max;
_backLength = _backLength.max;
return;
}
if (_backLength + separatorLength == _input.length)
{
// Special case: popping the first-to-first item; there is
// an empty item right before this. Leave the separator in.
_input = _input[0 .. 0];
_frontLength = 0;
_backLength = 0;
return;
}
// Normal case
_input = _input[0 .. _input.length - _backLength - separatorLength];
_backLength = _backLength.max;
}
}
}

return Result(r, s);
Expand Down
12 changes: 4 additions & 8 deletions std/bitmanip.d
Original file line number Diff line number Diff line change
Expand Up @@ -1239,19 +1239,15 @@ public:
return hash;
}

// @@@DEPRECATED_2016-01@@@
/++
$(RED Deprecated. Please use the constructor instead. This will be
removed in January 2016.)
+/
deprecated("Please use the constructor instead.")
// Explictly undocumented. It will be removed in January 2017. @@@DEPRECATED_2017-01@@@
deprecated("Use the constructor instead.")
void init(bool[] ba) pure nothrow
{
this = BitArray(ba);
}

/// ditto
deprecated("Please use the constructor instead.")
// Explictly undocumented. It will be removed in January 2017. @@@DEPRECATED_2017-01@@@
deprecated("Use the constructor instead.")
void init(void[] v, size_t numbits) pure nothrow
{
this = BitArray(v, numbits);
Expand Down
9 changes: 5 additions & 4 deletions std/c/fenv.d
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
// @@@DEPRECATED_2017-06@@@

/**
* $(RED Deprecated. Please use $(D core.stdc.fenv) instead. This module will
* be removed in December 2015.)
* $(RED Deprecated. Use $(D core.stdc.fenv) instead. This module will be
* removed in June 2017.)
*
* C's <fenv.h>
* Authors: Walter Bright, Digital Mars, http://www.digitalmars.com
* License: Public Domain
* Macros:
* WIKI=Phobos/StdCFenv
*/

/// Please import core.stdc.fenv instead. This module will be deprecated in DMD 2.068.
deprecated("Import core.stdc.fenv instead")
module std.c.fenv;

public import core.stdc.fenv;
12 changes: 7 additions & 5 deletions std/c/freebsd/socket.d
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// Written in the D programming language.

/*
* This module is just for making std.socket work under FreeBSD, and these
* definitions should actually be in druntime. (core.sys.posix.netdb or sth)
*/
/// Please import the core.sys.posix.* modules you need instead. This module will be deprecated in DMD 2.068.
// @@@DEPRECATED_2017-06@@@

/++
$(RED Deprecated. Use the appropriate $(D core.sys.posix.*) modules instead.
This module will be removed in June 2017.)
+/
deprecated("Import the appropriate core.sys.posix.* modules instead")
module std.c.freebsd.socket;

version (FreeBSD):
Expand Down
7 changes: 6 additions & 1 deletion std/c/linux/linux.d
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@@DEPRECATED_2017-06@@@

/* Written by Walter Bright, Christopher E. Miller, and many others.
* http://www.digitalmars.com/d/
Expand All @@ -6,7 +7,11 @@
* countries.
*/

/// Please import the core.sys.posix.* modules you need instead. This module will be deprecated in DMD 2.068.
/++
$(RED Deprecated. Use the appropriate $(D core.sys.posix.*) modules instead.
This module will be removed in June 2017.)
+/
deprecated("Import the appropriate core.sys.posix.* modules instead")
module std.c.linux.linux;

version (linux):
Expand Down
11 changes: 6 additions & 5 deletions std/c/linux/linuxextern.d
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@@DEPRECATED_2017-06@@@

/* Written by Walter Bright.
* www.digitalmars.com
Expand All @@ -6,11 +7,11 @@
* countries.
*/

/* These are all the globals defined by the linux C runtime library.
* Put them separate so they'll be externed - do not link in linuxextern.o
*/

/// Please remove this import. This module is empty and will be deprecated in DMD 2.068.
/++
$(RED Deprecated. Remove this import. This module no longer contains
anything.)
+/
deprecated("This module no longer contains anything. Just remove the import.")
module std.c.linux.linuxextern;

// No longer needed since "extern" storage class
9 changes: 8 additions & 1 deletion std/c/linux/pthread.d
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
// @@@DEPRECATED_2017-06@@@

/* Written by Walter Bright, Christopher E. Miller, and many others.
* www.digitalmars.com
* Placed into public domain.
*/

/// Please import core.sys.posix.pthread or the other core.sys.posix.* modules you need instead. This module will be deprecated in DMD 2.068.
/++
$(RED Deprecated. Use $(core.sys.posix.pthread) or the appropriate
$(D core.sys.posix.*) modules instead. This module will be removed in
June 2017.)
+/
deprecated("Import core.sys.posix.pthread or the appropriate core.sys.posix.* modules instead")
module std.c.linux.pthread;

version (linux):
Expand Down
7 changes: 6 additions & 1 deletion std/c/linux/socket.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
Placed into public domain.
*/

// @@@DEPRECATED_2017-06@@@

/// Please import the core.sys.posix.* modules you need instead. This module will be deprecated in DMD 2.068.
/++
$(RED Deprecated. Use the appropriate $(D core.sys.posix.*) modules instead.
This module will be removed in June 2017.)
+/
deprecated("Import the appropriate core.sys.posix.* modules instead")
module std.c.linux.socket;

version (linux):
Expand Down
7 changes: 6 additions & 1 deletion std/c/linux/termios.d
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// @@@DEPRECATED_2017-06@@@


/// Please import core.sys.posix.termios instead. This module will be deprecated in DMD 2.068.
/++
$(RED Deprecated. Use $(D core.sys.posix.termios) instead. This module will
be removed in June 2017.)
+/
deprecated("Import core.sys.posix.termios instead")
module std.c.linux.termios;

version (linux):
Expand Down
9 changes: 6 additions & 3 deletions std/c/linux/tipc.d
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
// @@@DEPRECATED_2017-06@@@

/**
* $(RED Deprecated. Please use $(D core.sys.linux.tipc) instead. This module
* will be removed in December 2015.)
* $(RED Deprecated. Use $(D core.sys.linux.tipc) instead. This module will be
* removed in June 2017.)
*
* Interface for Linux TIPC sockets, /usr/include/linux/tipc.h
*
* Copyright: Public Domain
* License: Public Domain
* Authors: Leandro Lucarella
*/

/// Please import core.sys.linux.tipc instead. This module will be deprecated in DMD 2.068.
deprecated("Import core.sys.linux.tipc instead")
module std.c.linux.tipc;

public import core.sys.linux.tipc;
9 changes: 6 additions & 3 deletions std/c/locale.d
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
// @@@DEPRECATED_2017-06@@@

/**
* $(RED Deprecated. Please use $(D core.stdc.locale) instead. This module will
* be removed in December 2015.)
* $(RED Deprecated. Use $(D core.stdc.locale) instead. This module will be
* removed in June 2017.)
*
* C's <locale.h>
* License: Public Domain
* Standards:
* ISO/IEC 9899:1999 7.11
* Macros:
* WIKI=Phobos/StdCLocale
*/
/// Please import core.stdc.locale instead. This module will be deprecated in DMD 2.068.
deprecated("Import core.stdc.locale instead")
module std.c.locale;

public import core.stdc.locale;
9 changes: 5 additions & 4 deletions std/c/math.d
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
// @@@DEPRECATED_2017-06@@@

/**
* $(RED Deprecated. Please use $(D core.stdc.math) instead. This module will
* be removed in December 2015.)
* $(RED Deprecated. Use $(D core.stdc.math) instead. This module will be
* removed in June 2017.)
*
* C's <math.h>
* Authors: Walter Bright, Digital Mars, www.digitalmars.com
* License: Public Domain
* Macros:
* WIKI=Phobos/StdCMath
*/

/// Please import core.stdc.math instead. This module will be deprecated in DMD 2.068.
deprecated("Import core.stdc.math instead")
module std.c.math;

public import core.stdc.math;
7 changes: 6 additions & 1 deletion std/c/osx/socket.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
Placed into public domain.
*/

// @@@DEPRECATED_2017-06@@@

/// Please import the core.sys.posix.* modules you need instead. This module will be deprecated in DMD 2.068.
/++
$(RED Deprecated. Use the appropriate $(D core.sys.posix.*) modules instead.
This module will be removed in June 2017.)
+/
deprecated("Import the appropriate core.sys.posix.* instead")
module std.c.osx.socket;

version (OSX):
Expand Down
10 changes: 6 additions & 4 deletions std/c/process.d
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
// @@@DEPRECATED_2017-06@@@

/**
* $(RED Deprecated. Please use $(D core.stdc.stdlib) or the core.sys.posix.*
* modules you need instead. This module will be removed in December 2015.)
* $(RED Deprecated. Use $(D core.stdc.stdlib) or the appropriate
* core.sys.posix.* modules instead. This module will be removed in June
* 2017.)
*
* C's <process.h>
* Authors: Walter Bright, Digital Mars, www.digitalmars.com
* License: Public Domain
* Macros:
* WIKI=Phobos/StdCProcess
*/

/// Please import core.stdc.stdlib or the core.sys.posix.* modules you need instead. This module will be deprecated in DMD 2.068.
deprecated("Import core.stdc.stdlib or the appropriate core.sys.posix.* modules instead")
module std.c.process;

private import core.stdc.stddef;
Expand Down
11 changes: 5 additions & 6 deletions std/c/stdarg.d
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
// @@@DEPRECATED_2017-06@@@

/**
* $(RED Deprecated. Please use $(D core.stdc.stdarg) instead. This module will
* be removed in December 2015.)
* $(RED Deprecated. Use $(D core.stdc.stdarg) instead. This module will be
* removed in June 2017.)
*
* C's <stdarg.h>
* Authors: Hauke Duden and Walter Bright, Digital Mars, www.digitalmars.com
* License: Public Domain
* Macros:
* WIKI=Phobos/StdCStdarg
*/

/* This is for use with extern(C) variable argument lists. */

/// Please import core.stdc.stdarg instead. This module will be deprecated in DMD 2.068.
deprecated("Import core.stdc.stdarg instead")
module std.c.stdarg;

public import core.stdc.stdarg;
9 changes: 5 additions & 4 deletions std/c/stddef.d
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
// @@@DEPRECATED_2017-06@@@

/**
* $(RED Deprecated. Please use $(D core.stdc.stddef) instead. This module will
* be removed in December 2015.)
* $(RED Deprecated. Use $(D core.stdc.stddef) instead. This module will be
* removed in June 2017.)
*
* C's <stddef.h>
* Authors: Walter Bright, Digital Mars, http://www.digitalmars.com
* License: Public Domain
* Macros:
* WIKI=Phobos/StdCStddef
*/

/// Please import core.stdc.stddef instead. This module will be deprecated in DMD 2.068.
deprecated("Import core.stdc.stddef instead")
module std.c.stddef;

public import core.stdc.stddef;
11 changes: 5 additions & 6 deletions std/c/stdio.d
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
// @@@DEPRECATED_2017-06@@@

/**
* $(RED Deprecated. Please use $(D core.stdc.stdio) instead. This module will
* be removed in December 2015.)
* $(RED Deprecated. Use $(D core.stdc.stdio) instead. This module will be
* removed in June 2017.)
*
* C's <stdio.h> for the D programming language
* Authors: Walter Bright, Digital Mars, http://www.digitalmars.com
* License: Public Domain
* Macros:
* WIKI=Phobos/StdCStdio
*/



/// Please import core.stdc.stdio instead. This module will be deprecated in DMD 2.068.
deprecated("Import core.stdc.stdio instead")
module std.c.stdio;

public import core.stdc.stdio;
11 changes: 6 additions & 5 deletions std/c/stdlib.d
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
// @@@DEPRECATED_2017-06@@@

/**
* $(RED Deprecated. Please use $(D core.stdc.stdlib) or $(D core.sys.posix.stdlib)
* instead. This module will be removed in December 2015.)
* $(RED Deprecated. Use $(D core.stdc.stdlib) or $(D core.sys.posix.stdlib)
* instead. This module will be removed in June 2017.)
*
* C's <stdlib.h>
* D Programming Language runtime library
* Authors: Walter Bright, Digital Mars, http://www.digitalmars.com
* License: Public Domain
* Macros:
* WIKI=Phobos/StdCStdlib
*/


/// Please import core.stdc.stdlib or core.sys.posix.stdlib instead. This module will be deprecated in DMD 2.068.
deprecated("Import core.stdc.stdlib or core.sys.posix.stdlib instead")
module std.c.stdlib;

public import core.stdc.stdlib;
Expand Down
Loading

0 comments on commit 35857ac

Please sign in to comment.