Commit graph

16625 commits

Author SHA1 Message Date
Nick Treleaven
61bd59c669
[std.format] Add anchors for section headings (#9054) 2024-10-02 16:54:07 +03:00
Sönke Ludwig
2168becf74 Fix Bugzilla 24773: Don't invoke destructors on uninitialized elements in stable sort
Uses a regular initialized temporary array when sorting elements with an elaborate assignment to avoid undefined behavior when destructors, postblits or copy constructors are invoked during the array assignment.
2024-09-20 13:38:31 +02:00
Ate Eskola
b3a9736480 graphemeStride now @nogc with DChars 2024-09-20 12:23:11 +02:00
Andrei Horodniceanu
48d581a1f5
Fix Bugzilla 24715 - std/process: Default to libc closefrom in spawnProcessPosix
The current implementation of spawnProcessPosix is broken on systems
with a large `ulimit -n` because it always OOMs making it impossible
to spawn processes. Using the libc implementation, when available, for
doing file descriptor operations en-mass partially solves this problem.

Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
2024-08-26 14:59:53 +03:00
RubyTheRoobster
cd026126db
Issue 24095 - std.bitmanip.bitfields no longer works with bool enum t… (#9043)
* Fix Bugzilla Issue 24095 - std.bitmanip.bitfields no longer works with bool enum types

* Fix trailing whitespace

* Remove extra space
2024-08-19 15:05:36 +03:00
Jonathan M Davis
f7e523bc3c Fix Bugzilla issue 24704: Improve error messages for from*String in std.datetime.
The documentation for the from*String functions specifies what they
accept, and the fromISO*String functions accept ISO or ISO extended
strings, but it is technically the case that there are ISO and ISO
extended strings which they do not accept (since the standard specifies
what the fields should look like for each string but doesn't specify
that all fields must be present or that any code parsing them must
accept all variants).

So, technically, the error messages which have said that the given
strings are not valid ISO or ISO extended strings are not necessarily
correct. So, this changes the error messages to remove that ambiguity.
2024-08-17 00:35:51 +02:00
Dennis Korpel
bbb156629e std.uni: Make auto ref adjacent 2024-08-14 17:10:41 +02:00
Nick Treleaven
f11b19d411 Fix Bugzilla 24698 - Appender needs to expose readonly property 'size_t length' without using 'data' property
Add `length` property rather than `app[].length`.

Also remove `@trusted` attribute from `@safe` function.
2024-08-09 00:32:24 +02:00
0-v-0
59200013b3
Remove std.conv import from skipData (#9040) 2024-08-07 17:21:24 +03:00
Luis Ferreira
9c11552ac2
Fix issue 24686: SumType stopped working with unmatched DeducedParameterType template 2024-08-03 11:53:46 +02:00
Paul Backus
ebd24da8ad
Fix Bugzilla 22293: opCast!bool for Nullable (#9039)
The second opCast overload is necessary to allow built-in implicit
conversions (e.g., mutable to const) to be performed explicitly via a
cast expression. Nullable.opEquals depends on this behavior.
2024-08-01 17:09:38 +08:00
Nick Treleaven
4641576812
Fix Bugzilla 20872 - std.array.assocArray trusts user-provided 'front… (#9036) 2024-07-31 20:07:23 +08:00
Nick Treleaven
4552211174
Fix Bugzilla 20870 - std.outbuffer.printf is trusted (#9037) 2024-07-31 20:05:48 +08:00
Nick Treleaven
9ffe71fea3
Fix Bugzilla 15315 - can break immutable with std.algorithm.move (#9032) 2024-07-29 06:49:54 +08:00
Nick Treleaven
7a14c896dd
Fix Bugzilla 14138 - std.parallelism.task breaks @safety (#9033) 2024-07-29 06:45:40 +08:00
Nick Treleaven
4d54884a49
Fix Bugzilla 24685 - std.stdio.File.rawRead allows reading raw pointers from files in @safe code (#9030) 2024-07-27 07:23:54 +08:00
Dennis
6b529def35
Merge pull request #9026 from dkorpel/std-array-testcase
Bugzilla 23300 - add testcase for std.array on scope InputRange
2024-07-26 23:00:12 +02:00
Denis Feklushkin
c00a5ee6a8 Adds check bounds of year to std.datetime.date.Date 2024-07-25 03:10:46 +02:00
Denis Feklushkin
8a7aee06a3
DEPRECATED_2.107 code removed (#9028) 2024-07-23 18:20:36 +08:00
Bastiaan Veelo
4b61e7dd55
Fix sharedLog assignment. (#8995)
* Allow `new shared FileLogger()`

* Address review comment

* Update documentation.

Fix Bugzilla 23487 - std.experimental.logger assigning FileLogger to sharedLog no longer works

* Comment on `trusted` section.

---------

Co-authored-by: Atila Neves <atila.neves@gmail.com>
2024-07-22 06:47:38 +08:00
Dennis Korpel
2959a22641 Bugzilla 23300 - add testcase for std.array on scope InputRange 2024-07-21 13:12:30 +02:00
Quirin Schroll
0050fb0c0f Address style errors 2024-07-21 15:17:16 +08:00
Quirin Schroll
4d5ba46083 Fix problems with reverse 2024-07-21 15:17:16 +08:00
Quirin Schroll
9a63e1c6b4 Address style errors 2024-07-21 15:17:16 +08:00
Quirin Schroll
0a1735bf15 Fix Lockstep attribute limitation 2024-07-21 15:17:16 +08:00
Nick Treleaven
33c643245a Expand goo.gl links that may break
Note: www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html jemalloc link isn't responding, and it now lives at jemalloc.net (see also https://github.com/jemalloc/jemalloc?tab=readme-ov-file#readme).

Fixes Bugzilla Issue 24667 - goo.gl is going away.
2024-07-19 12:19:43 +02:00
Dennis
d5780aa8f5
std.json: Document opEquals (#8975)
Co-authored-by: Dennis Korpel <dennis@sarc.nl>
2024-07-19 10:52:14 +03:00
Jeremy Baxter
7c68568353 std.stdio: fdopen is a POSIX library function
It's implemented in Windows but it's not part of standard C.

https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/fdopen
2024-07-14 15:37:44 +12:00
Jeremy Baxter
f31a7bc41d replace dead links
for link in $(grep -Eor 'https?://[^\\)", ]+' | grep -v dlang.org \
| grep -Eo 'https?://.+'); do (printf "%s: " "$link"; curl -Is "$link" \
| head -n1) | grep -E '4..$'; done

for link in $(grep -Eor '\\$\\(HTTP .+, ' | grep -v dlang.org \
| cut -d' ' -f2- | sed 's/, .*$//'); do out="$(curl -Is "$link")"; \
(! [ $? = 0 ] || printf '%s' "$out" | head -n1 | grep -Eq '4..') \
&& printf '%s\\n' "$link"; done
2024-07-14 15:16:11 +12:00
Jeremy Baxter
581f473d24 fix minor spelling mistake 2024-07-08 08:09:37 +08:00
Jeremy Baxter
f176df8475 fix ddoc blunders
Caught with grep -Er '\(\$[A-Za-z]'
2024-07-08 08:09:37 +08:00
Dennis
a6ad1522a5
Move std.math.exponential.pow implementation outside template (#9019)
* Move `std.math.exponential.pow` implementation outside template

* Fix compilation on Mac
2024-07-03 10:22:25 +03:00
Dennis
0e17a64d0e
Merge pull request #9017 from 0-v-0/master
Remove std.conv import from quickSortImpl
2024-07-02 11:51:37 +02:00
Dennis Korpel
312a86d741 Mark std.math.exponential.pow @safe 2024-07-01 01:20:46 +02:00
0-v-0
d8e8f1f351 Remove std.conv import from quickSortImpl 2024-06-22 11:07:40 +08:00
0-v-0
42e2caa5c0 Improve code readablitity in unittests 2024-06-21 18:35:03 +02:00
Dennis
b5d94743f3
Merge pull request #9007 from pbackus/improve-sumtype-examples
Improve std.sumtype examples
2024-06-17 12:01:00 +02:00
Nick Treleaven
beeed12c06 Fix assigning const(void)[] to void[]
Needed for https://github.com/dlang/dmd/pull/16583.
2024-06-16 08:57:24 +02:00
Iain Buclaw
7ff7b842a8 Merge remote-tracking branch 'upstream/stable' into merge_stable 2024-06-15 22:33:30 +00:00
FeepingCreature
539dc473ba
Fix bugzilla issue 24596: std.typecons.Rebindable2: Don't destroy classes! Only destroy structs! (#9012) 2024-06-10 23:10:18 +08:00
Nick Treleaven
ad9f87d1b8 [std.bitmanip] Make 3 examples runnable 2024-06-04 00:53:04 +02:00
Nick Treleaven
ccd3115b8b [std.regex] Fix unsafe casts to bool
These are disallowed in `@safe` code with
https://github.com/dlang/dmd/pull/16558.
2024-06-03 16:27:09 +02:00
Paul Backus
ed91e50deb sumtype: add list of examples to module doc
This will hopefully make it easier for readers to notice that all of
these examples exist.
2024-05-31 11:22:43 -04:00
Paul Backus
1aa99f8e3f sumtype: rename arithmetic evaluator example 2024-05-31 11:22:43 -04:00
Paul Backus
d1dfd094f4 sumtype: add overload-set matching example
This is a useful technique, and non-obvious enough that other D
community members were surprised when I showed it to them.

The unusual formatting and code layout used here achieves the following
goals:

1. Have this example appear below "Basic usage".
2. Have the overload set appear as it would at module level.
3. Have as much of the example code unit-tested as possible.

Goal (2), in particular, rules out the use of a "wrapper" struct to
create an overload set of static methods, which is the technique that's
normally used to include an overload set in a unittest block.
2024-05-31 11:22:43 -04:00
Paul Backus
e13bd7dec6 sumtype: remove match-by-introspection example
This technique has turned out not to be very useful in practice, and the
example is a bit subtle and tricky to understand. Removing it will make
room for more useful and less confusing examples.
2024-05-31 00:08:44 -04:00
Iain Buclaw
3a59a5a7cf Merge remote-tracking branch 'upstream/stable' into merge_stable 2024-05-27 09:41:34 +00:00
Martin Kinkelin
acd2013413 Get rid of obsolete CRuntime_DigitalMars support 2024-05-25 21:45:49 +02:00
Nick Treleaven
38fa9c3294 Fix Bugzilla 24564 - std.file.DirEntry throws Exception instead of FileException 2024-05-25 00:50:58 +02:00
Ben Jones
2133b68234 fix goto skipping over declaration 2024-05-20 14:18:50 -06:00