Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelog/dmd.cov-inline-pragma.dd
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ inlined, so the function's lines correctly reflect how many times they
were executed.

Fixes $(LINK2 https://issues.dlang.org/show_bug.cgi?id=5848, Issue 5848) /
$(LINK2 https://github.com/dlang/dmd/issues/18337, #18337)
$(LINK2 https://github.com/dlang/dmd/issues/18337, #18337).
5 changes: 3 additions & 2 deletions changelog/dmd.deprecations.dd
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Many deprections have been turned in errors
Many deprecations have been turned into errors

Using `return` statements in scope guards is now an error (in addition to contracts and `try...finally`)
Using `return` statements in the body of a `scope(failure)` guard is now an error
(in addition to use in other scope guards, `in/out` contract and `finally` blocks).
14 changes: 7 additions & 7 deletions changelog/dmd.fastdfa.escapeanalysis.dd
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
The fast DFA engine has gained escape analysis capabilities

The engine works on the fundamental concept on "cells", a cell is a location in memory that holds something.
So a variable that is on the stack has a cell that provides it, but also may point to another cell if its typed as a pointer.
The engine works on the fundamental concept on "cells" - a cell is a location in memory that holds something.
So a variable that is on the stack has a cell that provides its storage, but also it may point to another cell if it is typed as a pointer.

Due to the fast DFA engine not being able to model indirection, the cell of a variable and its containing pointer is considered separately from cells seen via indirection.
This is particularly interesting with how by-ref parameters handle it.
The cell pointed at by the by-ref is the outer cell, even if its typed as a pointer.
The cell pointed at by the by-ref parameter is the outer cell, even if its typed as a pointer.

```d
// Think of parameter as int* not int, so the outer cell is the container for the int.
Expand All @@ -21,13 +21,13 @@ struct Animal {
int* grabFromAnimal(scope Animal* animal) => animal.datem;
```

Partial violations of ``scope`` is allowed in non-@safe functions.
Escaping via a throw statement will still error.
Partial violations of ``scope`` are allowed in non-@safe functions.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is scope supposed to have two backticks as quotes and not just a single?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Escaping via a `throw` statement will still error.

The first 29 parameters may be treated as outputs, all others must be inputs only.
This does not include the this pointer.
This does not include the `this` pointer.

No attributes have been added at this time for users to use, you must rely solely on existing ones and inference.

Experimentally it may promote stack variables that are typed as a class to stack automatically.
Experimentally it may promote stack variables that are typed as a class to the stack automatically.
This may be disabled in the future if it is shown to cause problems.
8 changes: 4 additions & 4 deletions changelog/dmd.fastdfa.uninitialized.dd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void readFromUninit() @system
}
```

As part of this it is now capable of looking through pointers and seeing properties of variables that are on the stack.
As part of this, it is now capable of looking through pointers and seeing properties of variables that are on the stack.

An application of this feature is the prevention of mathematical operators from accessing default initialized floating point types.

Expand All @@ -30,7 +30,7 @@ void checkFloatInit(bool condition)
}
```

It will not activate for other expressions, or statements.
Only in a mathematical expression.
It will not activate for other expressions, or statements -
only in a mathematical expression.

This was not originally part of the fast DFA engines scope, its continued existence depends upon community feedback as part of usage.
This was not originally part of the fast DFA engines scope. Its continued existence depends upon community feedback as part of usage.
2 changes: 1 addition & 1 deletion changelog/dmd.monitor-field.dd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The `Object.__monitor` field has been moved to druntime

This field was previously hard coded into the compiler, and is used as a mutex for `synchronized(obj)` blocks.
This field was previously hard-coded into the compiler, and is used as a mutex for `synchronized(obj)` blocks.
By declaring it explicitly in druntime's `Object`, custom druntimes can now omit it entirely, saving 8 bytes per class instance when `synchronized` is not needed.

The field is treated specially by the compiler and remains excluded from:
Expand Down
13 changes: 8 additions & 5 deletions changelog/dmd.named-args-ifti.dd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Implicit Function Template Instantiation (IFTI) handled named arguments better
Implicit Function Template Instantiation (IFTI) handles named arguments better

https://github.com/dlang/dmd/issues/21335
https://github.com/dlang/dmd/issues/22878
- <https://github.com/dlang/dmd/issues/21335>
- <https://github.com/dlang/dmd/issues/22878>

When calling a function template with named arguments, parameters that are
skipped (because their named argument was not provided) now correctly use
Expand All @@ -16,7 +16,8 @@ void main()
}
---

Named arguments that appear behind variadic arguments can now be assigned to:
Named function arguments can now be used when IFTI matches a preceding
template type sequence parameter:

---
void error(T...)(T args, string file = __FILE__, int line = __LINE__) {}
Expand All @@ -25,8 +26,10 @@ auto text(T...)(T args, Allocator alloc) {}

void foo(Allocator gc)
{
error("Code: ", code, file: __FILE__, line: __LINE__)
error("Code: ", code, file: __FILE__, line: __LINE__);

return text("hello", "world", alloc: gc);
}
---

Above, `text` requires a named argument for `alloc` when using IFTI.
4 changes: 2 additions & 2 deletions changelog/dmd.nullderefcheck.dd
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Checks for null dereferences

A new check has been implemented that injects code to check a pointer for null before it is dereferenced.

It will be typically be used if you need a backtrace generated or you want to catch and handle the `Error` as part of a scheduler.
It will typically be used if you need a backtrace generated or you want to catch and handle the `Error` as part of a scheduler.

This can be enabled for all functions by using `-check=nullderef=on` or exclusively for `@safe` functions with `-check=nullderef=safeonly`
This can be enabled for all functions by using `-check=nullderef=on` or exclusively for `@safe` functions with `-check=nullderef=safeonly`.
By default it is off.
What happens may be customized by the `-checkaction` switch and by setting a new handler in `core.exception`.

Expand Down
4 changes: 4 additions & 0 deletions changelog/dmd.tuple-unpacking.dd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ It allows extracting multiple values from a tuple or compile-time sequence direc

-------
// Requires -preview=tuples
import std.stdio : writeln;
import std.typecons : tuple;

void main()
Expand All @@ -24,6 +25,9 @@ void main()
{
// ...
}
// Unpacking works in a function literal parameter list
alias dg = ((x, y), z) => writeln(x, " ", y, " ", z);
dg(tuple(1, 2), 3); // "1 2 3\n"
}
-------

Expand Down
Loading