32 references to MemorySafetyRules
Microsoft.CodeAnalysis.CSharp (32)
Binder\Binder_Conversions.cs (3)
3026
ReportUnsafeIfNotAllowed(syntax.Location, diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy);
3036
ReportUnsafeIfNotAllowed(syntax, diagnostics, disallowedUnder:
MemorySafetyRules
.Updated, customErrorCode: ErrorCode.ERR_UnsafeUninitializedStackAlloc);
3668
&& ReportUnsafeIfNotAllowed(syntax, diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy))
Binder\Binder_Expressions.cs (7)
605
ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy);
1472
bool hasErrors = constantValue is null && ReportUnsafeIfNotAllowed(node, diagnostics, sizeOfTypeOpt: type, disallowedUnder:
MemorySafetyRules
.Legacy);
3728
ReportUnsafeIfNotAllowed(argument.Syntax, diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy);
5106
hasErrors = ReportUnsafeIfNotAllowed(errorLocation, diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy);
6980
hasError = ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy) || hasError;
7668
ReportUnsafeIfNotAllowed(node.OperatorToken.GetLocation(), diagnostics,
MemorySafetyRules
.Updated);
9619
ReportUnsafeIfNotAllowed(node.ArgumentList.OpenBracketToken.GetLocation(), diagnostics,
MemorySafetyRules
.Updated);
Binder\Binder_Invocation.cs (3)
1327
gotError = ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy) || gotError;
2585
bool hasErrors = ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy) ||
2586
ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder:
MemorySafetyRules
.Updated);
Binder\Binder_Operators.cs (1)
4066
ReportUnsafeIfNotAllowed(node.OperatorToken.GetLocation(), diagnostics,
MemorySafetyRules
.Updated);
Binder\Binder_Statements.cs (1)
191
fixedBinder.ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy);
Binder\Binder_Symbols.cs (3)
463
if (GetUnsafeDiagnosticInfo(disallowedUnder:
MemorySafetyRules
.Legacy, sizeOfTypeOpt: null) is CSDiagnosticInfo info)
606
ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy);
932
ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy);
Binder\Binder_Unsafe.cs (12)
109
ReportUnsafeIfNotAllowed(arg, location, diagnostics, disallowedUnder:
MemorySafetyRules
.Updated,
156
MemorySafetyRules
disallowedUnder,
168
MemorySafetyRules
disallowedUnder,
187
MemorySafetyRules
disallowedUnder,
198
MemorySafetyRules
disallowedUnder,
220
MemorySafetyRules
disallowedUnder,
236
MemorySafetyRules
disallowedUnder,
241
Debug.Assert(sizeOfTypeOpt is null || disallowedUnder is
MemorySafetyRules
.Legacy);
249
if (disallowedUnder is
MemorySafetyRules
.Legacy)
263
Debug.Assert(disallowedUnder is
MemorySafetyRules
.Updated);
278
if (disallowedUnder is
MemorySafetyRules
.Legacy)
286
Debug.Assert(disallowedUnder is
MemorySafetyRules
.Updated);
BoundTree\UnboundLambda.cs (1)
975
this.Binder.ReportUnsafeIfNotAllowed(this.ParameterLocation(i), diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy);
Symbols\Source\SourceMemberFieldSymbol.cs (1)
592
binder.ReportUnsafeIfNotAllowed(declarator.Location, diagnosticsForFirstDeclarator, disallowedUnder:
MemorySafetyRules
.Legacy);