Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

Change Log: 2.092.0

previous version: 2.091.0

Download D nightlies
To be released

This changelog has been automatically generated from all commits in master since the last release.

  • The full-text messages are assembled from the changelog/ directories of the respective repositories: dmd, druntime, phobos, tools,, installer, and dub.
  • See the DLang-Bot documentation for details on referencing Bugzilla. The DAutoTest PR preview doesn't include the Bugzilla changelog.
  • The pending changelog can be generated locally by setting up and running the pending_changelog target:
    make -f posix.mak pending_changelog

2.092.0 comes with 9 major changes and 23 fixed Bugzilla issues. A huge thanks goes to the 38 contributors who made 2.092.0 possible.

List of all upcoming bug fixes and enhancements in D 2.092.0.

Compiler changes

  1. CLI switches -revert=import and -transition=checkimports have been removed

    Those switched were already not doing anything and had been deprecated for a while. The compiler will no longer recognized them.

  2. Added support for mangling C++'s GNU ABI tags

    GNU ABI tags are a feature that was added with C++11 in GCC 5.1. In order for D to fully support the standard C++ library, DMD now recognize the special UDA gnuAbiTag, declared in core.attribute and publicly aliased in object (so one need not import anything to use it). The ABI tags are a low level feature that most user will not need to interact with, but can be used to bind to C++ libraries that need it. In particular, it is required to bind std::string when targeting C++11 and higher (DMD switch -extern-std={c++11,c++14,c++17}).

    It can be used in the following way:

    struct MyStruct {}
    @gnuAbiTag("Multiple", "Tags", "On", "Function")
    MyStruct func();

    Only one gnuAbiTag can be present on a symbol at a time. The order of the array entries does not matter (they are sorted on output). The UDA will only have an effect if -extern-std=c++11 or higher is passed to the compiler. The default (-extern-std=c++98) will ignore the UDA. This UDA can only be applied to extern(C++) symbols and cannot be applied to namespaces.

  3. Module constructors and destructors which are not extern(D) are deprecated

    Module constructors and destructors (shared or not) could be marked with a different linkage than extern(D), which would affect their mangling. Since such a mangling is simple and predictable, there was a very small chance of conflict if two same kind of constructor/destructors were declared in similar condition, for example if the third module constructor in module a was on line 479 and the third module constructor in module b was also on line 479, they would have the same mangling.

    While it's unlikely that such a bug is triggered in practice, affected symbols will now trigger a deprecation message.

  4. DIP25 violations will now issue deprecations by default

    DIP25 has been available since v2.067.0, first as its own switch, and more recently under the -preview=dip25 switch. The feature is now fully functional and has been built on, for example by DIP1000.

    Starting from this release, code that would trigger errors when -preview=dip25 is passed to the compiler will also trigger a deprecation message without -preview=dip25. The behavior of the switch is unchanged (errors will still be issued).

    DIP25 aims to make it impossible for @safe code to refer to destructed object. In practice, functions and methods returning a ref to their parameter might be required to qualify the method or the parameter as return, as hinted by the compiler.

    struct Foo
        int x;
        // returning `this.x` escapes a reference to parameter `this`, perhaps annotate with `return`
        ref int method() /* return */ { return this.x; }
    // returning `v` escapes a reference to parameter `v`, perhaps annotate with `return`
    ref int identity(/* return */ ref int v) { return v; }

    In both cases, uncommenting the return annotation will appease the compiler. The complete description of DIP25 can be found here.

Runtime changes

  1. Add core.memory.pageSize and minimumPageSize.

    pageSize contains the size of a system page in bytes.

    import core.memory : pageSize;
    ubyte[] buffer = new ubyte[pageSize];

    minimumPageSize contains the minimum size of a system page in bytes.

    This is a compile time, platform specific value. This value might not be accurate, since it might be possible to change this value. Whenever possible, please use pageSize instead, which is initialized during runtime.

    The minimum size is useful when the context requires a compile time known value, like the size of a static array: ubyte[minimumPageSize] buffer.

    import core.memory : minimumPageSize;
    ubyte[minimumPageSize] buffer;

Library changes

  1. Add Date.isoWeekYear and Date.fromISOWeek in

    It is now possible to convert from the ISO 8601 week calendar into the Gregorian calendar which is used by Date and DateTime.

    Dates are constructed from the year in the ISO week calendar, the week number and a day of week. Date.fromISOWeek(2020, 11, DayOfWeek.mon) will result in Date(2020, 3, 9).

    As the year in the Gregorian calendar and the year in the ISO week calendar are not always the same there is a new .isoWeekYear property to get the year of the Date object in the ISO week calendar. If you convert between them often, consider using .isoWeekAndYear to compute both week number and year in one step.

  2. Deprecated module std.xml

    The module std.xml has been deprecated. Any code that still needs it can use UndeaD instead. For parsing xml files, we recommend to use the dub package dxml.

Dub changes

  1. Environment variable SOURCE_FILES added

    New environment variable $SOURCE_FILES added containing source files from build settings.

  2. DUB now has zsh completion

    A zsh completion script is now present in scripts/zsh-completion/_zsh. It can be installed under the user's prefered fpath and provides completion for options for the most common dub commands, as well as list of packages (based on local packages), e.g. for dub add.

List of all bug fixes and enhancements in D 2.092.0:

DMD Compiler bugs

  1. Bugzilla 14639: Assigning init value to struct uses stack, causing segfault
  2. Bugzilla 19949: C++ Mangling: no support for abi-tags from the Itanium ABI
  3. Bugzilla 20084: return by auto ref unsafe - and different code for inout ref and ref.
  4. Bugzilla 20461: [dip1000] Passing stack allocated string to assert compiles
  5. Bugzilla 20593: [GCC ASM] Parser syntax for asm operands differs from GCC
  6. Bugzilla 20637: spelling correction offers private members
  7. Bugzilla 20638: spelling correction offers private member of package on named package access
  8. Bugzilla 20643: printf without arguments aborts compilation
  9. Bugzilla 20644: Invalid printf deprecation for ubyte passed to "%hhu"
  10. Bugzilla 20645: printf deprecation for width + precision
  11. Bugzilla 20653: Short-circuiting boolean logic not working
  12. Bugzilla 20658: can modify overlapped storage classes in @safe enum function
  13. Bugzilla 20675: dip1000 improper error about copying scope parameter into allocated memory
  14. Bugzilla 20682: [DIP1000] wrong error: scope variable may not be copied into allocated memory
  15. Bugzilla 20696: Should error when retrieving mangling while the type is not yet final

DMD Compiler enhancements

  1. Bugzilla 20470: accessing an AliasSeq tuple loses this
  2. Bugzilla 20609: Disabled and deprecated functions show up as candidate
  3. Bugzilla 20625: Function literal diagnostic is not on par with other messages
  4. Bugzilla 20627: Module ctors / dtors should always have D linkage
  5. Bugzilla 20636: Support the RDSEED instruction in asm blocks

Phobos bugs

  1. Bugzilla 20589: typeof may give wrong result in case of classes defining opCall operator
  2. Bugzilla 20606: Cannot cast non-mutable BitArray to void[], size_t[]

Druntime enhancements

  1. Bugzilla 19924: Make core.bitop.bswap(ulong) work in betterC

Contributors to this release (38)

A huge thanks goes to all the awesome people who made this release possible.

previous version: 2.091.0