Skip to content

Commit

Permalink
Use @trusted qualifier cast
Browse files Browse the repository at this point in the history
Needed for dlang/dmd#16315.
  • Loading branch information
ntrel authored and WebFreak001 committed Mar 20, 2024
1 parent 1ac9761 commit cc368ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dparse/lexer.d
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,15 @@ mixin template TokenTriviaFields()
import dparse.trivia : extractLeadingDdoc;
if (memoizedLeadingComment !is null)
return memoizedLeadingComment;
return (cast()memoizedLeadingComment) = this.extractLeadingDdoc;
return (ref () @trusted => cast() memoizedLeadingComment)() = this.extractLeadingDdoc;
}

/// ditto
string trailingComment() const pure nothrow @safe @property {
import dparse.trivia : extractTrailingDdoc;
if (memoizedTrailingComment !is null)
return memoizedTrailingComment;
return (cast()memoizedTrailingComment) = this.extractTrailingDdoc;
return (ref () @trusted => cast() memoizedLeadingComment)() = this.extractTrailingDdoc;
}

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

0 comments on commit cc368ca

Please sign in to comment.