Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REG 2.104] inout error with -profile=gc #17473

Open
dlangBugzillaToGithub opened this issue Feb 8, 2024 · 1 comment
Open

[REG 2.104] inout error with -profile=gc #17473

dlangBugzillaToGithub opened this issue Feb 8, 2024 · 1 comment
Labels
Druntime:GC Issues relating the Garbage Collector Druntime Specific to druntime Feature:coverage Specific to coverage P1 Severity:Regression PRs that fix regressions

Comments

@dlangBugzillaToGithub
Copy link

Tim reported this on 2024-02-08T22:10:50Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=24378

Description

```
inout(char)[] foo(inout(char)[] s) pure @safe
{
    s = s[0..1] ~ '%';
    return s;
}
```

The above code compiled with and without -profile=gc until DMD version 2.103. Since DMD 2.104 it only compiles without -profile=gc and produces the following error with -profile=gc:

/path/to/dmd.linux/dmd2/linux/bin64/../../src/druntime/import/core/lifetime.d(1573): Error: `inout` on `return` means `inout` must be on a parameter as well for `pure nothrow @nogc @property @safe inout(char)[]()`
/path/to/dmd.linux/dmd2/linux/bin64/../../src/druntime/import/core/internal/array/concatenation.d(174): Error: template instance `core.internal.array.concatenation._d_arraycatnTXTrace!(inout(char)[], inout(char)[], inout(char))._d_arraycatnTXTrace.forward!(__param_3, __param_4)` error instantiating
onlineapp.d(3):        instantiated from here: `_d_arraycatnTXTrace!(inout(char)[], inout(char)[], inout(char))`

As a result of this issue, compiling DMD itself with -profile=gc does not work any more.
@dlangBugzillaToGithub
Copy link
Author

tim.dlang commented on 2024-02-09T17:13:06Z

It seems to fail since this PR: https://github.com/dlang/dmd/pull/14550

@thewilsonator thewilsonator added Druntime Specific to druntime Druntime:GC Issues relating the Garbage Collector Severity:Regression PRs that fix regressions Feature:coverage Specific to coverage and removed regression OS:Linux Arch:x86_64 Issues specific to x86_64 labels Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Druntime:GC Issues relating the Garbage Collector Druntime Specific to druntime Feature:coverage Specific to coverage P1 Severity:Regression PRs that fix regressions
Projects
None yet
Development

No branches or pull requests

2 participants