cachetools
cachetools copied to clipboard
Multiple tests fail
EndeavourOS/Arch x86_64. dmd 2.107-beta.1, ldc 1.36.0.
Tests fails with nothrow errors.
[...]
Running ../../../home/zorael/.dub/packages/unit-threaded/2.1.2/unit-threaded/gen_ut_main -f bin/ut.d
/usr/include/dlang/dmd/std/traits.d(8602,53): Deprecation: `__traits(getAttributes)` may only be used for individual functions, not the overload set `hash_function`
/usr/include/dlang/dmd/std/traits.d(8602,53): the result of `__traits(getOverloads)` may be used to select the desired function to extract attributes from
/usr/include/dlang/dmd/std/traits.d(8602,53): Deprecation: `__traits(getAttributes)` may only be used for individual functions, not the overload set `UseGCRanges`
/usr/include/dlang/dmd/std/traits.d(8602,53): the result of `__traits(getOverloads)` may be used to select the desired function to extract attributes from
source/cachetools/cache2q.d(779,18): Error: function `cachetools.cache2q.Cache2Q!(int, string, Mallocator).Cache2Q.put` is not `nothrow`
source/cachetools/cache2q.d(775,5): Error: delegate `cachetools.cache2q.__unittest_L767_C1.__lambda4` may throw but is marked as `nothrow`
source/cachetools/cachelru.d(487,16): Error: function `cachetools.cachelru.CacheLRU!(int, string, Mallocator).CacheLRU.put` is not `nothrow`
source/cachetools/cachelru.d(489,16): Error: function `cachetools.cachelru.CacheLRU!(int, string, Mallocator).CacheLRU.put` is not `nothrow`
source/cachetools/cachelru.d(493,16): Error: function `cachetools.cachelru.CacheLRU!(int, string, Mallocator).CacheLRU.put` is not `nothrow`
source/cachetools/cachelru.d(485,5): Error: delegate `cachetools.cachelru.__unittest_L482_C15.__lambda2` may throw but is marked as `nothrow`
Warning: struct Rebindable has method toHash, however it cannot be called with const(Rebindable!(immutable(C))) this.
Rebindable.toHash defined here: /usr/include/dlang/dmd/object.d(137)
Error /usr/bin/dmd failed with exit code 1.
Hello,
Something changed in dmd? Should I fix my code or wait for dmd release, not 2.107-beta.1 ?
There seems to have been some compiler change in dmd 2.101, released Nov 2022. Tests successfully complete with 2.100.2 but fail with 2.101.2.
$ mkdir -p ~/dlang && wget https://dlang.org/install.sh -O ~/dlang/install.sh
$ ~/dlang/install.sh update
$ ~/dlang/install.sh dmd-2.100.2
$ ~/dlang/install.sh dmd-2.101.2
$ dub test --compiler=$HOME/dlang/dmd-2.100.2/linux/bin64/dmd 2>&1 | grep Error
(no output)
$ dub test --compiler=$HOME/dlang/dmd-2.101.2/linux/bin64/dmd 2>&1 | grep Error
source/cachetools/cache2q.d(779,18): Error: function `cachetools.cache2q.Cache2Q!(int, string, Mallocator).Cache2Q.put` is not `nothrow`
source/cachetools/cache2q.d(775,5): Error: delegate `cachetools.cache2q.__unittest_L767_C1.__lambda4` may throw but is marked as `nothrow`
source/cachetools/cachelru.d(487,16): Error: function `cachetools.cachelru.CacheLRU!(int, string, Mallocator).CacheLRU.put` is not `nothrow`
source/cachetools/cachelru.d(489,16): Error: function `cachetools.cachelru.CacheLRU!(int, string, Mallocator).CacheLRU.put` is not `nothrow`
source/cachetools/cachelru.d(493,16): Error: function `cachetools.cachelru.CacheLRU!(int, string, Mallocator).CacheLRU.put` is not `nothrow`
source/cachetools/cachelru.d(485,5): Error: delegate `cachetools.cachelru.__unittest_L482_C15.__lambda2` may throw but is marked as `nothrow`
Error /home/zorael/dlang/dmd-2.101.2/linux/bin64/dmd failed with exit code 1.