Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions src/core/internal/array/appending.d
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,22 @@ template _d_arrayappendcTXImpl(Tarr : T[], T)
* purity, and throwabilty checks. To prevent breaking existing code, this function template
* is temporarily declared `@trusted pure` until the implementation can be brought up to modern D expectations.
*/
ref Tarr _d_arrayappendcTX(return ref scope Tarr px, size_t n) @trusted pure nothrow
{
static if (isCopyingNothrow!T) // `nothrow` deduction doesn't work, so this is needed
ref Tarr _d_arrayappendcTX(return ref scope Tarr px, size_t n) @trusted pure nothrow
{
pragma(inline, false);

mixin(_d_arrayappendcTXBody);
}
else
ref Tarr _d_arrayappendcTX(return ref scope Tarr px, size_t n) @trusted pure nothrow
{
pragma(inline, false);

mixin(_d_arrayappendcTXBody);
}

private enum _d_arrayappendcTXBody = q{
version (D_TypeInfo)
{
auto ti = typeid(Tarr);
Expand All @@ -50,7 +64,7 @@ template _d_arrayappendcTXImpl(Tarr : T[], T)
}
else
assert(0, "Cannot append arrays if compiling without support for runtime type information!");
}
};

/**
* TraceGC wrapper around $(REF _d_arrayappendcTX, rt,array,appending,_d_arrayappendcTXImpl).
Expand Down