Skip to content

Commit 569bc57

Browse files
authored
Mark unsafe union access @trusted (#8787)
1 parent 9a90edf commit 569bc57

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

std/regex/internal/ir.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ if (!hasElaborateDestructor!T)
10451045
return isBig ? big.ptr[0 .. length] : small[0 .. length];
10461046
}
10471047

1048-
this(this)
1048+
this(this) @trusted
10491049
{
10501050
if (isBig)
10511051
{

std/uni/package.d

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7697,6 +7697,15 @@ public:
76977697
static assert(false, "No operation "~op~" defined for Grapheme");
76987698
}
76997699

7700+
// This is not a good `opEquals`, but formerly the automatically generated
7701+
// opEquals was used, which was inferred `@safe` because of bugzilla 20655:
7702+
// https://issues.dlang.org/show_bug.cgi?id=20655
7703+
// This `@trusted opEquals` is only here to prevent breakage.
7704+
bool opEquals(R)(const auto ref R other) const @trusted
7705+
{
7706+
return this.tupleof == other.tupleof;
7707+
}
7708+
77007709
/++
77017710
True if this object contains valid extended grapheme cluster.
77027711
Decoding primitives of this module always return a valid `Grapheme`.

0 commit comments

Comments
 (0)