Skip to content

Commit

Permalink
Merge pull request #2934 from WalterBright/dip25
Browse files Browse the repository at this point in the history
DIP25: make phobos work with it
  • Loading branch information
andralex committed Jan 30, 2015
2 parents ea2780e + dc302d2 commit 71e3ecf
Show file tree
Hide file tree
Showing 13 changed files with 91 additions and 91 deletions.
2 changes: 1 addition & 1 deletion posix.mak
Expand Up @@ -136,7 +136,7 @@ ifneq (,$(filter cc% gcc% clang% icc% egcc%, $(CC)))
endif

# 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)
DFLAGS += -g -debug
else
Expand Down
132 changes: 66 additions & 66 deletions std/algorithm/package.d
Expand Up @@ -17,25 +17,25 @@ $(TR $(TH Category) $(TH Submodule) $(TH Functions)
$(TR $(TDNW Searching)
$(TDNW $(SUBMODULE searching))
$(TD
$(SUBREF searching, all)
$(SUBREF searching, any)
$(SUBREF searching, all)
$(SUBREF searching, any)
$(SUBREF searching, balancedParens)
$(SUBREF searching, boyerMooreFinder)
$(SUBREF searching, canFind)
$(SUBREF searching, boyerMooreFinder)
$(SUBREF searching, canFind)
$(SUBREF searching, commonPrefix)
$(SUBREF searching, count)
$(SUBREF searching, countUntil)
$(SUBREF searching, endsWith)
$(SUBREF searching, count)
$(SUBREF searching, countUntil)
$(SUBREF searching, endsWith)
$(SUBREF searching, find)
$(SUBREF searching, findAdjacent)
$(SUBREF searching, findAmong)
$(SUBREF searching, findAdjacent)
$(SUBREF searching, findAmong)
$(SUBREF searching, findSkip)
$(SUBREF searching, findSplit)
$(SUBREF searching, findSplitAfter)
$(SUBREF searching, findSplit)
$(SUBREF searching, findSplitAfter)
$(SUBREF searching, findSplitBefore)
$(SUBREF searching, minCount)
$(SUBREF searching, minPos)
$(SUBREF searching, skipOver)
$(SUBREF searching, minCount)
$(SUBREF searching, minPos)
$(SUBREF searching, skipOver)
$(SUBREF searching, startsWith)
$(SUBREF searching, until)
)
Expand All @@ -58,73 +58,73 @@ $(TR $(TDNW Comparison)
)
$(TR $(TDNW Iteration)
$(TDNW $(SUBMODULE iteration))
$(TD
$(SUBREF iteration, aggregate)
$(SUBREF iteration, cache)
$(SUBREF iteration, cacheBidirectional)
$(SUBREF iteration, each)
$(SUBREF iteration, filter)
$(SUBREF iteration, filterBidirectional)
$(SUBREF iteration, group)
$(SUBREF iteration, groupBy)
$(SUBREF iteration, joiner)
$(SUBREF iteration, map)
$(SUBREF iteration, reduce)
$(SUBREF iteration, splitter)
$(SUBREF iteration, sum)
$(TD
$(SUBREF iteration, aggregate)
$(SUBREF iteration, cache)
$(SUBREF iteration, cacheBidirectional)
$(SUBREF iteration, each)
$(SUBREF iteration, filter)
$(SUBREF iteration, filterBidirectional)
$(SUBREF iteration, group)
$(SUBREF iteration, groupBy)
$(SUBREF iteration, joiner)
$(SUBREF iteration, map)
$(SUBREF iteration, reduce)
$(SUBREF iteration, splitter)
$(SUBREF iteration, sum)
$(SUBREF iteration, uniq)
)
)
$(TR $(TDNW Sorting)
$(TDNW $(SUBMODULE sorting))
$(TD
$(SUBREF sorting, completeSort)
$(SUBREF sorting, isPartitioned)
$(SUBREF sorting, isSorted)
$(SUBREF sorting, makeIndex)
$(SUBREF sorting, multiSort)
$(SUBREF sorting, nextEvenPermutation)
$(SUBREF sorting, nextPermutation)
$(SUBREF sorting, partialSort)
$(SUBREF sorting, partition)
$(SUBREF sorting, partition3)
$(SUBREF sorting, schwartzSort)
$(SUBREF sorting, sort)
$(SUBREF sorting, topN)
$(TD
$(SUBREF sorting, completeSort)
$(SUBREF sorting, isPartitioned)
$(SUBREF sorting, isSorted)
$(SUBREF sorting, makeIndex)
$(SUBREF sorting, multiSort)
$(SUBREF sorting, nextEvenPermutation)
$(SUBREF sorting, nextPermutation)
$(SUBREF sorting, partialSort)
$(SUBREF sorting, partition)
$(SUBREF sorting, partition3)
$(SUBREF sorting, schwartzSort)
$(SUBREF sorting, sort)
$(SUBREF sorting, topN)
$(SUBREF sorting, topNCopy)
$(SUBREF sorting, topNIndex)
)
)
$(TR $(TDNW Set operations)
$(TDNW $(SUBMODULE setops))
$(TD
$(SUBREF setops, cartesianProduct)
$(SUBREF setops, largestPartialIntersection)
$(SUBREF setops, largestPartialIntersectionWeighted)
$(SUBREF setops, nWayUnion)
$(SUBREF setops, setDifference)
$(SUBREF setops, setIntersection)
$(SUBREF setops, setSymmetricDifference)
$(TD
$(SUBREF setops, cartesianProduct)
$(SUBREF setops, largestPartialIntersection)
$(SUBREF setops, largestPartialIntersectionWeighted)
$(SUBREF setops, nWayUnion)
$(SUBREF setops, setDifference)
$(SUBREF setops, setIntersection)
$(SUBREF setops, setSymmetricDifference)
$(SUBREF setops, setUnion)
)
)
$(TR $(TDNW Mutation)
$(TDNW $(SUBMODULE mutation))
$(TD
$(SUBREF mutation, bringToFront)
$(SUBREF mutation, copy)
$(SUBREF mutation, fill)
$(SUBREF mutation, initializeAll)
$(SUBREF mutation, move)
$(SUBREF mutation, moveAll)
$(SUBREF mutation, moveSome)
$(SUBREF mutation, remove)
$(SUBREF mutation, reverse)
$(SUBREF mutation, strip)
$(SUBREF mutation, stripLeft)
$(SUBREF mutation, stripRight)
$(SUBREF mutation, swap)
$(SUBREF mutation, swapRanges)
$(TD
$(SUBREF mutation, bringToFront)
$(SUBREF mutation, copy)
$(SUBREF mutation, fill)
$(SUBREF mutation, initializeAll)
$(SUBREF mutation, move)
$(SUBREF mutation, moveAll)
$(SUBREF mutation, moveSome)
$(SUBREF mutation, remove)
$(SUBREF mutation, reverse)
$(SUBREF mutation, strip)
$(SUBREF mutation, stripLeft)
$(SUBREF mutation, stripRight)
$(SUBREF mutation, swap)
$(SUBREF mutation, swapRanges)
$(SUBREF mutation, uninitializedFill)
)
)
Expand Down Expand Up @@ -293,7 +293,7 @@ template forward(args...)

@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)
{
return foo(forward!args);
Expand Down
2 changes: 1 addition & 1 deletion std/conv.d
Expand Up @@ -4610,7 +4610,7 @@ version(unittest)
{
int j;
__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;
}
static assert(is(__std_conv_SS : __std_conv_S));
Expand Down
16 changes: 8 additions & 8 deletions std/datetime.d
Expand Up @@ -745,7 +745,7 @@ public:
Params:
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;
_timezone = rhs._timezone;
Expand All @@ -757,7 +757,7 @@ public:
Params:
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;
_timezone = rhs._timezone;
Expand Down Expand Up @@ -8151,7 +8151,7 @@ public:
+/
static SysTime fromISOString(S)(in S isoString, immutable TimeZone tz = null) @safe
if(isSomeString!S)
{
{
import std.string : strip;
import std.conv : to;
import std.algorithm : startsWith, find;
Expand Down Expand Up @@ -12641,7 +12641,7 @@ public:
import std.conv : to;
import std.algorithm : all, startsWith;
import std.format : format;

auto dstr = to!dstring(strip(isoExtString));

enforce(dstr.length >= 10, new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
Expand Down Expand Up @@ -12948,7 +12948,7 @@ private:
Params:
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);
return this;
Expand Down Expand Up @@ -14223,7 +14223,7 @@ private:
Params:
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);
hnsecs += convert!("hours", "hnsecs")(_hour);
Expand Down Expand Up @@ -17145,7 +17145,7 @@ private:
Params:
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);
hnsecs += convert!("hours", "hnsecs")(_tod._hour);
Expand Down Expand Up @@ -31070,7 +31070,7 @@ unittest
import std.string;
import std.typecons;
import std.typetuple;

static struct Rand3Letters
{
enum empty = false;
Expand Down
2 changes: 1 addition & 1 deletion std/file.d
Expand Up @@ -551,7 +551,7 @@ ulong getSize(in char[] name) @safe
{
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;
}
Expand Down
2 changes: 1 addition & 1 deletion std/internal/unicode_tables.d
Expand Up @@ -38,7 +38,7 @@ struct FullCaseEntry
ubyte n, size;// n number in batch, size - size of batch
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];
}
Expand Down
6 changes: 3 additions & 3 deletions std/range/primitives.d
Expand Up @@ -555,7 +555,7 @@ unittest
char c;
enum empty = false;
void popFront(){};
ref char front() @property
ref char front() return @property
{
return c;
}
Expand Down Expand Up @@ -1856,8 +1856,8 @@ ElementType!R moveBack(R)(R r)
int payload = 5;
@property bool empty() { return false; }
@property TestRange save() { return this; }
@property ref int front() { return payload; }
@property ref int back() { return payload; }
@property ref int front() return { return payload; }
@property ref int back() return { return payload; }
void popFront() { }
void popBack() { }
}
Expand Down
4 changes: 2 additions & 2 deletions std/stdio.d
Expand Up @@ -2702,7 +2702,7 @@ struct LockingTextReader

/* Read a utf8 sequence from the file, removing the chars from the stream.
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;
{
Expand Down Expand Up @@ -3807,7 +3807,7 @@ __gshared
{
// Read stdin, sort lines, write to stdout
import std.stdio, std.array, std.algorithm : sort, copy;

void main() {
stdin // read from stdin
.byLineCopy(KeepTerminator.yes) // copying each line
Expand Down
2 changes: 1 addition & 1 deletion std/traits.d
Expand Up @@ -1293,7 +1293,7 @@ unittest
int sharedF() shared { return 0; }

int x;
ref int refF() { return x; }
ref int refF() return { return x; }
int propertyF() @property { return 0; }
int nothrowF() nothrow { return 0; }
int nogcF() @nogc { return 0; }
Expand Down
2 changes: 1 addition & 1 deletion std/typecons.d
Expand Up @@ -870,7 +870,7 @@ unittest
static struct R
{
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; }
void popFront() { ++_front[0]; }
}
Expand Down
4 changes: 2 additions & 2 deletions std/utf.d
Expand Up @@ -2099,7 +2099,7 @@ unittest // bugzilla 12923
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
{
assert(isValidDchar(c));
Expand Down Expand Up @@ -2207,7 +2207,7 @@ string toUTF8(in dchar[] s) @trusted

/* =================== 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
{
assert(isValidDchar(c));
Expand Down
4 changes: 2 additions & 2 deletions win32.mak
Expand Up @@ -38,13 +38,13 @@ CFLAGS=-mn -6 -r

## Flags for dmd D compiler

DFLAGS=-O -release -w
DFLAGS=-O -release -w -dip25
#DFLAGS=-unittest -g
#DFLAGS=-unittest -cov -g

## Flags for compiling unittests

UDFLAGS=-O -w
UDFLAGS=-O -w -dip25

## C compiler

Expand Down
4 changes: 2 additions & 2 deletions win64.mak
Expand Up @@ -37,13 +37,13 @@ CFLAGS=/O2 /nologo /I"$(VCDIR)\INCLUDE" /I"$(SDKDIR)\Include"

## 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 -cov -g

## Flags for compiling unittests

UDFLAGS=-g -m$(MODEL) -O -w
UDFLAGS=-g -m$(MODEL) -O -w -dip25

## C compiler, linker, librarian

Expand Down

0 comments on commit 71e3ecf

Please sign in to comment.