@@ -227,8 +227,6 @@ version (unittest) {
227
227
import std.exception : assertThrown, collectExceptionMsg;
228
228
}
229
229
230
- @safe :
231
-
232
230
/+ +
233
231
`Expected!(T, E)` is a type that represents either success or failure.
234
232
@@ -402,10 +400,13 @@ struct Expected(T, E = string, Hook = Abort)
402
400
// Done, deallocate
403
401
static if (isChecked! Hook) bool ch = checked;
404
402
destroy (storage.payload);
405
- static if (enableGCScan) pureGcRemoveRange(&storage.payload);
403
+ static if (enableGCScan) () @trusted { pureGcRemoveRange(&storage.payload); } ( );
406
404
407
- pureFree(storage);
408
- storage = null ;
405
+ () @trusted
406
+ {
407
+ pureFree(storage);
408
+ storage = null ;
409
+ }();
409
410
410
411
static if (isChecked! Hook) { if (! ch) onUnchecked(); }
411
412
}
@@ -1112,7 +1113,7 @@ static:
1112
1113
}
1113
1114
1114
1115
// / Handler for case when empty error is accessed.
1115
- void onAccessEmptyError () nothrow @nogc
1116
+ void onAccessEmptyError () nothrow @nogc @safe
1116
1117
{
1117
1118
assert (0 , " Error not set" );
1118
1119
}
@@ -1163,7 +1164,7 @@ version (D_Exceptions)
1163
1164
}
1164
1165
1165
1166
// / Handler for case when empty error is accessed.
1166
- void onAccessEmptyError ()
1167
+ void onAccessEmptyError () @safe
1167
1168
{
1168
1169
throw new Unexpected! string (" Can't access error on expected value" );
1169
1170
}
@@ -1243,7 +1244,7 @@ static:
1243
1244
// / Enabled reference counted payload
1244
1245
immutable bool enableRefCountedPayload = true ;
1245
1246
1246
- void onUnchecked () pure nothrow @nogc { assert (0 , " result unchecked" ); }
1247
+ void onUnchecked () pure nothrow @nogc @safe { assert (0 , " result unchecked" ); }
1247
1248
}
1248
1249
1249
1250
// /
0 commit comments