Skip to content

Commit dce4a62

Browse files
committed
update for the recent compiler version
1 parent 07cc70f commit dce4a62

File tree

7 files changed

+34
-34
lines changed

7 files changed

+34
-34
lines changed

source/mir/algorithm/setops.d

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct MultiwayMerge(alias less, RangeOfRanges)
6969
BinaryHeap!(compFront, RangeOfRanges) _heap;
7070

7171
///
72-
this(RangeOfRanges ror)
72+
this(scope return RangeOfRanges ror)
7373
{
7474
// Preemptively get rid of all empty ranges in the input
7575
// No need for stability either
@@ -82,7 +82,7 @@ struct MultiwayMerge(alias less, RangeOfRanges)
8282
continue;
8383
}
8484
import mir.utility: swap;
85-
swap(temp.back, temp.front);
85+
() @trusted {swap(temp.back, temp.front);} ();
8686
temp.popBack;
8787
ror.popBack;
8888
}
@@ -114,7 +114,7 @@ struct MultiwayMerge(alias less, RangeOfRanges)
114114
/// Ditto
115115
MultiwayMerge!(naryFun!less, RangeOfRanges) multiwayMerge
116116
(alias less = "a < b", RangeOfRanges)
117-
(RangeOfRanges ror)
117+
(scope RangeOfRanges ror)
118118
{
119119
return typeof(return)(move(ror));
120120
}
@@ -163,7 +163,7 @@ Returns:
163163
A range of the union of the ranges in `ror`.
164164
See also: $(LREF multiwayMerge)
165165
*/
166-
auto multiwayUnion(alias less = "a < b", RangeOfRanges)(RangeOfRanges ror)
166+
auto multiwayUnion(alias less = "a < b", RangeOfRanges)(scope RangeOfRanges ror)
167167
{
168168
import mir.functional: not;
169169
import mir.algorithm.iteration : Uniq;
@@ -212,7 +212,7 @@ Returns:
212212
A length of the union of the ranges in `ror`.
213213
+/
214214
pragma(inline, false)
215-
size_t unionLength(alias less = "a < b", RangeOfRanges)(RangeOfRanges ror)
215+
size_t unionLength(alias less = "a < b", RangeOfRanges)(scope RangeOfRanges ror)
216216
{
217217
size_t length;
218218
auto u = move(ror).multiwayUnion!less;

source/mir/appender.d

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ struct ScopedBuffer(T, size_t bytes = 4096)
155155
void put(T e) @safe scope
156156
{
157157
auto cl = _currentLength;
158-
auto d = prepare(1);
158+
auto d = ()@trusted {return prepare(1);} ();
159159
static if (isMutable!T)
160160
{
161161
import core.lifetime: moveEmplace;
@@ -172,7 +172,7 @@ struct ScopedBuffer(T, size_t bytes = 4096)
172172
void put(ref R e) scope
173173
{
174174
auto cl = _currentLength;
175-
auto d = prepare(1);
175+
auto d = ()@trusted {return prepare(1);} ();
176176
emplaceRef!(Unqual!T)(d[cl], e);
177177
}
178178

@@ -181,7 +181,7 @@ struct ScopedBuffer(T, size_t bytes = 4096)
181181
void put(scope R[] e) scope
182182
{
183183
auto cl = _currentLength;
184-
auto d = prepare(e.length);
184+
auto d = ()@trusted {return prepare(e.length);} ();
185185
if (!__ctfe)
186186
(()@trusted=>memcpy(cast(void*)(d.ptr + cl), e.ptr, e.length * T.sizeof))();
187187
else
@@ -198,7 +198,7 @@ struct ScopedBuffer(T, size_t bytes = 4096)
198198
static if (hasLength!Iterable)
199199
{
200200
auto cl = _currentLength;
201-
auto d = prepare(range.length);
201+
auto d = ()@trusted {return prepare(range.length);} ();
202202
foreach(ref e; range)
203203
emplaceRef!(Unqual!T)(d[cl++], e);
204204
assert(_currentLength == cl);

source/mir/rc/ptr.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,20 +196,20 @@ struct mir_rcptr(T)
196196
}
197197

198198
///
199-
ref opAssign(typeof(null)) return @trusted // pure nothrow @nogc
199+
ref opAssign(typeof(null)) scope return @trusted // pure nothrow @nogc
200200
{
201201
this = typeof(this).init;
202202
}
203203

204204
///
205-
ref opAssign(return typeof(this) rhs) return @trusted // pure nothrow @nogc
205+
ref opAssign(return typeof(this) rhs) scope return @trusted // pure nothrow @nogc
206206
{
207207
this.proxySwap(rhs);
208208
return this;
209209
}
210210

211211
///
212-
ref opAssign(Q)(return ThisTemplate!Q rhs) return @trusted // pure nothrow @nogc
212+
ref opAssign(Q)(return ThisTemplate!Q rhs) scope return @trusted // pure nothrow @nogc
213213
if (isImplicitlyConvertible!(Q*, T*))
214214
{
215215
this.proxySwap(*()@trusted{return cast(typeof(this)*)&rhs;}());

source/mir/rc/slim_ptr.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,20 +186,20 @@ struct mir_slim_rcptr(T)
186186
}
187187

188188
///
189-
ref opAssign(typeof(null)) return @trusted // pure nothrow @nogc
189+
ref opAssign(typeof(null)) scope return @trusted // pure nothrow @nogc
190190
{
191191
this = typeof(this).init;
192192
}
193193

194194
///
195-
ref opAssign(return typeof(this) rhs) return @trusted // pure nothrow @nogc
195+
ref opAssign(return typeof(this) rhs) scope return @trusted // pure nothrow @nogc
196196
{
197197
this.proxySwap(rhs);
198198
return this;
199199
}
200200

201201
///
202-
ref opAssign(Q)(return ThisTemplate!Q rhs) return @trusted // pure nothrow @nogc
202+
ref opAssign(Q)(return ThisTemplate!Q rhs) scope return @trusted // pure nothrow @nogc
203203
if (isImplicitlyConvertible!(Q*, T*))
204204
{
205205
this.proxySwap(*()@trusted{return cast(typeof(this)*)&rhs;}());

source/mir/series.d

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@ struct mir_series(IndexIterator_, Iterator_, size_t N_ = 1, SliceKind kind_ = Co
12291229
}
12301230

12311231
///
1232-
ref opAssign(typeof(this) rvalue) return @trusted
1232+
ref opAssign(typeof(this) rvalue) scope return @trusted
12331233
{
12341234
import mir.utility: swap;
12351235
this.data._structure = rvalue.data._structure;
@@ -1239,7 +1239,7 @@ struct mir_series(IndexIterator_, Iterator_, size_t N_ = 1, SliceKind kind_ = Co
12391239
}
12401240

12411241
/// ditto
1242-
ref opAssign(RIndexIterator, RIterator)(Series!(RIndexIterator, RIterator, N, kind) rvalue) return
1242+
ref opAssign(RIndexIterator, RIterator)(Series!(RIndexIterator, RIterator, N, kind) rvalue) scope return
12431243
if (isAssignable!(IndexIterator, RIndexIterator) && isAssignable!(Iterator, RIterator))
12441244
{
12451245
import core.lifetime: move;
@@ -1250,21 +1250,21 @@ struct mir_series(IndexIterator_, Iterator_, size_t N_ = 1, SliceKind kind_ = Co
12501250
}
12511251

12521252
/// ditto
1253-
ref opAssign(RIndexIterator, RIterator)(auto ref const Series!(RIndexIterator, RIterator, N, kind) rvalue) return
1253+
ref opAssign(RIndexIterator, RIterator)(auto ref const Series!(RIndexIterator, RIterator, N, kind) rvalue) scope return
12541254
if (isAssignable!(IndexIterator, LightConstOf!RIndexIterator) && isAssignable!(Iterator, LightConstOf!RIterator))
12551255
{
12561256
return this = rvalue.opIndex;
12571257
}
12581258

12591259
/// ditto
1260-
ref opAssign(RIndexIterator, RIterator)(auto ref immutable Series!(RIndexIterator, RIterator, N, kind) rvalue) return
1260+
ref opAssign(RIndexIterator, RIterator)(auto ref immutable Series!(RIndexIterator, RIterator, N, kind) rvalue) scope return
12611261
if (isAssignable!(IndexIterator, LightImmutableOf!RIndexIterator) && isAssignable!(Iterator, LightImmutableOf!RIterator))
12621262
{
12631263
return this = rvalue.opIndex;
12641264
}
12651265

12661266
/// ditto
1267-
ref opAssign(typeof(null)) return
1267+
ref opAssign(typeof(null)) scope return
12681268
{
12691269
return this = this.init;
12701270
}

source/mir/small_array.d

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ template SmallArray(T, uint maxLength)
8484
}
8585

8686
/// `=` operator
87-
ref typeof(this) opAssign(typeof(null)) return
87+
ref typeof(this) opAssign(typeof(null)) scope return
8888
{
8989
_length = 0;
9090
_data = T.init;
9191
return this;
9292
}
9393

9494
/// ditto
95-
ref typeof(this) opAssign(V[] array) return @trusted
95+
ref typeof(this) opAssign(V[] array) scope return @trusted
9696
{
9797
if (array.length > maxLength)
9898
{
@@ -106,23 +106,23 @@ template SmallArray(T, uint maxLength)
106106
}
107107

108108
/// ditto
109-
ref typeof(this) opAssign(ref const SmallArray rhs) return nothrow
109+
ref typeof(this) opAssign(ref const SmallArray rhs) scope return nothrow
110110
{
111111
_length = rhs._length;
112112
_data = rhs._data;
113113
return this;
114114
}
115115

116116
/// ditto
117-
ref typeof(this) opAssign(const SmallArray rhs) return nothrow
117+
ref typeof(this) opAssign(const SmallArray rhs) scope return nothrow
118118
{
119119
_length = rhs._length;
120120
_data = rhs._data;
121121
return this;
122122
}
123123

124124
/// ditto
125-
ref typeof(this) opAssign(uint n)(ref const SmallArray!(T, n) rhs) return
125+
ref typeof(this) opAssign(uint n)(ref const SmallArray!(T, n) rhs) scope return
126126
if (n != maxLength)
127127
{
128128
static if (n < maxLength)
@@ -145,7 +145,7 @@ template SmallArray(T, uint maxLength)
145145
}
146146

147147
/// ditto
148-
ref typeof(this) opAssign(uint n)(const SmallArray!(T, n) rhs) return
148+
ref typeof(this) opAssign(uint n)(const SmallArray!(T, n) rhs) scope return
149149
if (n != maxLength)
150150
{
151151
static if (n < maxLength)

source/mir/small_string.d

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,24 @@ struct SmallString(uint maxLength)
3737
extern(D) @safe pure @nogc:
3838

3939
/// Constructor
40-
this(typeof(null))
40+
this(typeof(null)) scope
4141
{
4242
}
4343

4444
/// ditto
45-
this(scope const(char)[] str)
45+
this(scope const(char)[] str) scope
4646
{
4747
this.opAssign(str);
4848
}
4949

5050
/// ditto
51-
this(uint n)(auto ref scope const SmallString!n str)
51+
this(uint n)(auto ref scope const SmallString!n str) scope
5252
{
5353
this.opAssign(str);
5454
}
5555

5656
/// ditto
57-
this(Range)(auto ref Range str)
57+
this(Range)(auto ref scope Range str) scope
5858
if (isIterable!Range)
5959
{
6060
size_t i = 0;
@@ -70,14 +70,14 @@ extern(D) @safe pure @nogc:
7070
}
7171

7272
/// `=` operator
73-
ref typeof(this) opAssign(typeof(null)) return
73+
ref typeof(this) opAssign(typeof(null)) scope return
7474
{
7575
_data = '\0';
7676
return this;
7777
}
7878

7979
/// ditto
80-
ref typeof(this) opAssign(scope const(char)[] str) return @trusted
80+
ref typeof(this) opAssign(scope const(char)[] str) scope return @trusted
8181
{
8282
_data = '\0';
8383
if (str.length > _data.sizeof)
@@ -93,7 +93,7 @@ extern(D) @safe pure @nogc:
9393
}
9494

9595
/// ditto
96-
ref typeof(this) opAssign(uint n)(auto ref scope const SmallString!n rhs) return
96+
ref typeof(this) opAssign(uint n)(auto ref scope const SmallString!n rhs) scope return
9797
if (n != maxLength)
9898
{
9999
static if (n < maxLength)
@@ -117,7 +117,7 @@ extern(D) @safe pure @nogc:
117117
}
118118

119119
/// ditto
120-
ref typeof(this) opAssign(uint n)(const SmallString!n rhs) return
120+
ref typeof(this) opAssign(uint n)(const SmallString!n rhs) scope return
121121
if (n != maxLength)
122122
{
123123
static if (n < maxLength)

0 commit comments

Comments
 (0)