Skip to content

Commit cc368ca

Browse files
ntrelWebFreak001
authored andcommitted
Use @trusted qualifier cast
Needed for dlang/dmd#16315.
1 parent 1ac9761 commit cc368ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/dparse/lexer.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,15 @@ mixin template TokenTriviaFields()
147147
import dparse.trivia : extractLeadingDdoc;
148148
if (memoizedLeadingComment !is null)
149149
return memoizedLeadingComment;
150-
return (cast()memoizedLeadingComment) = this.extractLeadingDdoc;
150+
return (ref () @trusted => cast() memoizedLeadingComment)() = this.extractLeadingDdoc;
151151
}
152152

153153
/// ditto
154154
string trailingComment() const pure nothrow @safe @property {
155155
import dparse.trivia : extractTrailingDdoc;
156156
if (memoizedTrailingComment !is null)
157157
return memoizedTrailingComment;
158-
return (cast()memoizedTrailingComment) = this.extractTrailingDdoc;
158+
return (ref () @trusted => cast() memoizedLeadingComment)() = this.extractTrailingDdoc;
159159
}
160160

161161
int opCmp(size_t i) const pure nothrow @safe @nogc {

0 commit comments

Comments
 (0)