32 references to MemorySafetyRules
Microsoft.CodeAnalysis.CSharp (32)
Binder\Binder_Conversions.cs (3)
3037ReportUnsafeIfNotAllowed(syntax.Location, diagnostics, disallowedUnder: MemorySafetyRules.Legacy); 3047ReportUnsafeIfNotAllowed(syntax, diagnostics, disallowedUnder: MemorySafetyRules.Updated, customErrorCode: ErrorCode.ERR_UnsafeUninitializedStackAlloc); 3679&& ReportUnsafeIfNotAllowed(syntax, diagnostics, disallowedUnder: MemorySafetyRules.Legacy))
Binder\Binder_Expressions.cs (7)
605ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder: MemorySafetyRules.Legacy); 1472bool hasErrors = constantValue is null && ReportUnsafeIfNotAllowed(node, diagnostics, sizeOfTypeOpt: type, disallowedUnder: MemorySafetyRules.Legacy); 3728ReportUnsafeIfNotAllowed(argument.Syntax, diagnostics, disallowedUnder: MemorySafetyRules.Legacy); 5106hasErrors = ReportUnsafeIfNotAllowed(errorLocation, diagnostics, disallowedUnder: MemorySafetyRules.Legacy); 6956hasError = ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder: MemorySafetyRules.Legacy) || hasError; 7644ReportUnsafeIfNotAllowed(node.OperatorToken.GetLocation(), diagnostics, MemorySafetyRules.Updated); 9600ReportUnsafeIfNotAllowed(node.ArgumentList.OpenBracketToken.GetLocation(), diagnostics, MemorySafetyRules.Updated);
Binder\Binder_Invocation.cs (3)
1327gotError = ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder: MemorySafetyRules.Legacy) || gotError; 2585bool hasErrors = ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder: MemorySafetyRules.Legacy) || 2586ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder: MemorySafetyRules.Updated);
Binder\Binder_Operators.cs (1)
4066ReportUnsafeIfNotAllowed(node.OperatorToken.GetLocation(), diagnostics, MemorySafetyRules.Updated);
Binder\Binder_Statements.cs (1)
191fixedBinder.ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder: MemorySafetyRules.Legacy);
Binder\Binder_Symbols.cs (3)
463if (GetUnsafeDiagnosticInfo(disallowedUnder: MemorySafetyRules.Legacy, sizeOfTypeOpt: null) is CSDiagnosticInfo info) 606ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder: MemorySafetyRules.Legacy); 932ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder: MemorySafetyRules.Legacy);
Binder\Binder_Unsafe.cs (12)
111ReportUnsafeIfNotAllowed(arg, location, diagnostics, disallowedUnder: MemorySafetyRules.Updated, 158MemorySafetyRules disallowedUnder, 170MemorySafetyRules disallowedUnder, 189MemorySafetyRules disallowedUnder, 200MemorySafetyRules disallowedUnder, 222MemorySafetyRules disallowedUnder, 238MemorySafetyRules disallowedUnder, 243Debug.Assert(sizeOfTypeOpt is null || disallowedUnder is MemorySafetyRules.Legacy); 253if (disallowedUnder is MemorySafetyRules.Legacy) 275Debug.Assert(disallowedUnder is MemorySafetyRules.Updated); 296if (disallowedUnder is MemorySafetyRules.Legacy) 304Debug.Assert(disallowedUnder is MemorySafetyRules.Updated);
BoundTree\UnboundLambda.cs (1)
975this.Binder.ReportUnsafeIfNotAllowed(this.ParameterLocation(i), diagnostics, disallowedUnder: MemorySafetyRules.Legacy);
Symbols\Source\SourceMemberFieldSymbol.cs (1)
592binder.ReportUnsafeIfNotAllowed(declarator.Location, diagnosticsForFirstDeclarator, disallowedUnder: MemorySafetyRules.Legacy);