@@ -227,8 +227,6 @@ version (unittest) {
227227 import std.exception : assertThrown, collectExceptionMsg;
228228}
229229
230- @safe :
231-
232230/+ +
233231 `Expected!(T, E)` is a type that represents either success or failure.
234232
@@ -402,10 +400,13 @@ struct Expected(T, E = string, Hook = Abort)
402400 // Done, deallocate
403401 static if (isChecked! Hook) bool ch = checked;
404402 destroy (storage.payload);
405- static if (enableGCScan) pureGcRemoveRange(&storage.payload);
403+ static if (enableGCScan) () @trusted { pureGcRemoveRange(&storage.payload); } ( );
406404
407- pureFree(storage);
408- storage = null ;
405+ () @trusted
406+ {
407+ pureFree(storage);
408+ storage = null ;
409+ }();
409410
410411 static if (isChecked! Hook) { if (! ch) onUnchecked(); }
411412 }
@@ -1112,7 +1113,7 @@ static:
11121113 }
11131114
11141115 // / Handler for case when empty error is accessed.
1115- void onAccessEmptyError () nothrow @nogc
1116+ void onAccessEmptyError () nothrow @nogc @safe
11161117 {
11171118 assert (0 , " Error not set" );
11181119 }
@@ -1163,7 +1164,7 @@ version (D_Exceptions)
11631164 }
11641165
11651166 // / Handler for case when empty error is accessed.
1166- void onAccessEmptyError ()
1167+ void onAccessEmptyError () @safe
11671168 {
11681169 throw new Unexpected! string (" Can't access error on expected value" );
11691170 }
@@ -1243,7 +1244,7 @@ static:
12431244 // / Enabled reference counted payload
12441245 immutable bool enableRefCountedPayload = true ;
12451246
1246- void onUnchecked () pure nothrow @nogc { assert (0 , " result unchecked" ); }
1247+ void onUnchecked () pure nothrow @nogc @safe { assert (0 , " result unchecked" ); }
12471248}
12481249
12491250// /
0 commit comments