diff --git a/source/dub/dependency.d b/source/dub/dependency.d index e2330fa..fdd9fe6 100644 --- a/source/dub/dependency.d +++ b/source/dub/dependency.d @@ -44,6 +44,8 @@ package name is notably not part of the dependency specification. */ struct Dependency { +@trusted: // Too many issues on DMD 2.065.0 to annotate with @safe + private { // Shortcut to create >=0.0.0 enum ANY_IDENT = "*"; @@ -632,6 +634,7 @@ Semantic Versioning Specification v2.0.0 at http://semver.org/). */ struct Version { +@safe: private { enum MAX_VERS = "99999.0.0"; enum UNKNOWN_VERS = "unknown"; diff --git a/source/dub/semver.d b/source/dub/semver.d index 99aaad7..ac8f6e7 100644 --- a/source/dub/semver.d +++ b/source/dub/semver.d @@ -20,6 +20,7 @@ import std.algorithm : max; import std.conv; +@safe: /** Validates a version string according to the SemVer specification. @@ -229,7 +230,7 @@ auto mi = ver.indexOfAny("+-"); if (mi > 0) ver = ver[0..mi]; // Increment next to last version from a[.b[.c]]. - auto splitted = split(ver, "."); + auto splitted = () @trusted { return split(ver, "."); } (); // DMD 2.065.0 assert(splitted.length > 0 && splitted.length <= 3, "Version corrupt: " ~ ver); auto to_inc = splitted.length == 3? 1 : 0; splitted = splitted[0 .. to_inc+1]; @@ -264,7 +265,7 @@ sub = ver[mi..$]; ver = ver[0..mi]; } - auto splitted = split(ver, "."); + auto splitted = () @trusted { return split(ver, "."); } (); // DMD 2.065.0 assert(splitted.length > 0 && splitted.length <= 3, "Version corrupt: " ~ ver); while (splitted.length < 3) splitted ~= "0"; return splitted.join(".") ~ sub;