diff options
| author | Iain Buclaw <ibuclaw@gdcproject.org> | 2024-04-06 14:14:11 +0200 |
|---|---|---|
| committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2024-04-06 14:26:37 +0200 |
| commit | 09992f8b881aa2dfbee1e9d6954c3ca90cd3fe41 (patch) | |
| tree | 9797d4558fcf72ad26e15365b3650fc886ff52b4 /libphobos/libdruntime | |
| parent | 06a7e7514af67d9f3c51fe7a592b5166da791e2f (diff) | |
d: Merge upstream dmd, druntime b65767825f, phobos 92dc5a4e9.
Synchronizing with the upstream release of v2.108.0.
D front-end changes:
- Import dmd v2.108.0.
D runtime changes:
- Import druntime v2.108.0.
Phobos changes:
- Import phobos v2.108.0.
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd b65767825f.
* dmd/VERSION: Bump version to v2.108.0.
libphobos/ChangeLog:
* libdruntime/MERGE: Merge upstream druntime b65767825f.
* src/MERGE: Merge upstream phobos 92dc5a4e9.
Diffstat (limited to 'libphobos/libdruntime')
| -rw-r--r-- | libphobos/libdruntime/MERGE | 2 | ||||
| -rw-r--r-- | libphobos/libdruntime/core/internal/array/duplication.d | 14 |
2 files changed, 13 insertions, 3 deletions
diff --git a/libphobos/libdruntime/MERGE b/libphobos/libdruntime/MERGE index a00872ef864..dc47db87a80 100644 --- a/libphobos/libdruntime/MERGE +++ b/libphobos/libdruntime/MERGE @@ -1,4 +1,4 @@ -855353a1d9e16d43e85b6cf2b03aef388619bd16 +b65767825f365dbc153457fc86e1054b03196c6d The first line of this file holds the git revision number of the last merge done from the dlang/dmd repository. diff --git a/libphobos/libdruntime/core/internal/array/duplication.d b/libphobos/libdruntime/core/internal/array/duplication.d index eec6af92fef..9df84893bb9 100644 --- a/libphobos/libdruntime/core/internal/array/duplication.d +++ b/libphobos/libdruntime/core/internal/array/duplication.d @@ -21,9 +21,9 @@ U[] _dup(T, U)(scope T[] a) pure nothrow @trusted if (__traits(isPOD, T)) { import core.stdc.string : memcpy; import core.internal.array.construction: _d_newarrayUPureNothrow; - auto arr = _d_newarrayUPureNothrow!T(a.length, is(T == shared)); + auto arr = _d_newarrayUPureNothrow!U(a.length, is(U == shared)); memcpy(cast(void*) arr.ptr, cast(const(void)*) a.ptr, T.sizeof * a.length); - return *cast(U[]*) &arr; + return arr; } } @@ -358,3 +358,13 @@ U[] _dup(T, U)(T[] a) if (!__traits(isPOD, T)) static assert(test!Copy()); assert(test!Copy()); } + +// https://issues.dlang.org/show_bug.cgi?id=24453 +@safe unittest +{ + static inout(char)[] foo(ref scope return inout(char)[] s) + { + auto bla = s.idup; + return s; + } +} |
