32 references to MemorySafetyRules
Microsoft.CodeAnalysis.CSharp (32)
Binder\Binder_Conversions.cs (2)
3103
ReportUnsafeIfNotAllowed(syntax.Location, diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy);
3738
&& ReportUnsafeIfNotAllowed(syntax, diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy))
Binder\Binder_Expressions.cs (7)
605
ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy);
1475
bool hasErrors = constantValue is null && ReportUnsafeIfNotAllowed(node, diagnostics, sizeOfTypeOpt: type, disallowedUnder:
MemorySafetyRules
.Legacy);
3731
ReportUnsafeIfNotAllowed(argument.Syntax, diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy);
5121
hasErrors = ReportUnsafeIfNotAllowed(errorLocation, diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy);
6979
hasError = ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy) || hasError;
7681
ReportUnsafeIfNotAllowed(node.OperatorToken.GetLocation(), diagnostics,
MemorySafetyRules
.Updated);
10300
ReportUnsafeIfNotAllowed(node.ArgumentList.OpenBracketToken.GetLocation(), diagnostics,
MemorySafetyRules
.Updated);
Binder\Binder_Invocation.cs (3)
1352
gotError = ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy) || gotError;
2617
bool hasErrors = ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy) ||
2618
ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder:
MemorySafetyRules
.Updated);
Binder\Binder_Operators.cs (1)
4091
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 (13)
118
ReportUnsafeIfNotAllowed(arg, location, diagnostics, disallowedUnder:
MemorySafetyRules
.Updated,
175
ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder:
MemorySafetyRules
.Updated, customErrorCode: ErrorCode.ERR_UnsafeUninitializedStackAlloc);
182
MemorySafetyRules
disallowedUnder,
194
MemorySafetyRules
disallowedUnder,
213
MemorySafetyRules
disallowedUnder,
224
MemorySafetyRules
disallowedUnder,
246
MemorySafetyRules
disallowedUnder,
262
MemorySafetyRules
disallowedUnder,
267
Debug.Assert(sizeOfTypeOpt is null || disallowedUnder is
MemorySafetyRules
.Legacy);
277
if (disallowedUnder is
MemorySafetyRules
.Legacy)
299
Debug.Assert(disallowedUnder is
MemorySafetyRules
.Updated);
320
if (disallowedUnder is
MemorySafetyRules
.Legacy)
328
Debug.Assert(disallowedUnder is
MemorySafetyRules
.Updated);
BoundTree\UnboundLambda.cs (1)
977
this.Binder.ReportUnsafeIfNotAllowed(this.ParameterLocation(i), diagnostics, disallowedUnder:
MemorySafetyRules
.Legacy);
Symbols\Source\SourceMemberFieldSymbol.cs (1)
625
binder.ReportUnsafeIfNotAllowed(declarator.Location, diagnosticsForFirstDeclarator, disallowedUnder:
MemorySafetyRules
.Legacy);