From 148fe78f9519fc654f113c4be05e5ddfdc912df1 Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Thu, 19 Jul 2018 16:58:40 +0200 Subject: [PATCH] Revert @trusted hotfix for std.uni --- std/uni.d | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/std/uni.d b/std/uni.d index ceeee8b8c07..82742cbc0dc 100644 --- a/std/uni.d +++ b/std/uni.d @@ -2170,20 +2170,23 @@ public struct InversionList(SP=GcPolicy) /** Get range that spans all of the $(CODEPOINT) intervals in this $(LREF InversionList). + */ + @property auto byInterval() scope + { + // TODO: change this to data[] once the -dip1000 errors have been fixed + // see e.g. https://github.com/dlang/phobos/pull/6638 + import std.array : array; + return Intervals!(typeof(data.array))(data.array); + } - Example: - ----------- + @safe unittest + { import std.algorithm.comparison : equal; import std.typecons : tuple; auto set = CodepointSet('A', 'D'+1, 'a', 'd'+1); assert(set.byInterval.equal([tuple('A','E'), tuple('a','e')])); - ----------- - */ - @property auto byInterval() scope return - { - return Intervals!(typeof(data))(data); } package @property const(CodepointInterval)[] intervals() const @@ -2791,7 +2794,7 @@ private: // a random-access range of integral pairs static struct Intervals(Range) { - this(return scope Range sp) scope @trusted // FIXME + this(Range sp) scope { slice = sp; start = 0;