Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion circleci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ setup_repos()

# checkout a specific version of https://github.com/dlang/tools
clone https://github.com/dlang/tools.git ../tools master
git -C ../tools checkout 87c63705dcacac38ba7c84d19699f656d834139d
git -C ../tools checkout df3dfa3061d25996ac98158d3bdb3525c8d89445

# load environment for bootstrap compiler
source "$(CURL_USER_AGENT=\"$CURL_USER_AGENT\" bash ~/dlang/install.sh dmd-$HOST_DMD_VER --activate)"
Expand Down
2 changes: 1 addition & 1 deletion posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ else
endif

# Set DFLAGS
DFLAGS=-conf= -I$(DRUNTIME_PATH)/import $(DMDEXTRAFLAGS) -w -dip25 $(MODEL_FLAG) $(PIC)
DFLAGS=-conf= -I$(DRUNTIME_PATH)/import $(DMDEXTRAFLAGS) -w -de -dip25 $(MODEL_FLAG) $(PIC)
ifeq ($(BUILD),debug)
DFLAGS += -g -debug
else
Expand Down
2 changes: 1 addition & 1 deletion std/algorithm/searching.d
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ if (isInputRange!Range && !isInfinite!Range &&
assert(count("ababab", "abab") == 1);
assert(count("ababab", "abx") == 0);
// fuzzy count range in range
assert(count!((a, b) => std.uni.toLower(a) == std.uni.toLower(b))("AbcAdFaBf", "ab") == 2);
assert(count!((a, b) => toLower(a) == toLower(b))("AbcAdFaBf", "ab") == 2);
// count predicate in range
assert(count!("a > 1")(a) == 8);
}
Expand Down
1 change: 0 additions & 1 deletion std/csv.d
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,6 @@ public:
}
}

///
@safe pure unittest
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CsvReader is private

{
import std.algorithm.comparison : equal;
Expand Down
6 changes: 2 additions & 4 deletions std/datetime/timezone.d
Original file line number Diff line number Diff line change
Expand Up @@ -2991,8 +2991,6 @@ else version(Windows)

static immutable(WindowsTimeZone) getTimeZone(string name) @trusted
{
import std.utf : toUTF16;

scope baseKey = Registry.localMachine.getKey(`Software\Microsoft\Windows NT\CurrentVersion\Time Zones`);

foreach (tzKeyName; baseKey.keyNames)
Expand All @@ -3015,8 +3013,8 @@ else version(Windows)

TIME_ZONE_INFORMATION tzInfo;

auto wstdName = toUTF16(stdName);
auto wdstName = toUTF16(dstName);
auto wstdName = stdName.to!wstring;
auto wdstName = dstName.to!wstring;
auto wstdNameLen = wstdName.length > 32 ? 32 : wstdName.length;
auto wdstNameLen = wdstName.length > 32 ? 32 : wdstName.length;

Expand Down
16 changes: 7 additions & 9 deletions std/file.d
Original file line number Diff line number Diff line change
Expand Up @@ -2644,7 +2644,6 @@ version(Posix) @system unittest // input range of dchars
version(Windows) string getcwd()
{
import std.conv : to;
import std.utf : toUTF8;
/* GetCurrentDirectory's return value:
1. function succeeds: the number of characters that are written to
the buffer, not including the terminating null character.
Expand All @@ -2658,15 +2657,15 @@ version(Windows) string getcwd()
// we can do it because toUTFX always produces a fresh string
if (n < buffW.length)
{
return toUTF8(buffW[0 .. n]);
return buffW[0 .. n].to!string;
}
else //staticBuff isn't enough
{
auto ptr = cast(wchar*) malloc(wchar.sizeof * n);
scope(exit) free(ptr);
immutable n2 = GetCurrentDirectoryW(n, ptr);
cenforce(n2 && n2 < n, "getcwd");
return toUTF8(ptr[0 .. n2]);
return ptr[0 .. n2].to!string;
}
}
else version (Solaris) string getcwd()
Expand Down Expand Up @@ -2968,7 +2967,6 @@ else version(Windows)
{
struct DirEntry
{
import std.utf : toUTF8;
public:
alias name this;

Expand All @@ -2994,12 +2992,12 @@ else version(Windows)
private this(string path, in WIN32_FIND_DATAW *fd)
{
import core.stdc.wchar_ : wcslen;
import std.conv : to;
import std.datetime.systime : FILETIMEToSysTime;
import std.path : buildPath;

size_t clength = wcslen(fd.cFileName.ptr);
_name = toUTF8(fd.cFileName[0 .. clength]);
_name = buildPath(path, toUTF8(fd.cFileName[0 .. clength]));
_name = buildPath(path, fd.cFileName[0 .. clength].to!string);
_size = (cast(ulong) fd.nFileSizeHigh << 32) | fd.nFileSizeLow;
_timeCreated = FILETIMEToSysTime(&fd.ftCreationTime);
_timeLastAccessed = FILETIMEToSysTime(&fd.ftLastAccessTime);
Expand Down Expand Up @@ -3431,7 +3429,7 @@ private void copyImpl(const(char)[] f, const(char)[] t, const(FSChar)* fromz, co
{
version(Windows)
{
assert(preserve == Yes.preserve);
assert(preserve == Yes.preserveAttributes);
immutable result = CopyFileW(fromz, toz, false);
if (!result)
{
Expand Down Expand Up @@ -4287,11 +4285,11 @@ string tempDir() @trusted
{
version(Windows)
{
import std.utf : toUTF8;
import std.conv : to;
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa364992(v=vs.85).aspx
wchar[MAX_PATH + 2] buf;
DWORD len = GetTempPathW(buf.length, buf.ptr);
if (len) cache = toUTF8(buf[0 .. len]);
if (len) cache = buf[0 .. len].to!string;
}
else version(Android)
{
Expand Down
7 changes: 7 additions & 0 deletions std/string.d
Original file line number Diff line number Diff line change
Expand Up @@ -5288,6 +5288,7 @@ if (isSomeString!S)
}


deprecated
@safe pure @nogc unittest
{
import std.conv : to;
Expand Down Expand Up @@ -5363,6 +5364,7 @@ if (isSomeString!S && isSomeString!S1)
return count;
}

deprecated
@safe pure @nogc unittest
{
import std.conv : to;
Expand Down Expand Up @@ -5417,6 +5419,7 @@ if (isSomeString!S)
return s;
}

deprecated
@safe pure unittest
{
import std.conv : to;
Expand All @@ -5433,6 +5436,7 @@ if (isSomeString!S)
});
}

deprecated
@safe pure unittest
{
assert(removechars("abc", "x") == "abc");
Expand Down Expand Up @@ -5493,6 +5497,7 @@ S squeeze(S)(S s, in S pattern = null)
return changed ? ((r is null) ? s[0 .. lasti] : cast(S) r) : s;
}

deprecated
@system pure unittest
{
import std.conv : to;
Expand Down Expand Up @@ -5549,6 +5554,7 @@ S1 munch(S1, S2)(ref S1 s, S2 pattern) @safe pure @nogc
}

///
deprecated
@safe pure @nogc unittest
{
string s = "123abc";
Expand All @@ -5558,6 +5564,7 @@ S1 munch(S1, S2)(ref S1 s, S2 pattern) @safe pure @nogc
assert(t == "" && s == "abc");
}

deprecated
@safe pure @nogc unittest
{
string s = "123€abc";
Expand Down
9 changes: 3 additions & 6 deletions std/uni.d
Original file line number Diff line number Diff line change
Expand Up @@ -2546,7 +2546,6 @@ private:
return this;
}

///
@safe unittest
{
assert(unicode.Cyrillic.intersect('-').byInterval.empty);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generated/linux/release/64/publictests/std_uni.d(132): Deprecation: std.uni.InversionList!(GcPolicy).InversionList.intersect(U)(U rhs) if (isCodepointSet!U) is not visible from module std_uni

Expand Down Expand Up @@ -4340,7 +4339,6 @@ if (sumOfIntegerTuple!sizes == 21)
}
}

///
@system pure unittest
{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generated/linux/release/64/publictests/std_uni.d(192): Deprecation: std.uni.BitPacked(T, ulong sz) if (isIntegral!T || is(T : dchar)) is not visible from module std_uni

import std.algorithm.comparison : max;
Expand Down Expand Up @@ -4644,7 +4642,6 @@ public struct MatcherConcept
return this;
}

///
@safe unittest
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generated/linux/release/64/publictests/std_uni.d(242): Deprecation: std.uni.Utf8Matcher!().Impl!(1, 2, 3, 4).Impl.subMatcher(SizesToPick...)() is not visible from module std_uni
generated/linux/release/64/publictests/std_uni.d(243): Deprecation: std.uni.Utf8Matcher!().Impl!(1, 2, 3, 4).Impl.subMatcher(SizesToPick...)() is not visible from module std_uni
generated/linux/release/64/publictests/std_uni.d(244): Deprecation: std.uni.Utf8Matcher!().Impl!(1, 2, 3, 4).Impl.subMatcher(SizesToPick...)() is not visible from module std_uni
generated/linux/release/64/publictests/std_uni.d(245): Deprecation: std.uni.Utf8Matcher!().Impl!(1, 2, 3, 4).Impl.subMatcher(SizesToPick...)() is not visible from module std_uni
generated/linux/release/64/publictests/std_uni.d(250): Deprecation: std.uni.Utf16Matcher!().Impl!(1, 2).Impl.subMatcher(SizesToPick...)() is not visible from module std_uni

{
auto m = utfMatcher!char(unicode.Number);
Expand Down Expand Up @@ -4762,9 +4759,9 @@ template Utf8Matcher()
static auto encode(size_t sz)(dchar ch)
if (sz > 1)
{
import std.utf : encode;
import std.utf : encodeUTF = encode;
char[4] buf;
std.utf.encode(buf, ch);
encodeUTF(buf, ch);
char[sz] ret;
buf[0] &= leadMask!sz;
foreach (n; 1 .. sz)
Expand Down Expand Up @@ -7380,7 +7377,7 @@ package auto simpleCaseFoldings(dchar ch) @safe
return len == 0;
}

@property uint length() const
@property size_t length() const
{
if (isSmall)
{
Expand Down
3 changes: 1 addition & 2 deletions std/windows/charset.d
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ version (Windows):
private import core.sys.windows.windows;
private import std.conv;
private import std.string;
private import std.utf;
private import std.windows.syserror;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw what's the reason for private imports? Aren't they private by default?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think very very old versions of D (well into 0.x) had imports public by default, like C header files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow -> #5553


import std.internal.cstring;
Expand Down Expand Up @@ -114,7 +113,7 @@ string fromMBSz(immutable(char)* s, int codePage = 0)
sysErrorString(GetLastError()));
}

return std.utf.toUTF8(result[0 .. result.length-1]); // omit trailing null
return result[0 .. result.length-1].to!string; // omit trailing null
}
}
return s[0 .. c-s]; // string is ASCII, no conversion necessary
Expand Down
13 changes: 6 additions & 7 deletions std/windows/registry.d
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import std.exception;
import std.internal.cstring;
private import std.internal.windows.advapi32;
import std.system : Endian, endian;
import std.utf : toUTF8, toUTF16;
import std.windows.syserror;

//debug = winreg;
Expand Down Expand Up @@ -557,7 +556,7 @@ body
if (wstr.length && wstr[$-1] == '\0')
wstr.length = wstr.length - 1;
assert(wstr.length == 0 || wstr[$-1] != '\0');
value = toUTF8(wstr);
value = wstr.to!string;
break;

case REG_VALUE_TYPE.REG_DWORD_LITTLE_ENDIAN:
Expand Down Expand Up @@ -623,7 +622,7 @@ body
value.length = list.length;
foreach (i, ref v; value)
{
v = toUTF8(list[i]);
v = list[i].to!string;
}
}

Expand Down Expand Up @@ -752,7 +751,7 @@ private void regProcessNthKey(HKEY hkey, scope void delegate(scope LONG delegate
immutable res = regEnumKeyName(hkey, index, sName, cchName);
if (res == ERROR_SUCCESS)
{
name = toUTF8(sName[0 .. cchName]);
name = sName[0 .. cchName].to!string;
}
return res;
});
Expand All @@ -774,7 +773,7 @@ private void regProcessNthValue(HKEY hkey, scope void delegate(scope LONG delega
immutable res = regEnumValueName(hkey, index, sName, cchName);
if (res == ERROR_SUCCESS)
{
name = toUTF8(sName[0 .. cchName]);
name = sName[0 .. cchName].to!string;
}
return res;
});
Expand Down Expand Up @@ -1098,7 +1097,7 @@ public:
wstring[] data = new wstring[value.length+1];
foreach (i, ref s; data[0..$-1])
{
s = toUTF16(value[i]);
s = value[i].to!wstring;
}
data[$-1] = "\0";
auto ws = std.array.join(data, "\0"w);
Expand Down Expand Up @@ -1235,7 +1234,7 @@ public:
ExpandEnvironmentStringsW(srcTmp, newValue.ptr, to!DWORD(newValue.length)),
"Failed to expand environment variables");

return toUTF8(newValue[0 .. count-1]); // remove trailing 0
return newValue[0 .. count-1].to!string; // remove trailing 0
}

/**
Expand Down
2 changes: 1 addition & 1 deletion win32.mak
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ DRUNTIMELIB=$(DRUNTIME)\lib\druntime.lib

## Flags for dmd D compiler

DFLAGS=-conf= -O -release -w -dip25 -I$(DRUNTIME)\import
DFLAGS=-conf= -O -release -w -de -dip25 -I$(DRUNTIME)\import
#DFLAGS=-unittest -g
#DFLAGS=-unittest -cov -g

Expand Down
2 changes: 1 addition & 1 deletion win64.mak
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ DRUNTIMELIB=$(DRUNTIME)\lib\druntime$(MODEL).lib

## Flags for dmd D compiler

DFLAGS=-conf= -m$(MODEL) -O -release -w -dip25 -I$(DRUNTIME)\import
DFLAGS=-conf= -m$(MODEL) -O -release -w -de -dip25 -I$(DRUNTIME)\import
#DFLAGS=-m$(MODEL) -unittest -g
#DFLAGS=-m$(MODEL) -unittest -cov -g

Expand Down