From c428454ecee141937a6810dd6213716602d563ca Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Sat, 3 Feb 2024 14:00:24 +0100 Subject: d: Merge dmd, druntime a6f1083699, phobos 31dedd7da D front-end changes: - Import dmd v2.107.0. - Character postfixes can now also be used for integers of size two or four. D run-time changes: - Import druntime v2.107.0. Phobos changes: - Import phobos v2.107.0. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd a6f1083699. * dmd/VERSION: Bump version to v2.107.0 * Make-lang.in (D_FRONTEND_OBJS): Add d/pragmasem.o. * d-builtins.cc (strip_type_modifiers): Update for new front-end interface. * d-codegen.cc (declaration_type): Likewise. (parameter_type): Likewise. * d-target.cc (TargetCPP::parameterType): Likewise. * expr.cc (ExprVisitor::visit (IndexExp *)): Likewise. (ExprVisitor::visit (VarExp *)): Likewise. (ExprVisitor::visit (AssocArrayLiteralExp *)): Likewise. * runtime.cc (get_libcall_type): Likewise. * typeinfo.cc (TypeInfoVisitor::visit (TypeInfoConstDeclaration *)): Likewise. (TypeInfoVisitor::visit (TypeInfoInvariantDeclaration *)): Likewise. (TypeInfoVisitor::visit (TypeInfoSharedDeclaration *)): Likewise. (TypeInfoVisitor::visit (TypeInfoWildDeclaration *)): Likewise. * types.cc (build_ctype): Likewise. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime a6f1083699. * src/MERGE: Merge upstream phobos 31dedd7da. --- libphobos/src/std/algorithm/searching.d | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'libphobos/src/std/algorithm') diff --git a/libphobos/src/std/algorithm/searching.d b/libphobos/src/std/algorithm/searching.d index 4526aa2..465723c 100644 --- a/libphobos/src/std/algorithm/searching.d +++ b/libphobos/src/std/algorithm/searching.d @@ -5053,7 +5053,8 @@ if (isInputRange!Range) _input = input; _sentinel = sentinel; _openRight = openRight; - static if (isInputRange!Sentinel) + static if (isInputRange!Sentinel + && is(immutable ElementEncodingType!Sentinel == immutable ElementEncodingType!Range)) { _matchStarted = predSatisfied(); _done = _input.empty || _sentinel.empty || openRight && _matchStarted; @@ -5120,7 +5121,8 @@ if (isInputRange!Range) assert(!empty, "Can not popFront of an empty Until"); if (!_openRight) { - static if (isInputRange!Sentinel) + static if (isInputRange!Sentinel + && is(immutable ElementEncodingType!Sentinel == immutable ElementEncodingType!Range)) { _input.popFront(); _done = _input.empty || _sentinel.empty; @@ -5237,6 +5239,7 @@ pure @safe unittest assert(equal(r.save, "foo")); } } + // https://issues.dlang.org/show_bug.cgi?id=14543 pure @safe unittest { @@ -5267,3 +5270,10 @@ pure @safe unittest assert("one two three".until!((a,b)=>a.toUpper == b)("TWO", No.openRight).equal("one two")); } +// https://issues.dlang.org/show_bug.cgi?id=24342 +pure @safe unittest +{ + import std.algorithm.comparison : equal; + assert(["A", "BC", "D"].until("BC", No.openRight).equal(["A", "BC"])); + assert([[1], [2, 3], [4]].until([2, 3], No.openRight).equal([[1], [2, 3]])); +} -- cgit v1.1