DIP25: make phobos work with it

This commit is contained in:
Walter Bright 2015-01-29 23:47:32 -08:00
parent 8969ae9d51
commit dc302d26a4
13 changed files with 91 additions and 91 deletions

View file

@ -136,7 +136,7 @@ ifneq (,$(filter cc% gcc% clang% icc% egcc%, $(CC)))
endif endif
# Set DFLAGS # Set DFLAGS
DFLAGS=-I$(DRUNTIME_PATH)/import $(DMDEXTRAFLAGS) -w -m$(MODEL) $(PIC) DFLAGS=-I$(DRUNTIME_PATH)/import $(DMDEXTRAFLAGS) -w -dip25 -m$(MODEL) $(PIC)
ifeq ($(BUILD),debug) ifeq ($(BUILD),debug)
DFLAGS += -g -debug DFLAGS += -g -debug
else else

View file

@ -17,25 +17,25 @@ $(TR $(TH Category) $(TH Submodule) $(TH Functions)
$(TR $(TDNW Searching) $(TR $(TDNW Searching)
$(TDNW $(SUBMODULE searching)) $(TDNW $(SUBMODULE searching))
$(TD $(TD
$(SUBREF searching, all) $(SUBREF searching, all)
$(SUBREF searching, any) $(SUBREF searching, any)
$(SUBREF searching, balancedParens) $(SUBREF searching, balancedParens)
$(SUBREF searching, boyerMooreFinder) $(SUBREF searching, boyerMooreFinder)
$(SUBREF searching, canFind) $(SUBREF searching, canFind)
$(SUBREF searching, commonPrefix) $(SUBREF searching, commonPrefix)
$(SUBREF searching, count) $(SUBREF searching, count)
$(SUBREF searching, countUntil) $(SUBREF searching, countUntil)
$(SUBREF searching, endsWith) $(SUBREF searching, endsWith)
$(SUBREF searching, find) $(SUBREF searching, find)
$(SUBREF searching, findAdjacent) $(SUBREF searching, findAdjacent)
$(SUBREF searching, findAmong) $(SUBREF searching, findAmong)
$(SUBREF searching, findSkip) $(SUBREF searching, findSkip)
$(SUBREF searching, findSplit) $(SUBREF searching, findSplit)
$(SUBREF searching, findSplitAfter) $(SUBREF searching, findSplitAfter)
$(SUBREF searching, findSplitBefore) $(SUBREF searching, findSplitBefore)
$(SUBREF searching, minCount) $(SUBREF searching, minCount)
$(SUBREF searching, minPos) $(SUBREF searching, minPos)
$(SUBREF searching, skipOver) $(SUBREF searching, skipOver)
$(SUBREF searching, startsWith) $(SUBREF searching, startsWith)
$(SUBREF searching, until) $(SUBREF searching, until)
) )
@ -58,73 +58,73 @@ $(TR $(TDNW Comparison)
) )
$(TR $(TDNW Iteration) $(TR $(TDNW Iteration)
$(TDNW $(SUBMODULE iteration)) $(TDNW $(SUBMODULE iteration))
$(TD $(TD
$(SUBREF iteration, aggregate) $(SUBREF iteration, aggregate)
$(SUBREF iteration, cache) $(SUBREF iteration, cache)
$(SUBREF iteration, cacheBidirectional) $(SUBREF iteration, cacheBidirectional)
$(SUBREF iteration, each) $(SUBREF iteration, each)
$(SUBREF iteration, filter) $(SUBREF iteration, filter)
$(SUBREF iteration, filterBidirectional) $(SUBREF iteration, filterBidirectional)
$(SUBREF iteration, group) $(SUBREF iteration, group)
$(SUBREF iteration, groupBy) $(SUBREF iteration, groupBy)
$(SUBREF iteration, joiner) $(SUBREF iteration, joiner)
$(SUBREF iteration, map) $(SUBREF iteration, map)
$(SUBREF iteration, reduce) $(SUBREF iteration, reduce)
$(SUBREF iteration, splitter) $(SUBREF iteration, splitter)
$(SUBREF iteration, sum) $(SUBREF iteration, sum)
$(SUBREF iteration, uniq) $(SUBREF iteration, uniq)
) )
) )
$(TR $(TDNW Sorting) $(TR $(TDNW Sorting)
$(TDNW $(SUBMODULE sorting)) $(TDNW $(SUBMODULE sorting))
$(TD $(TD
$(SUBREF sorting, completeSort) $(SUBREF sorting, completeSort)
$(SUBREF sorting, isPartitioned) $(SUBREF sorting, isPartitioned)
$(SUBREF sorting, isSorted) $(SUBREF sorting, isSorted)
$(SUBREF sorting, makeIndex) $(SUBREF sorting, makeIndex)
$(SUBREF sorting, multiSort) $(SUBREF sorting, multiSort)
$(SUBREF sorting, nextEvenPermutation) $(SUBREF sorting, nextEvenPermutation)
$(SUBREF sorting, nextPermutation) $(SUBREF sorting, nextPermutation)
$(SUBREF sorting, partialSort) $(SUBREF sorting, partialSort)
$(SUBREF sorting, partition) $(SUBREF sorting, partition)
$(SUBREF sorting, partition3) $(SUBREF sorting, partition3)
$(SUBREF sorting, schwartzSort) $(SUBREF sorting, schwartzSort)
$(SUBREF sorting, sort) $(SUBREF sorting, sort)
$(SUBREF sorting, topN) $(SUBREF sorting, topN)
$(SUBREF sorting, topNCopy) $(SUBREF sorting, topNCopy)
$(SUBREF sorting, topNIndex) $(SUBREF sorting, topNIndex)
) )
) )
$(TR $(TDNW Set operations) $(TR $(TDNW Set operations)
$(TDNW $(SUBMODULE setops)) $(TDNW $(SUBMODULE setops))
$(TD $(TD
$(SUBREF setops, cartesianProduct) $(SUBREF setops, cartesianProduct)
$(SUBREF setops, largestPartialIntersection) $(SUBREF setops, largestPartialIntersection)
$(SUBREF setops, largestPartialIntersectionWeighted) $(SUBREF setops, largestPartialIntersectionWeighted)
$(SUBREF setops, nWayUnion) $(SUBREF setops, nWayUnion)
$(SUBREF setops, setDifference) $(SUBREF setops, setDifference)
$(SUBREF setops, setIntersection) $(SUBREF setops, setIntersection)
$(SUBREF setops, setSymmetricDifference) $(SUBREF setops, setSymmetricDifference)
$(SUBREF setops, setUnion) $(SUBREF setops, setUnion)
) )
) )
$(TR $(TDNW Mutation) $(TR $(TDNW Mutation)
$(TDNW $(SUBMODULE mutation)) $(TDNW $(SUBMODULE mutation))
$(TD $(TD
$(SUBREF mutation, bringToFront) $(SUBREF mutation, bringToFront)
$(SUBREF mutation, copy) $(SUBREF mutation, copy)
$(SUBREF mutation, fill) $(SUBREF mutation, fill)
$(SUBREF mutation, initializeAll) $(SUBREF mutation, initializeAll)
$(SUBREF mutation, move) $(SUBREF mutation, move)
$(SUBREF mutation, moveAll) $(SUBREF mutation, moveAll)
$(SUBREF mutation, moveSome) $(SUBREF mutation, moveSome)
$(SUBREF mutation, remove) $(SUBREF mutation, remove)
$(SUBREF mutation, reverse) $(SUBREF mutation, reverse)
$(SUBREF mutation, strip) $(SUBREF mutation, strip)
$(SUBREF mutation, stripLeft) $(SUBREF mutation, stripLeft)
$(SUBREF mutation, stripRight) $(SUBREF mutation, stripRight)
$(SUBREF mutation, swap) $(SUBREF mutation, swap)
$(SUBREF mutation, swapRanges) $(SUBREF mutation, swapRanges)
$(SUBREF mutation, uninitializedFill) $(SUBREF mutation, uninitializedFill)
) )
) )
@ -293,7 +293,7 @@ template forward(args...)
@safe unittest @safe unittest
{ {
ref int foo(ref int a) { return a; } ref int foo(return ref int a) { return a; }
ref int bar(Args)(auto ref Args args) ref int bar(Args)(auto ref Args args)
{ {
return foo(forward!args); return foo(forward!args);

View file

@ -4610,7 +4610,7 @@ version(unittest)
{ {
int j; int j;
__std_conv_S s; __std_conv_S s;
ref __std_conv_S foo() @property {s.i = j; return s;} ref __std_conv_S foo() return @property {s.i = j; return s;}
alias foo this; alias foo this;
} }
static assert(is(__std_conv_SS : __std_conv_S)); static assert(is(__std_conv_SS : __std_conv_S));

View file

@ -745,7 +745,7 @@ public:
Params: Params:
rhs = The $(LREF SysTime) to assign to this one. rhs = The $(LREF SysTime) to assign to this one.
+/ +/
ref SysTime opAssign(const ref SysTime rhs) @safe pure nothrow ref SysTime opAssign(const ref SysTime rhs) return @safe pure nothrow
{ {
_stdTime = rhs._stdTime; _stdTime = rhs._stdTime;
_timezone = rhs._timezone; _timezone = rhs._timezone;
@ -757,7 +757,7 @@ public:
Params: Params:
rhs = The $(LREF SysTime) to assign to this one. rhs = The $(LREF SysTime) to assign to this one.
+/ +/
ref SysTime opAssign(SysTime rhs) @safe pure nothrow ref SysTime opAssign(SysTime rhs) return @safe pure nothrow
{ {
_stdTime = rhs._stdTime; _stdTime = rhs._stdTime;
_timezone = rhs._timezone; _timezone = rhs._timezone;
@ -8151,7 +8151,7 @@ public:
+/ +/
static SysTime fromISOString(S)(in S isoString, immutable TimeZone tz = null) @safe static SysTime fromISOString(S)(in S isoString, immutable TimeZone tz = null) @safe
if(isSomeString!S) if(isSomeString!S)
{ {
import std.string : strip; import std.string : strip;
import std.conv : to; import std.conv : to;
import std.algorithm : startsWith, find; import std.algorithm : startsWith, find;
@ -12641,7 +12641,7 @@ public:
import std.conv : to; import std.conv : to;
import std.algorithm : all, startsWith; import std.algorithm : all, startsWith;
import std.format : format; import std.format : format;
auto dstr = to!dstring(strip(isoExtString)); auto dstr = to!dstring(strip(isoExtString));
enforce(dstr.length >= 10, new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString))); enforce(dstr.length >= 10, new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
@ -12948,7 +12948,7 @@ private:
Params: Params:
days = The number of days to add to this Date. days = The number of days to add to this Date.
+/ +/
ref Date _addDays(long days) @safe pure nothrow ref Date _addDays(long days) return @safe pure nothrow
{ {
dayOfGregorianCal = cast(int)(dayOfGregorianCal + days); dayOfGregorianCal = cast(int)(dayOfGregorianCal + days);
return this; return this;
@ -14223,7 +14223,7 @@ private:
Params: Params:
seconds = The number of seconds to add to this TimeOfDay. seconds = The number of seconds to add to this TimeOfDay.
+/ +/
ref TimeOfDay _addSeconds(long seconds) @safe pure nothrow ref TimeOfDay _addSeconds(long seconds) return @safe pure nothrow
{ {
long hnsecs = convert!("seconds", "hnsecs")(seconds); long hnsecs = convert!("seconds", "hnsecs")(seconds);
hnsecs += convert!("hours", "hnsecs")(_hour); hnsecs += convert!("hours", "hnsecs")(_hour);
@ -17145,7 +17145,7 @@ private:
Params: Params:
seconds = The number of seconds to add to this $(LREF DateTime). seconds = The number of seconds to add to this $(LREF DateTime).
+/ +/
ref DateTime _addSeconds(long seconds) @safe pure nothrow ref DateTime _addSeconds(long seconds) return @safe pure nothrow
{ {
long hnsecs = convert!("seconds", "hnsecs")(seconds); long hnsecs = convert!("seconds", "hnsecs")(seconds);
hnsecs += convert!("hours", "hnsecs")(_tod._hour); hnsecs += convert!("hours", "hnsecs")(_tod._hour);
@ -31070,7 +31070,7 @@ unittest
import std.string; import std.string;
import std.typecons; import std.typecons;
import std.typetuple; import std.typetuple;
static struct Rand3Letters static struct Rand3Letters
{ {
enum empty = false; enum empty = false;

View file

@ -551,7 +551,7 @@ ulong getSize(in char[] name) @safe
{ {
return stat(path.tempCString(), buf); return stat(path.tempCString(), buf);
} }
static stat_t* ptrOfLocalVariable(ref stat_t buf) @trusted static stat_t* ptrOfLocalVariable(return ref stat_t buf) @trusted
{ {
return &buf; return &buf;
} }

View file

@ -38,7 +38,7 @@ struct FullCaseEntry
ubyte n, size;// n number in batch, size - size of batch ubyte n, size;// n number in batch, size - size of batch
ubyte entry_len; ubyte entry_len;
@property auto value() const @trusted pure nothrow @nogc @property auto value() const @trusted pure nothrow @nogc return
{ {
return seq[0..entry_len]; return seq[0..entry_len];
} }

View file

@ -555,7 +555,7 @@ unittest
char c; char c;
enum empty = false; enum empty = false;
void popFront(){}; void popFront(){};
ref char front() @property ref char front() return @property
{ {
return c; return c;
} }
@ -1856,8 +1856,8 @@ ElementType!R moveBack(R)(R r)
int payload = 5; int payload = 5;
@property bool empty() { return false; } @property bool empty() { return false; }
@property TestRange save() { return this; } @property TestRange save() { return this; }
@property ref int front() { return payload; } @property ref int front() return { return payload; }
@property ref int back() { return payload; } @property ref int back() return { return payload; }
void popFront() { } void popFront() { }
void popBack() { } void popBack() { }
} }

View file

@ -2702,7 +2702,7 @@ struct LockingTextReader
/* Read a utf8 sequence from the file, removing the chars from the stream. /* Read a utf8 sequence from the file, removing the chars from the stream.
Returns an empty result when at EOF. */ Returns an empty result when at EOF. */
private char[] takeFront(ref char[4] buf) private char[] takeFront(return ref char[4] buf)
{ {
import std.utf : stride, UTFException; import std.utf : stride, UTFException;
{ {
@ -3807,7 +3807,7 @@ __gshared
{ {
// Read stdin, sort lines, write to stdout // Read stdin, sort lines, write to stdout
import std.stdio, std.array, std.algorithm : sort, copy; import std.stdio, std.array, std.algorithm : sort, copy;
void main() { void main() {
stdin // read from stdin stdin // read from stdin
.byLineCopy(KeepTerminator.yes) // copying each line .byLineCopy(KeepTerminator.yes) // copying each line

View file

@ -1291,7 +1291,7 @@ unittest
int sharedF() shared { return 0; } int sharedF() shared { return 0; }
int x; int x;
ref int refF() { return x; } ref int refF() return { return x; }
int propertyF() @property { return 0; } int propertyF() @property { return 0; }
int nothrowF() nothrow { return 0; } int nothrowF() nothrow { return 0; }
int nogcF() @nogc { return 0; } int nogcF() @nogc { return 0; }

View file

@ -870,7 +870,7 @@ unittest
static struct R static struct R
{ {
Tuple!(int, int) _front; Tuple!(int, int) _front;
@property ref Tuple!(int, int) front() { return _front; } @property ref Tuple!(int, int) front() return { return _front; }
@property bool empty() { return _front[0] >= 10; } @property bool empty() { return _front[0] >= 10; }
void popFront() { ++_front[0]; } void popFront() { ++_front[0]; }
} }

View file

@ -2099,7 +2099,7 @@ unittest // bugzilla 12923
pure pure
{ {
char[] toUTF8(out char[4] buf, dchar c) nothrow @nogc @safe char[] toUTF8(return out char[4] buf, dchar c) nothrow @nogc @safe
in in
{ {
assert(isValidDchar(c)); assert(isValidDchar(c));
@ -2207,7 +2207,7 @@ string toUTF8(in dchar[] s) @trusted
/* =================== Conversion to UTF16 ======================= */ /* =================== Conversion to UTF16 ======================= */
wchar[] toUTF16(ref wchar[2] buf, dchar c) nothrow @nogc @safe wchar[] toUTF16(return ref wchar[2] buf, dchar c) nothrow @nogc @safe
in in
{ {
assert(isValidDchar(c)); assert(isValidDchar(c));

View file

@ -38,13 +38,13 @@ CFLAGS=-mn -6 -r
## Flags for dmd D compiler ## Flags for dmd D compiler
DFLAGS=-O -release -w DFLAGS=-O -release -w -dip25
#DFLAGS=-unittest -g #DFLAGS=-unittest -g
#DFLAGS=-unittest -cov -g #DFLAGS=-unittest -cov -g
## Flags for compiling unittests ## Flags for compiling unittests
UDFLAGS=-O -w UDFLAGS=-O -w -dip25
## C compiler ## C compiler

View file

@ -37,13 +37,13 @@ CFLAGS=/O2 /nologo /I"$(VCDIR)\INCLUDE" /I"$(SDKDIR)\Include"
## Flags for dmd D compiler ## Flags for dmd D compiler
DFLAGS=-m$(MODEL) -O -release -w DFLAGS=-m$(MODEL) -O -release -w -dip25
#DFLAGS=-m$(MODEL) -unittest -g #DFLAGS=-m$(MODEL) -unittest -g
#DFLAGS=-m$(MODEL) -unittest -cov -g #DFLAGS=-m$(MODEL) -unittest -cov -g
## Flags for compiling unittests ## Flags for compiling unittests
UDFLAGS=-g -m$(MODEL) -O -w UDFLAGS=-g -m$(MODEL) -O -w -dip25
## C compiler, linker, librarian ## C compiler, linker, librarian