assumeUTF is @nogc in release mode, but not in debug mode.
The reason is that in debug mode it performs additional checks, which is not bad per se, but makes working with assumeUTF too difficult (e.g. I cannot use @nogc unittests).
In general, this change of meaning between debug and release mode should be avoided.
See also https://forum.dlang.org/thread/[email protected]
Comment #1 by dlang-bot — 2019-12-29T15:14:48Z
@berni44 created dlang/phobos pull request #7337 "Fix Issue 16262 - assumeUTF attributes change between debug and release mode" fixing this issue:
- Fix Issue 16262 - assumeUTF attributes change between debug and
release mode
https://github.com/dlang/phobos/pull/7337
Comment #2 by bugzilla — 2020-01-02T15:17:30Z
During the PR I learned, that the @nogc-part is allready fixed. I checked that before filing it, but probably I erred somewhere. Anyway, the behaviour with and without debug mode still differs.