Commit graph

20500 commits

Author SHA1 Message Date
Iain Buclaw
03aeafd209
Merge pull request #10616 from ibuclaw/merge_stable
Fix #10574 - environment pointer sometimes changes before exec, causing segfault in child process.
2025-01-10 00:03:50 +01:00
Iain Buclaw
d643650ee5 Merge remote-tracking branch 'upstream/stable' into merge_stable 2025-01-09 22:30:38 +00:00
Elias Batek
63fdb282f1
Replace internal getEnvironPtr with its equivalent from druntime (#10614)
* Replace internal `getEnvironPtr` with its equivalent from druntime

* Further simplify
2025-01-08 23:57:35 -08:00
The Dlang Bot
955c6e3308
Merge pull request #8727 from ntrel/extrema
[std.algorithm.searching] Add extrema to compute min and max

Signed-off-by: Adam Wilson <LightBender@users.noreply.github.com>
Merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2025-01-03 08:01:59 +01:00
Nick Treleaven
347e4152cc Extend tests 2025-01-03 03:38:57 +01:00
Nick Treleaven
92f677f2cf Only require input range 2025-01-03 03:38:57 +01:00
Nick Treleaven
762b0b4881 Minor tweaks 2025-01-03 03:38:57 +01:00
Nick Treleaven
6c7d0e2ef1 [std.algorithm.searching] Add extrema 2025-01-03 03:38:55 +01:00
Elias Batek
35c492c4ba
Make File.byLineCopy usable in @safe contexts (#10606) 2025-01-02 11:59:10 +08:00
Elias Batek
0e97dc5e6b
Update CODEOWNERS to reflect that logger has been moved out of std.experimental (#10608)
This should have been done with #8486 IMHO.
2025-01-02 10:11:36 +08:00
Steven Schveighoffer
ad8ee55872
Fix #10607 - Structs lines and ByLineCopy cannot be usefully constructed in @safe code (#9035)
Originally known as "Properly mark lines constructor".

Co-authored-by: Elias Batek <15967408+0xEAB@users.noreply.github.com>
2025-01-02 07:16:00 +08:00
Elias Batek
262645bf32
Make toDelegate safe for function pointers (#10599)
Co-authored-by: Quirin F. Schroll <Bolpat@users.noreply.github.com>
Co-authored-by: Elias Batek <0xEAB@users.noreply.github.com>
2024-12-30 15:53:25 +08:00
Elias Batek
4c4c37a8bf
Fix #10603 - toDelegate accepts but can’t handle a templated opCall (#10602) 2024-12-30 12:27:50 +08:00
Vladimir Panteleev
8c6fca9ccd Fix issue 10587 - std.process.kill should fail for a terminated pid
https://github.com/dlang/phobos/issues/10587
2024-12-29 13:06:58 +01:00
Adam Wilson
68da19aed8
Update CODEOWNERS (#10600)
Removed old CODEOWNERS who are no longer part of D.
2024-12-29 18:32:33 +08:00
Simen Kjærås
ff25f6dfff
Fix #10380 - Memoize should handle lambdas (#7507) 2024-12-29 09:21:06 +08:00
Sebastian Wilzbach
d8955042d6
Fix #10257 - variadic overload of std.algorithm.searching.countUntil should return which needle was found (#5618) 2024-12-27 11:41:14 +08:00
Elias Batek
de2b97fd8d
Add SharedAllocatorList (#10594)
Co-authored-by: Alexandru Jercaianu <alex.jercaianu@gmail.com>
2024-12-27 11:40:08 +08:00
Sebastian Wilzbach
0124e4772a
Add isSliceOf to check the origin of a slice (#6147) 2024-12-26 14:22:29 +08:00
Mike
8973596c05 Fix #10581std.logger has an ostensibly broken example and wrong docs
Co-authored-by: Elias Batek <desisma@heidel.beer>
2024-12-11 09:30:19 +01:00
Runa
b2ecb210a1
Fix Issue 10386: Make std.math.isIdentical work in CTFE with coverage tests (#10576)
* Fix Issue 20197 - Make std.math.isIdentical work in CTFE

* Added tests for function isIdentical

Signed-off-by: runiixx <murgua03@gmail.com>

* Fix Issue 10386

Signed-off-by: runiixx <murgua03@gmail.com>

* fixing style

Signed-off-by: runiixx <murgua03@gmail.com>

---------

Signed-off-by: runiixx <murgua03@gmail.com>
Co-authored-by: Nathan Sashihara <21227491+n8sh@users.noreply.github.com>
2024-12-08 17:17:39 -08:00
Vladiwostok
2c267631cc Fix linting issue in filelogger.d 2024-12-09 01:08:26 +01:00
0-v-0
823f7aa500
Remove unused import (#10578) 2024-12-08 15:54:03 +08:00
Steven Schveighoffer
d767448ea6 Fix #10574 - environment pointer sometimes changes before exec, causing
segfault in child process.
2024-12-07 22:43:50 +01:00
0-v-0
1763d5eb27
Remove unused import (#10571) 2024-12-06 17:27:44 -08:00
John Dougan
9e7d2f37cf
Fix typos in compound format descriptions (#10572)
Someone tried to \( instead of $(LPAREN) inside of a bold macro. Didn't work and made the description very misleading.
2024-12-04 08:32:35 +08:00
Dennis
dbc09d8230
Merge pull request #10570 from dkorpel/bugzilla-links-rm
Remove bugzilla references
2024-12-01 23:36:06 +01:00
Dennis Korpel
c4ce4307ba Remove bugzilla references 2024-12-01 23:23:23 +01:00
Dennis
202fe14063
Merge pull request #9093 from 0-v-0/master
Remove unused import
2024-11-27 17:39:10 +01:00
0-v-0
db84813208 Remove unused import 2024-11-27 21:40:53 +08:00
Dennis
600c721875
Fixes for -preview=rvaluerefparam (#9092)
* Update `hasToString` for `-preview=rvaluerefparam`

* Remove ref parameter test of parse()
2024-11-26 22:29:24 -08:00
João Lourenço
6b666971bc
Add 'std.format.read.formattedRead' overloads to return a Tuple with values read (#8647)
* refactor(formattedRead): add not is type validation to template argument 'fmt'

Signed-off-by: João Lourenço <jlourenco5691@gmail.com>

* feat(formattedRead): add overloads to return a tuple with the read values

Signed-off-by: João Lourenço <jlourenco5691@gmail.com>

* test(formattedRead): add unnittests for the tuple return type overloads

Signed-off-by: João Lourenço <jlourenco5691@gmail.com>

* chore(changelog): add a changelog formattedRead entry

Signed-off-by: João Lourenço <jlourenco5691@gmail.com>

---------

Signed-off-by: João Lourenço <jlourenco5691@gmail.com>
2024-11-25 20:43:04 -08:00
Jonathan M Davis
5d16dafff0 Add note to Unqualified about is(immutable T == immutable U).
In many cases, even when using Unqualified makes sense (as opposed to
Unconst or Unshared), using is(immutable T == immutable U) works just as
well and avoids instantiating any additional templates. This seems to
becoming more known in the D community over time, but it seems
appropriate to mention it in Unqualified's documentation so that more
people will be made aware.

Also, I changed it so that Unqualified is always a wrapper template
instead of directly being an alias of Unqual in core.internal.traits.
This is because the names don't match, and the alias will show up in any
error messages. Long term, we would ideally rename the symbol in
core.internal (potentially turning the std.traits versions into a
wrapper templates instead of an alias). However, since the functionality
is effectively the same, and the std.traits one is the one currently
being used by code in general, it seems better to let the std.traits one
be the alias for now. The same applies to a few traits which are
implemented in core.internal.traits and imported in std.traits or
phobos.sys.traits.
2024-11-25 23:50:22 +01:00
Jonathan M Davis
0744ca6754
Add hasComplex{Assignment,Copying,Destruction). (#9088)
These are the Phobos v3 equivalents of std.traits' hasElaborateAssign,
hasElaborateCopyConstructor, and hasElaborateDestructor. After some
discussion with Adam Wilson, I went with "Complex" rather than
"Elaborate" with the idea that it would be easier to understand for
non-native English speakers. It's also shorter, which is a plus. I also
tried to make the names more consistent (and avoided having
"CopyConstructor" in the name, because it also deals with the postblit
constructor).

For the moment, I have not created hasComplexMoving to check for move
constructors, since that situation has yet to be finalized in the
language. I was surprised to find out that hasElaborateMove was even a
thing, since it was my understanding that opPostMove had never actually
been implemented, so I don't know if we're going to have to worry about
that at all, but either way, it seemed best to leave the question of a
trait for moving until later given that that situation is still in limbo
(even if it does look like the new compiler implementation is well
along).
2024-11-24 02:05:43 -08:00
Jonathan M Davis
aee681c468
Fix Bugzilla issue 24875 (#9090)
This makes it so that enums whose base type is an aggregate type are
also considered an aggregate type. It probably doesn't affect much code,
since isAggregateType isn't needed often, and it's fairly rare to
declare enums whose base type is an aggregate type, but in general, code
that cares whether a type is an aggregate type is going to care that an
enum's base type is an aggregate type.
2024-11-23 16:02:11 -08:00
Jonathan M Davis
43f00ee83d Fix phobos.sys.traits.isAggregateType to handle enums.
The std.traits version does not take enums into account (and prior to
this commit, neither does the phobos.sys version), but upon reflection,
it seems like it's just likely to cause bugs if it doesn't take enums
into account. Granted, enums whose base type is an aggregate type don't
seem to be very common, but as a result of that, code that tests for
aggregate types likely won't take them into account in the vast majority
of cases, and I see no reason to not have the trait just deal with it
rather than hoping that the user of the trait realizes that it's a
potential issue, in which case, they would need to explicitly use
OriginalType themselves to make it work for enums.

In addition, this way, OriginalType doesn't even get instantiated unless
the type is actually an enum, whereas the correct solution that would
most likely be used otherwise would be to just always do
isAggregateType!(OriginalType!T) instead of isAggregateType!T.

I also put a ddoc comment on the unittest block, since I apparently
missed it previously.
2024-11-23 12:25:19 +01:00
Paul Backus
08638dd71c
Merge pull request #9087 from pbackus/sumtype-template-overhead
sumtype: reduce template overhead of match
2024-11-20 20:39:34 -05:00
Paul Backus
f3d92d9f9e sumtype: add fast path for single dispatch
This reduces the number of templates instantiated by matchImpl in the
common case where only one SumType is being matched on.
2024-11-20 15:25:01 -05:00
Paul Backus
be59d94737 sumtype: avoid template recursion in handlerArgs 2024-11-20 15:25:01 -05:00
Paul Backus
7362ac5bee sumtype: reduce instantiations of handlerArgs
Calls to matchImpl whose SumType arguments have the same dimensions will
now share instantiations, instead of having separate ones.
2024-11-20 15:24:43 -05:00
Paul Backus
b883c5ce92 sumtype: reduce instantiations of TagTuple
Tuples with the same dimensions now share a single instantiation,
regardless of the types held by the SumTypes they are used for.
2024-11-20 14:51:17 -05:00
Paul Backus
4c41b433dc sumtype: put private matchImpl helpers together 2024-11-20 14:41:44 -05:00
The Dlang Bot
edf6fb92e4
Merge pull request #9086 from kinke/merge_stable
Merge stable

Signed-off-by: Nicholas Wilson <thewilsonator@users.noreply.github.com>
Merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2024-11-17 02:03:49 +01:00
Martin Kinkelin
b0ef9ac009 Merge remote-tracking branch 'origin/stable' into merge_stable 2024-11-17 01:17:07 +01:00
Martin Kinkelin
bf6e70b104
GitHub Actions: Remove macos-12 job, as the image will disappear soon (#9085) 2024-11-17 08:08:31 +08:00
Steven Schveighoffer
567b3758de
Fix appender code that might not initialize memory that might point at huge allocations (#9084) 2024-11-15 07:59:01 +08:00
Dennis
db798688e4
Merge pull request #9083 from tim-dlang/issue24851
Fix bugzilla 24851 - Some members of CustomFloat can have const this
2024-11-10 23:25:37 +01:00
Tim Schendekehl
8b051674cc Fix bugzilla 24851 - Some members of CustomFloat can have const this 2024-11-10 13:53:13 +01:00
Elias Batek
9771a247f5 Reference std.digest.fromHexString in doc of std.conv.hexString 2024-11-04 05:15:38 +01:00
Geod24
9aa794ca15 Fix Bugzilla Issue 17416 - Add REUSEPORT to std.socket
The issue also mentions the Druntime bindings, which have been added a few years ago,
however this was missing from std.socket. This implementation provides SO_REUSEPORT on
Windows as well, despite it being equivalent to SO_REUSEADDR, to simplify client code.

Co-authored-by: Elias Batek <desisma@heidel.beer>
2024-11-04 05:09:48 +01:00