Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 2428a74

Browse files
authored
Merge pull request #2995 from WalterBright/pureReturn4
pure functions infer scope, but not return 4
2 parents 61ee6f6 + 2d30fe7 commit 2428a74

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/core/internal/utf.d

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ void validate(S)(const scope S s)
583583
/* =================== Conversion to UTF8 ======================= */
584584

585585
@safe pure nothrow @nogc
586-
char[] toUTF8(char[] buf, dchar c)
586+
char[] toUTF8(return char[] buf, dchar c)
587587
in
588588
{
589589
assert(isValidDchar(c));
@@ -623,7 +623,7 @@ char[] toUTF8(char[] buf, dchar c)
623623
* Encodes string s into UTF-8 and returns the encoded string.
624624
*/
625625
@safe pure nothrow
626-
string toUTF8(string s)
626+
string toUTF8(return string s)
627627
in
628628
{
629629
validate(s);
@@ -784,7 +784,7 @@ wptr toUTF16z(const scope char[] s)
784784

785785
/** ditto */
786786
@safe pure nothrow
787-
wstring toUTF16(wstring s)
787+
wstring toUTF16(return wstring s)
788788
in
789789
{
790790
validate(s);
@@ -864,7 +864,7 @@ dstring toUTF32(const scope wchar[] s)
864864

865865
/** ditto */
866866
@safe pure nothrow
867-
dstring toUTF32(dstring s)
867+
dstring toUTF32(return dstring s)
868868
in
869869
{
870870
validate(s);

src/core/sys/posix/sys/socket.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ version (CRuntime_Glibc)
216216
}
217217
else
218218
{
219-
extern (D) inout(ubyte)* CMSG_DATA( inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
219+
extern (D) inout(ubyte)* CMSG_DATA( return inout(cmsghdr)* cmsg ) pure nothrow @nogc { return cast(ubyte*)( cmsg + 1 ); }
220220
}
221221

222222
private inout(cmsghdr)* __cmsg_nxthdr(inout(msghdr)*, inout(cmsghdr)*) pure nothrow @nogc;

src/object.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,8 +1031,8 @@ class TypeInfo_Class : TypeInfo
10311031
return m_offTi;
10321032
}
10331033

1034-
@property auto info() @safe nothrow pure const { return this; }
1035-
@property auto typeinfo() @safe nothrow pure const { return this; }
1034+
@property auto info() @safe nothrow pure const return { return this; }
1035+
@property auto typeinfo() @safe nothrow pure const return { return this; }
10361036

10371037
byte[] m_init; /** class static initializer
10381038
* (init.length gives size in bytes of class)

0 commit comments

Comments
 (0)