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, dlang.org, 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 dlang.org and running the pending_changelog target:
    make -f posix.mak pending_changelog


2.092.0 comes with 19 major changes and 54 fixed Bugzilla issues. A huge thanks goes to the 47 contributors who made 2.092.0 possible.

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

Compiler changes

  1. Class deallocator have been removed from the language

    Class deallocator have been deprecated in v2.080.0 (see the changelog entry), and turned into an error in v2.087.0. They have now been completely removed from the language, and the parser won't recognize them anymore.

  2. Can now report line numbers in GNU error style

    DMD now supports reporting errors and warnings in GNU error style, that is, filename:line[:column]: message. This may ease compatibility with existing IDEs.

    Enable this style by calling DMD with -verror-style=gnu.

  3. Added experimental C++ header generation from extern(C|C++) declarations

    DMD can now write C++ header files which contain bindings for declarations in existing D files that were marked as extern(C) or extern(C++).

    This feature is available via the following command line switches:

    • -HC: Write the generated headers to standard output
    • -HCf=<file>: Write the generated headers to file
    • -HCd=<directory>: Write the generated headers to file (not implemented yet)

    Consider the following example:

    module a;
    
    extern(C) int foo(int a) { ... }
    extern(C++) void bar() { ... }
    void ignored() { ... }
    
    module b;
    
    extern (C++) struct S
    {
        string name;
        this (string name) { ... }
        bool bar() { ... }
    }
    
    module c;
    
    import a, b;
    
    extern (C++) class C
    {
        S[] s;
        this () {}
        bool bar() { ...}
    }
    
    

    Compiling these modules with dmd -c -o- -HC a.d b.d c.d will generate the following header:

    #pragma once
    
    // Automatically generated by dmd -HC
    
    #include <assert.h>
    #include <stddef.h>
    #include <stdio.h>
    #include <string.h>
    
    #define _d_void void
    #define _d_bool bool
    #define _d_byte signed char
    #define _d_ubyte unsigned char
    #define _d_short short
    #define _d_ushort unsigned short
    #define _d_int int
    #define _d_uint unsigned
    #define _d_long long long
    #define _d_ulong unsigned long long
    #define _d_float float
    #define _d_double double
    #define _d_real long double
    #define _d_char char
    #define _d_wchar wchar_t
    #define _d_dchar unsigned
    typedef _d_long d_int64;
    #define _d_null NULL
    
    // Parsing module a
    // Parsing module b
    // Parsing module c
    struct S;
    extern "C" _d_int foo(_d_int a);
    
    extern _d_void bar();
    
    // ignoring function a.ignored because of linkage
    struct S
    {
        DArray< _d_char > name;
        S(DArray< _d_char > name);
        _d_bool bar();
        S() : name() {}
    };
    
    class C
    {
    public:
        DArray< S > s;
        C();
        virtual _d_bool bar();
    };
    

    Refer to the documentation for further information regarding C++ interoperation.

    Note that this feature is considered experimental and might not work correctly sometimes. Please open an issue in the bug tracker if you encounter a bug while using this feature.

Runtime changes

  1. Added missing pthread_attr_destroy in some place.

    Added missing pthread_attr_destroy, this prevents memory leak in some OSes such as freebsd or solaris.

  2. Expanded bindings in core.sys.windows.security

    Many enum members were missing, the list is now reasonably up-to-date.

  3. Added core.stdcpp.memory.unique_ptr

    Added core.stdcpp.memory.unique_ptr, which corresponds to C++ std::unique_ptr.

  4. Added TFD_TIMER_CANCEL_ON_SET.

    Added TFD_TIMER_CANCEL_ON_SET option, which marks a timer as cancelable if the realtime clock is used.

Library changes

  1. std.bigint is now @safe

    Many BigInt operations used to be @system because of assembly routines and casts from mutable to immutable data. These parts are now marked @trusted, so that BigInt can now be used in @safe code.

  2. Replaced approxEqual by isClose in std.math.

    The template approxEqual for comparing floating point numbers has been replaced by the template isClose, which has better default values and is symmetric in its arguments.

    To (almost) keep the current behaviour of approxEqual(a, b) use isClose(a, b, 1e-2, 1e-2), but we recommend to adjust the code to make it work with isClose(a, b).

    In one of the next releases approxEqual will be deprecated and eventually removed.

  3. Removed deprecated std.format.Mangle.

    The deprecated enum Mangle containing mangled names of basic types has been removed. Use std.demangle.demangle instead to parse mangled names.

  4. Removed deprecated structs ByLine, ByChunk, ByRecord from std.stdio.

    The deprecated structs ByLine, ByChunk, ByRecord have been removed from std.stdio. Use the functions byLine, byChunk, byRecord instead.

  5. Removed deprecated functions from std.string

    The deprecated functions inPattern, countchars, removechars, squeeze and munch in std.string have been removed. Any code that still needs them can use UndeaD instead.

  6. std.algorithm.sorting.schwartzSort supports binary transform functions too

    The transform template parameter of std.algorithm.sorting.schwartzSort isn't restricted to unary functions taking an element anymore, but can also be a binary function taking an element and its index in the original range.

    The original index can therefore be used when computing the transformed value to sort by.

  7. Added curry to std.functional

    Converts a function of multiple parameters to a function of 1 parameter that returns a function of 1 parameter... until it runs out of parameters and evaluates the function. Essentially: f(x, y, z) == curry(f)(x)(y)(z)

Installer changes

  1. The install script now runs on Windows

    The D installation script (install.sh, available at dlang.org/install.sh) now supports POSIX-like environments on Windows. This allows installing and using Windows versions of DMD, LDC, and Dub from e.g. CygWin or MSys2, thus providing a unified way of installing D compilers across supported platforms.

  2. The Windows installation has received a couple of updates

    • the released dmd.exe is now built with LDC for a reduction of compilation times of 30-40%.
    • 64-bit builds of dmd.exe, dub.exe and lld-link.exe have been added to the bin64 folder
    • The bundled Windows libraries and definitions have been changed from MinGW 5.0.2 to MinGW 7.0.0 (with additional wide string main entrypoints).
    • The bundled LLD linker on Windows has been upgraded to 9.0.0 (including a patch that allows exceptions to work on Win32).
    • The VC runtime linked with the MinGW import libraries has been upgraded to msvcr120.dll (the last version that allows simple copying and no dependency on the universal C runtime). The redistributable DLLs have been added to the respective bin folder for immediate use without running additional installers.
    • The curl libraries/DLLs have been updated to 7.68.
    • ancient windbg.exe has been removed from the installation.
    • The installer now detects an installation of VS 2019. If no VC installation is found the proposed download is not VS 2017 anymore, but VS 2019.

Dub changes

  1. Builds dynamicLibrary targets as dynamic libraries instead of static libraries.

    Dub will no longer build dynamicLibrary targetType's as staticLibrary.

    Except for x86_omf. This has been disabled due to numerous issues that will lead this to not doing what is expected of it.

    No compiler or linker flags have been added at this time, you will need to specify the relevant flag to get the compiler to link dynamically against Phobos.

  2. The $DUB_BUILD_PATH variable was added

    The $DUB_BUILD_PATH variable is now defined inside the postBuildCommands section. It contains the absolute path in which the package was built, and can be used to copy by-products of the build process to their intended locations.

    For example, if an executable exports symbols, you will want to make the resulting import library and symbols export file available somewhere. That can be done with a dub.json section like this:

        "postBuildCommands-windows": [
            "copy /y $DUB_BUILD_PATH\\$DUB_TARGET_NAME.lib $PACKAGE_DIR\\lib"
            "copy /y $DUB_BUILD_PATH\\$DUB_TARGET_NAME.exp $PACKAGE_DIR\\lib"
        ],
    
  3. Command environment variable substitution changed

    Now users can use the documented predefined variables inside custom command directives without the need for a wrapper shell script.

    Before this would have failed:

    "preBuildCommands": ["$DC -run foo.d"]
    

    unless DC was defined as environment variable outside DUB.

    It was before possible to run a script that used the $DC environment variable or on POSIX escape the $ with $$DC to make the shell substitute the variable. These workarounds are no longer needed now.

    API change: none of the different command directives are no longer substituted with the process environment variables. You now access the raw commands as provided by the user in the recipe. dub describe has been adjusted and now also processes the predefined environment variables as well as the process environment variables.


List of all bug fixes and enhancements in D 2.092.0:

DMD Compiler regressions

  1. Bugzilla 20130: ICE when casting from string to other array type due to __ArrayCast not being written
  2. Bugzilla 20596: [REG2.086] Error on missed stack allocation for closure for template
  3. Bugzilla 20597: [REG2.080] Wrong closure GC allocation with dip1000
  4. Bugzilla 20718: enum type mismatch causes wrong location on error
  5. Bugzilla 20730: [REG 2.091] __traits(compiles) fails if any ungagged errors occurred in compilation
  6. Bugzilla 20742: dmd -X (JSON output) includes uncompiled symbols

DMD Compiler bugs

  1. Bugzilla 14639: Assigning init value to struct uses stack, causing segfault
  2. Bugzilla 15867: Compiler reports wrong error location for immutability error
  3. Bugzilla 18651: ice: assert in glue.d:777 when building these three trivial files
  4. Bugzilla 19949: C++ Mangling: no support for abi-tags from the Itanium ABI
  5. Bugzilla 20084: return by auto ref unsafe - and different code for inout ref and ref.
  6. Bugzilla 20461: [dip1000] Passing stack allocated string to assert compiles
  7. Bugzilla 20593: [GCC ASM] Parser syntax for asm operands differs from GCC
  8. Bugzilla 20610: const in a .tupleof loop is ignored
  9. Bugzilla 20637: spelling correction offers private members
  10. Bugzilla 20638: spelling correction offers private member of package on named package access
  11. Bugzilla 20643: printf without arguments aborts compilation
  12. Bugzilla 20644: Invalid printf deprecation for ubyte passed to "%hhu"
  13. Bugzilla 20645: printf deprecation for width + precision
  14. Bugzilla 20653: Short-circuiting boolean logic not working
  15. Bugzilla 20656: cannot compile live function without -preview=dip1021
  16. Bugzilla 20658: can modify overlapped storage classes in @safe enum function
  17. Bugzilla 20675: dip1000 improper error about copying scope parameter into allocated memory
  18. Bugzilla 20682: [DIP1000] wrong error: scope variable may not be copied into allocated memory
  19. Bugzilla 20692: Nested alias declarations and getMember trait can crash dmd
  20. Bugzilla 20696: Should error when retrieving mangling while the type is not yet final
  21. Bugzilla 20700: Forward references leads to extern(C++, class|struct) being ignored
  22. Bugzilla 20779: Segfault when self-containing struct is accessed from inside in a __traits(compiles) context
  23. Bugzilla 20795: [dip1000] segfault on templated opEquals

DMD Compiler enhancements

  1. Bugzilla 20444: Make __DATE__ in dlang reproducible using SOURCE_DATE_EPOCH
  2. Bugzilla 20470: accessing an AliasSeq tuple loses this
  3. Bugzilla 20609: Disabled and deprecated functions show up as candidate
  4. Bugzilla 20625: Function literal diagnostic is not on par with other messages
  5. Bugzilla 20627: Module ctors / dtors should always have D linkage
  6. Bugzilla 20636: Support the RDSEED instruction in asm blocks
  7. Bugzilla 20734: Array literals as arguments to scope slice parameters should be stack-allocated

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[]
  3. Bugzilla 20733: Documentation for hasElaborateAssign says copy construction creates an opAssign
  4. Bugzilla 20743: Checked!(int, Abort) does not abort but raise SIGFPE
  5. Bugzilla 20755: ImplicitConversionTargets of const class are nonconst
  6. Bugzilla 20799: schwartzSort does not pin transformation results with indirections, leading to memory corruption
  7. Bugzilla 20967: Decimal string parsing isn't IEEE compatible

Phobos enhancements

  1. Bugzilla 20723: std.random.unpredictableSeed: on x86/x86-64 try using RDRAND when there is no arc4random
  2. Bugzilla 20732: swap doesn't support types with impure gc or throwing copy constructors

Druntime regressions

  1. Bugzilla 20649: Trait isZeroInit gives false in certain scenarios
  2. Bugzilla 20748: Deprecation for assert using shared type and checkaction=context

Druntime bugs

  1. Bugzilla 20731: checkaction=context fails for structs with 'alias this'
  2. Bugzilla 20750: checkaction=context segfaults for null references
  3. Bugzilla 20757: checkaction=context prints characters as integers

Druntime enhancements

  1. Bugzilla 19924: Make core.bitop.bswap(ulong) work in betterC
  2. Bugzilla 20178: Add TypeInfo_Class/TypeInfo_Interface.isBaseOf (equivalent to C#/Java isAssignableFrom)
  3. Bugzilla 20711: object.update requires the "update" callback to wastefully return a copy of the updated value
  4. Bugzilla 20741: dup, idup for arrays plus keys, values for built-in associative arrays: if a type is known to have a postblit do not emit code for the non-postblit path and vice versa

Contributors to this release (47)

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

previous version: 2.091.0