Skip to content

Commit 60f044f

Browse files
authored
Merge pull request #16 from vibe-d/issue_15_compile_error
Ensure HashMap destruction works in safe code
2 parents 1992717 + 1e99af7 commit 60f044f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

source/vibe/container/hashmap.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ struct HashMap(TKey, TValue, Traits = DefaultHashMapTraits!TKey, Allocator = IAl
321321
}
322322
}
323323

324-
nothrow unittest {
324+
@safe nothrow unittest {
325325
import std.conv;
326326

327327
HashMap!(string, string) map;

source/vibe/container/internal/rctable.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct RCTable(T, Allocator = IAllocator) {
4444
}
4545

4646
~this()
47-
{
47+
@trusted {
4848
if (m_table.ptr && --this.refCount == 0) {
4949
static if (hasIndirections!T) {
5050
if (m_table.ptr !is null) () @trusted {

0 commit comments

Comments
 (0)