23 references to Version2
Microsoft.CodeAnalysis (2)
MemorySafetyRulesVersion.cs (1)
28return 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)
7681ReportUnsafeIfNotAllowed(node.OperatorToken.GetLocation(), diagnostics, MemorySafetyRulesVersion.Version2); 10300ReportUnsafeIfNotAllowed(node.ArgumentList.OpenBracketToken.GetLocation(), diagnostics, MemorySafetyRulesVersion.Version2);
Binder\Binder_Invocation.cs (1)
2630ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder: MemorySafetyRulesVersion.Version2);
Binder\Binder_Operators.cs (1)
4091ReportUnsafeIfNotAllowed(node.OperatorToken.GetLocation(), diagnostics, MemorySafetyRulesVersion.Version2);
Binder\Binder_Unsafe.cs (5)
115disallowedUnder: MemorySafetyRulesVersion.Version2, 133ReportUnsafeIfNotAllowed(arg, location, diagnostics, disallowedUnder: MemorySafetyRulesVersion.Version2, 190ReportUnsafeIfNotAllowed(node, diagnostics, disallowedUnder: MemorySafetyRulesVersion.Version2, customErrorCode: ErrorCode.ERR_UnsafeUninitializedStackAlloc); 315Debug.Assert(disallowedUnder is MemorySafetyRulesVersion.Version2); 344Debug.Assert(disallowedUnder is MemorySafetyRulesVersion.Version2);
CSharpCompilationOptions.cs (4)
507=> WithMemorySafetyRulesVersion(enabled ? MemorySafetyRulesVersion.Version2 : MemorySafetyRulesVersion.Version1); 509internal bool UseUpdatedMemorySafetyRules => MemorySafetyRulesVersion == MemorySafetyRulesVersion.Version2; 813if (MemorySafetyRulesVersion is not (MemorySafetyRulesVersion.Version1 or MemorySafetyRulesVersion.Version2)) 815builder.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)
968symbol.ContainingModule.MemorySafetyRulesVersion == MemorySafetyRulesVersion.Version2)
Symbols\Metadata\PE\PEUtilities.cs (1)
29((int)MemorySafetyRulesVersion.Version2).ToString(CultureInfo.InvariantCulture));
Symbols\ModuleSymbol.cs (1)
326internal 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)
33var checkForSafetyComment = compilation.SourceModule.MemorySafetyRulesVersion is MemorySafetyRulesVersion.Version2;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnneccessaryUnsafeModifier\CSharpRemoveUnnecessaryUnsafeModifierCodeFixProvider.cs (1)
43if (compilation.SourceModule.MemorySafetyRulesVersion is MemorySafetyRulesVersion.Version2)
Microsoft.CodeAnalysis.CSharp.Features (2)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryUnsafeModifier\CSharpRemoveUnnecessaryUnsafeModifierDiagnosticAnalyzer.cs (1)
33var checkForSafetyComment = compilation.SourceModule.MemorySafetyRulesVersion is MemorySafetyRulesVersion.Version2;
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnneccessaryUnsafeModifier\CSharpRemoveUnnecessaryUnsafeModifierCodeFixProvider.cs (1)
43if (compilation.SourceModule.MemorySafetyRulesVersion is MemorySafetyRulesVersion.Version2)