23 references to Version2
Microsoft.CodeAnalysis (2)
MemorySafetyRulesVersion.cs (1)
28
return version is MemorySafetyRulesVersion.Version1 or MemorySafetyRulesVersion.
Version2
;
Symbols\ISymbol.cs (1)
165
/// Under <see cref="MemorySafetyRulesVersion.
Version2
"/>, symbols marked <see langword="unsafe"/> are considered requires-unsafe.
Microsoft.CodeAnalysis.CSharp (17)
Binder\Binder_Expressions.cs (2)
7681
ReportUnsafeIfNotAllowed(node.OperatorToken.GetLocation(), diagnostics, MemorySafetyRulesVersion.
Version2
);
10300
ReportUnsafeIfNotAllowed(node.ArgumentList.OpenBracketToken.GetLocation(), diagnostics, MemorySafetyRulesVersion.
Version2
);
Binder\Binder_Invocation.cs (1)
2630
ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder: MemorySafetyRulesVersion.
Version2
);
Binder\Binder_Operators.cs (1)
4091
ReportUnsafeIfNotAllowed(node.OperatorToken.GetLocation(), diagnostics, MemorySafetyRulesVersion.
Version2
);
Binder\Binder_Unsafe.cs (5)
115
disallowedUnder: MemorySafetyRulesVersion.
Version2
,
133
ReportUnsafeIfNotAllowed(arg, location, diagnostics, disallowedUnder: MemorySafetyRulesVersion.
Version2
,
190
ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder: MemorySafetyRulesVersion.
Version2
, customErrorCode: ErrorCode.ERR_UnsafeUninitializedStackAlloc);
315
Debug.Assert(disallowedUnder is MemorySafetyRulesVersion.
Version2
);
344
Debug.Assert(disallowedUnder is MemorySafetyRulesVersion.
Version2
);
CSharpCompilationOptions.cs (4)
507
=> WithMemorySafetyRulesVersion(enabled ? MemorySafetyRulesVersion.
Version2
: MemorySafetyRulesVersion.Version1);
509
internal bool UseUpdatedMemorySafetyRules => MemorySafetyRulesVersion == MemorySafetyRulesVersion.
Version2
;
813
if (MemorySafetyRulesVersion is not (MemorySafetyRulesVersion.Version1 or MemorySafetyRulesVersion.
Version2
))
815
builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_BadCompilationOptionValueAccepted, nameof(MemorySafetyRulesVersion), MemorySafetyRulesVersion, string.Join(", ", [(int)MemorySafetyRulesVersion.Version1, (int)MemorySafetyRulesVersion.
Version2
])));
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
968
symbol.ContainingModule.MemorySafetyRulesVersion == MemorySafetyRulesVersion.
Version2
)
Symbols\Metadata\PE\PEUtilities.cs (1)
29
((int)MemorySafetyRulesVersion.
Version2
).ToString(CultureInfo.InvariantCulture));
Symbols\ModuleSymbol.cs (1)
326
internal bool UseUpdatedMemorySafetyRules => MemorySafetyRulesVersion == MemorySafetyRulesVersion.
Version2
;
Symbols\Source\SourceModuleSymbol.cs (1)
757
? MemorySafetyRulesVersion.
Version2
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryUnsafeModifier\CSharpRemoveUnnecessaryUnsafeModifierDiagnosticAnalyzer.cs (1)
33
var checkForSafetyComment = compilation.SourceModule.MemorySafetyRulesVersion is MemorySafetyRulesVersion.
Version2
;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnneccessaryUnsafeModifier\CSharpRemoveUnnecessaryUnsafeModifierCodeFixProvider.cs (1)
43
if (compilation.SourceModule.MemorySafetyRulesVersion is MemorySafetyRulesVersion.
Version2
)
Microsoft.CodeAnalysis.CSharp.Features (2)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryUnsafeModifier\CSharpRemoveUnnecessaryUnsafeModifierDiagnosticAnalyzer.cs (1)
33
var checkForSafetyComment = compilation.SourceModule.MemorySafetyRulesVersion is MemorySafetyRulesVersion.
Version2
;
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnneccessaryUnsafeModifier\CSharpRemoveUnnecessaryUnsafeModifierCodeFixProvider.cs (1)
43
if (compilation.SourceModule.MemorySafetyRulesVersion is MemorySafetyRulesVersion.
Version2
)