Thread overview | ||||||
---|---|---|---|---|---|---|
|
July 17, 2019 Error: @nogc function run cannot call non-@nogc destructor TcpServer.~this | ||||
---|---|---|---|---|
| ||||
this is very hard to made a minimal example, and the projects only build with ldc. There is a struct TcpServer has no destructor, and all method is @nogc nothrow. but some how when I use it on function run @nogc nothrow, ldc report : @nogc function run cannot call non-@nogc destructor TcpServer.~this this problem only exists for this TcpServer struct, all other struct without ~this() is ok. And the code run fun before we add copyConstructor, but this one has no copyConstructor. |
July 17, 2019 Re: Error: @nogc function run cannot call non-@nogc destructor TcpServer.~this | ||||
---|---|---|---|---|
| ||||
Posted in reply to Newbie2019 | On Wednesday, 17 July 2019 at 10:51:53 UTC, Newbie2019 wrote:
> this is very hard to made a minimal example, and the projects only build with ldc.
>
> There is a struct TcpServer has no destructor, and all method is @nogc nothrow.
Then just add destructor with @nogc attribute.
|
July 17, 2019 Re: Error: @nogc function run cannot call non-@nogc destructor TcpServer.~this | ||||
---|---|---|---|---|
| ||||
Posted in reply to Newbie2019 | It is also possible a member of the struct has a destructor that is triggering it. |
July 17, 2019 Re: Error: @nogc function run cannot call non-@nogc destructor TcpServer.~this | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Wednesday, 17 July 2019 at 12:16:54 UTC, Adam D. Ruppe wrote:
> It is also possible a member of the struct has a destructor that is triggering it.
Thanks, I check all member and one of them is not @nogc nothrow. add @nogc nothrow to member fix it.
|
Copyright © 1999-2021 by the D Language Foundation