Skip to content

Commit 20c6492

Browse files
committed
add return annotations to pure functions
1 parent 6d6e04b commit 20c6492

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

std/algorithm/searching.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,7 @@ Returns:
15571557
15581558
See_ALso: $(LREF findAdjacent), $(LREF findAmong), $(LREF findSkip), $(LREF findSplit), $(LREF startsWith)
15591559
*/
1560-
InputRange find(alias pred = "a == b", InputRange, Element)(InputRange haystack, scope Element needle)
1560+
InputRange find(alias pred = "a == b", InputRange, Element)(return InputRange haystack, scope Element needle)
15611561
if (isInputRange!InputRange &&
15621562
is (typeof(binaryFun!pred(haystack.front, needle)) : bool) &&
15631563
!is (typeof(binaryFun!pred(haystack.front, needle.front)) : bool))
@@ -1602,7 +1602,7 @@ if (isInputRange!InputRange &&
16021602
{
16031603
if (!__ctfe && canSearchInCodeUnits!char(needle))
16041604
{
1605-
static R trustedMemchr(ref R haystack, ref E needle) @trusted nothrow pure
1605+
static R trustedMemchr(return ref R haystack, ref E needle) @trusted nothrow pure
16061606
{
16071607
import core.stdc.string : memchr;
16081608
auto ptr = memchr(haystack.ptr, needle, haystack.length);

std/bigint.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public:
211211
* Implements assignment operators from built-in integers of the form
212212
* `BigInt op= integer`.
213213
*/
214-
BigInt opOpAssign(string op, T)(T y) pure nothrow @safe
214+
BigInt opOpAssign(string op, T)(T y) return pure nothrow @safe
215215
if ((op=="+" || op=="-" || op=="*" || op=="/" || op=="%"
216216
|| op==">>" || op=="<<" || op=="^^" || op=="|" || op=="&" || op=="^") && isIntegral!T)
217217
{
@@ -363,7 +363,7 @@ public:
363363
/**
364364
* Implements assignment operators of the form `BigInt op= BigInt`.
365365
*/
366-
BigInt opOpAssign(string op, T)(T y) pure nothrow @safe
366+
BigInt opOpAssign(string op, T)(T y) return pure nothrow @safe
367367
if ((op=="+" || op== "-" || op=="*" || op=="|" || op=="&" || op=="^" || op=="/" || op=="%")
368368
&& is (T: BigInt))
369369
{

std/bitmanip.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,7 +1515,7 @@ public:
15151515
/**********************************************
15161516
* Reverses the bits of the `BitArray`.
15171517
*/
1518-
@property BitArray reverse() @nogc pure nothrow
1518+
@property BitArray reverse() return @nogc pure nothrow
15191519
out (result)
15201520
{
15211521
assert(result == this, "the result must be equal to this");
@@ -1555,7 +1555,7 @@ public:
15551555
/**********************************************
15561556
* Sorts the `BitArray`'s elements.
15571557
*/
1558-
@property BitArray sort() @nogc pure nothrow
1558+
@property BitArray sort() return @nogc pure nothrow
15591559
out (result)
15601560
{
15611561
assert(result == this, "the result must be equal to this");

0 commit comments

Comments
 (0)