From 91953ec1c0f93759e4c8035a355e0c17281684b3 Mon Sep 17 00:00:00 2001 From: dotnet-maestro-bot Date: Fri, 26 Aug 2022 06:18:11 -0700 Subject: [PATCH] [automated] Merge branch 'release/7.0.1xx' => 'main' (#14394) * Update dependencies from https://github.com/dotnet/arcade build 20220812.2 (#14326) Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.CMake.Sdk From Version 6.0.0-beta.22411.3 -> To Version 6.0.0-beta.22412.2 Co-authored-by: dotnet-maestro[bot] * Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20220819.1 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 6.0.0-servicing.22413.1 -> To Version 6.0.0-servicing.22419.1 * Update dependencies from https://github.com/dotnet/arcade build 20220818.4 (#14354) [release/7.0.1xx] Update dependencies from dotnet/arcade - Coherency Updates: - Microsoft.SourceLink.GitHub: from 1.2.0-beta-22410-01 to 1.2.0-beta-22416-01 (parent: Microsoft.DotNet.Arcade.Sdk) - Microsoft.DotNet.XliffTasks: from 1.0.0-beta.22409.1 to 1.0.0-beta.22415.3 (parent: Microsoft.DotNet.Arcade.Sdk) * Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20220819.2 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 6.0.0-servicing.22419.1 -> To Version 6.0.0-servicing.22419.2 * Enable BlazorWasm source-build test (#14346) * Add llvm-project to source-build. (#14184) (#14314) * Add llvm-project to source-build. * Add repo references to llvm-project. * Add source-build metadata. * Upgrade CI to CentOS Stream 8. * Fix the image name in the right place. * Patch llvm to use an MS.Build.Traversal that we have. * Add backport PR to patch. * Revert "Upgrade CI to CentOS Stream 8." This reverts commit 6bc2754d5e3eecddc1788555c196f272567312bf. * Update to avoid new MSBuild warning that causes build failure. * We use code out of the LLVM directory. Copy the license file from there to the root to satisfy the license checker. * Add SourceBuild.props to llvm. * Update patches with backport PR pointers. * Update poison baseline. (#14345) * Update poison baseline. * Fix RIDs by replacing with placeholders. * Exclude a few more non-binary file types from poison checking. * Ignore empty files when checking for poison. * Update baseline with new exclusions. * Poison report can have both portable and non-portable RIDs in it, remove both. * Update dependencies from https://github.com/dotnet/sdk build 20220823.8 (#14371) Microsoft.DotNet.Common.ItemTemplates , Microsoft.DotNet.MSBuildSdkResolver , Microsoft.NET.Sdk , Microsoft.TemplateEngine.Cli From Version 7.0.100-rc.2.22416.39 -> To Version 7.0.100-rc.2.22423.8 Dependency coherency updates Microsoft.WindowsDesktop.App.Ref,VS.Redist.Common.WindowsDesktop.SharedFramework.x64.7.0,VS.Redist.Common.WindowsDesktop.TargetingPack.x64.7.0,Microsoft.NETCore.App.Runtime.win-x64,runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter,Microsoft.NETCore.App.Ref,VS.Redist.Common.NetCore.TargetingPack.x64.7.0,Microsoft.NETCore.App.Host.win-x64,Microsoft.NETCore.DotNetHostResolver,Microsoft.NETCore.Platforms,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.SharedFramework.x64.7.0,dotnet-dev-certs,dotnet-user-jwts,dotnet-user-secrets,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.SourceBuild.Intermediate.fsharp,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks,VS.Redist.Common.NetCore.SharedFramework.x64.7.0,Microsoft.NET.Workload.Emscripten.Manifest-7.0.100 From Version 7.0.0-rc.1.22379.3 -> To Version 7.0.0-rc.2.22422.9 (parent: Microsoft.NET.Sdk Co-authored-by: dotnet-maestro[bot] * Update dependencies from https://github.com/dotnet/sdk build 20220823.25 Microsoft.DotNet.Common.ItemTemplates , Microsoft.DotNet.MSBuildSdkResolver , Microsoft.NET.Sdk , Microsoft.TemplateEngine.Cli From Version 7.0.100-rc.2.22423.13 -> To Version 7.0.100-rc.2.22423.25 Dependency coherency updates Microsoft.WindowsDesktop.App.Ref,VS.Redist.Common.WindowsDesktop.SharedFramework.x64.7.0,VS.Redist.Common.WindowsDesktop.TargetingPack.x64.7.0,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates From Version 7.0.0-rc.2.22422.9 -> To Version 7.0.0-rc.2.22423.4 (parent: Microsoft.NET.Sdk * Dependency coherency updates (#14365) runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter From Version 1.0.0-alpha.1.22364.1 -> To Version 1.0.0-alpha.1.22364.1 (parent: Microsoft.NETCore.App.Runtime.win-x64 Co-authored-by: dotnet-maestro[bot] * Dependency coherency updates runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter From Version 1.0.0-alpha.1.22411.1 -> To Version 1.0.0-alpha.1.22411.1 (parent: Microsoft.NETCore.App.Runtime.win-x64 * Update source-build build images (#14321) * Fix aspnetcore offline build when nodejs is installed * Remove centos7 and 8, replace with stream 8 * Change Fedora 33 container to Fedora 36 * Revert "Change Fedora 33 container to Fedora 36" * Remove unused debian container definition * Add extra packages needed for bootstrapping arm64 * Use PackageDownloads for bootstrapping PSB artifacts and update prebuilts version Co-authored-by: Chris Rummel * Prevent System.Memory package downgrade in razor-compiler (#14384) (#14391) * Revert "Add razor-compiler patch to fix bootstrap build (#14379)" This reverts commit 1ebb3eb8b8b9364196f4db421ad27d30ff00d11d. * Add razor-compiler patch to prevent System.Memory downgrades * Add roslyn patch to lift System.Memory version * Use -svc pool provider in release branches * [release/7.0.1xx] Update dependencies from dotnet/sdk (#14381) * Update dependencies from https://github.com/dotnet/sdk build 20220823.30 Microsoft.DotNet.Common.ItemTemplates , Microsoft.DotNet.MSBuildSdkResolver , Microsoft.NET.Sdk , Microsoft.TemplateEngine.Cli From Version 7.0.100-rc.2.22423.25 -> To Version 7.0.100-rc.2.22423.30 Dependency coherency updates runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.SharedFramework.x64.7.0,dotnet-dev-certs,dotnet-user-jwts,dotnet-user-secrets,Microsoft.NET.ILLink.Tasks From Version 1.0.0-alpha.1.22411.1 -> To Version 1.0.0-alpha.1.22411.1 (parent: Microsoft.NETCore.App.Runtime.win-x64 * Update dependencies from https://github.com/dotnet/sdk build 20220823.32 Microsoft.DotNet.Common.ItemTemplates , Microsoft.DotNet.MSBuildSdkResolver , Microsoft.NET.Sdk , Microsoft.TemplateEngine.Cli From Version 7.0.100-rc.2.22423.25 -> To Version 7.0.100-rc.2.22423.32 Dependency coherency updates runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.SharedFramework.x64.7.0,dotnet-dev-certs,dotnet-user-jwts,dotnet-user-secrets,Microsoft.NET.ILLink.Tasks From Version 1.0.0-alpha.1.22411.1 -> To Version 1.0.0-alpha.1.22411.1 (parent: Microsoft.NETCore.App.Runtime.win-x64 * Update dependencies from https://github.com/dotnet/sdk build 20220824.4 Microsoft.DotNet.Common.ItemTemplates , Microsoft.DotNet.MSBuildSdkResolver , Microsoft.NET.Sdk , Microsoft.TemplateEngine.Cli From Version 7.0.100-rc.2.22423.25 -> To Version 7.0.100-rc.2.22424.4 Dependency coherency updates runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.SharedFramework.x64.7.0,dotnet-dev-certs,dotnet-user-jwts,dotnet-user-secrets,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset From Version 1.0.0-alpha.1.22411.1 -> To Version 1.0.0-alpha.1.22411.1 (parent: Microsoft.NETCore.App.Runtime.win-x64 * Update dependencies from https://github.com/dotnet/sdk build 20220824.9 Microsoft.DotNet.Common.ItemTemplates , Microsoft.DotNet.MSBuildSdkResolver , Microsoft.NET.Sdk , Microsoft.TemplateEngine.Cli From Version 7.0.100-rc.2.22423.25 -> To Version 7.0.100-rc.2.22424.9 Dependency coherency updates runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.SharedFramework.x64.7.0,dotnet-dev-certs,dotnet-user-jwts,dotnet-user-secrets,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset From Version 1.0.0-alpha.1.22411.1 -> To Version 1.0.0-alpha.1.22411.1 (parent: Microsoft.NETCore.App.Runtime.win-x64 * Update dependencies from https://github.com/dotnet/sdk build 20220824.14 Microsoft.DotNet.Common.ItemTemplates , Microsoft.DotNet.MSBuildSdkResolver , Microsoft.NET.Sdk , Microsoft.TemplateEngine.Cli From Version 7.0.100-rc.2.22423.25 -> To Version 7.0.100-rc.2.22424.14 Dependency coherency updates runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.SharedFramework.x64.7.0,dotnet-dev-certs,dotnet-user-jwts,dotnet-user-secrets,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset From Version 1.0.0-alpha.1.22411.1 -> To Version 1.0.0-alpha.1.22411.1 (parent: Microsoft.NETCore.App.Runtime.win-x64 * Resolve llvm source-build patch conflict Co-authored-by: dotnet-maestro[bot] Co-authored-by: MichaelSimons * Remove XDT dependency and patch (#14395) * [release/7.0.1xx] Update dependencies from dotnet/sdk (#14396) [release/7.0.1xx] Update dependencies from dotnet/sdk - Coherency Updates: - Microsoft.WindowsDesktop.App.Ref: from 7.0.0-rc.2.22423.4 to 7.0.0-rc.2.22424.8 (parent: Microsoft.NET.Sdk) - VS.Redist.Common.WindowsDesktop.SharedFramework.x64.7.0: from 7.0.0-rc.2.22423.4 to 7.0.0-rc.2.22424.8 (parent: Microsoft.NET.Sdk) - VS.Redist.Common.WindowsDesktop.TargetingPack.x64.7.0: from 7.0.0-rc.2.22423.4 to 7.0.0-rc.2.22424.8 (parent: Microsoft.NET.Sdk) - Microsoft.AspNetCore.App.Ref: from 7.0.0-rc.2.22423.16 to 7.0.0-rc.2.22424.4 (parent: Microsoft.NET.Sdk) - Microsoft.AspNetCore.App.Ref.Internal: from 7.0.0-rc.2.22423.16 to 7.0.0-rc.2.22424.4 (parent: Microsoft.NET.Sdk) - Microsoft.AspNetCore.App.Runtime.win-x64: from 7.0.0-rc.2.22423.16 to 7.0.0-rc.2.22424.4 (parent: Microsoft.NET.Sdk) - VS.Redist.Common.AspNetCore.SharedFramework.x64.7.0: from 7.0.0-rc.2.22423.16 to 7.0.0-rc.2.22424.4 (parent: Microsoft.NET.Sdk) - dotnet-dev-certs: from 7.0.0-rc.2.22423.16 to 7.0.0-rc.2.22424.4 (parent: Microsoft.NET.Sdk) - dotnet-user-jwts: from 7.0.0-rc.2.22423.16 to 7.0.0-rc.2.22424.4 (parent: Microsoft.NET.Sdk) - dotnet-user-secrets: from 7.0.0-rc.2.22423.16 to 7.0.0-rc.2.22424.4 (parent: Microsoft.NET.Sdk) - Microsoft.WindowsDesktop.App.Runtime.win-x64: from 7.0.0-rc.2.22423.4 to 7.0.0-rc.2.22424.8 (parent: Microsoft.NET.Sdk) - Microsoft.Dotnet.WinForms.ProjectTemplates: from 7.0.0-rc.2.22423.3 to 7.0.0-rc.2.22424.12 (parent: Microsoft.WindowsDesktop.App.Runtime.win-x64) - Microsoft.WindowsDesktop.App.Runtime.win-x64: from 7.0.0-rc.2.22423.4 to 7.0.0-rc.2.22424.8 (parent: Microsoft.NET.Sdk) - Microsoft.DotNet.Wpf.ProjectTemplates: from 7.0.0-rc.2.22423.2 to 7.0.0-rc.2.22424.8 (parent: Microsoft.WindowsDesktop.App.Runtime.win-x64) - Microsoft.Net.Compilers.Toolset: from 4.4.0-2.22423.18 to 4.4.0-2.22424.9 (parent: Microsoft.NET.Sdk) * Update dependencies from https://github.com/dotnet/source-build-externals build 20220824.1 (#14401) [release/7.0.1xx] Update dependencies from dotnet/source-build-externals * Update Versions.Details.xml source-build metadata (#14375) * Update dependencies from https://github.com/dotnet/test-templates build 20220825.1 (#14400) Microsoft.DotNet.Test.ProjectTemplates.5.0 , Microsoft.DotNet.Test.ProjectTemplates.6.0 , Microsoft.DotNet.Test.ProjectTemplates.7.0 From Version 1.0.2-beta4.22409.1 -> To Version 1.0.2-beta4.22425.1 Co-authored-by: dotnet-maestro[bot] * Update source-build-externals (#14405) Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: dotnet-maestro[bot] Co-authored-by: Marc Paine Co-authored-by: Michael Simons Co-authored-by: Chris Rummel Co-authored-by: v-wuzhai <46013274+v-wuzhai@users.noreply.github.com> Co-authored-by: Jason Zhai Co-authored-by: Logan Bussell Co-authored-by: Matt Galbraith Co-authored-by: Nikola Milosavljevic Co-authored-by: Matt Galbraith --- .vsts-ci.yml | 16 +- eng/Version.Details.xml | 148 +- eng/Versions.props | 50 +- .../job/source-build-create-tarball.yml | 4 +- .../job/source-build-run-tarball-build.yml | 32 +- .../buildBootstrapPreviouslySB.csproj | 47 +- .../PoisonTests.cs | 1 + .../assets/baselines/PoisonUsage.txt | 1281 +++++---- .../CheckForPoison.cs | 14 +- ...n-t-override-BuildNodeJS-in-build.sh.patch | 22 + ....Build.Traversal-version-we-have-a-r.patch | 4 +- .../0002-Lift-System.Memory-version.patch | 28 + .../0004-Update-Compiler-Changes.patch | 2504 ----------------- ...cent-compiler-changes-for-ref-fields.patch | 47 - ...-for-netstandard2.0-to-support-NuGet.patch | 26 - 15 files changed, 892 insertions(+), 3332 deletions(-) create mode 100644 src/SourceBuild/tarball/patches/aspnetcore/0004-Don-t-override-BuildNodeJS-in-build.sh.patch create mode 100644 src/SourceBuild/tarball/patches/roslyn/0002-Lift-System.Memory-version.patch delete mode 100644 src/SourceBuild/tarball/patches/runtime/0004-Update-Compiler-Changes.patch delete mode 100644 src/SourceBuild/tarball/patches/runtime/0005-More-update-for-recent-compiler-changes-for-ref-fields.patch delete mode 100644 src/SourceBuild/tarball/patches/xdt/0001-Also-build-for-netstandard2.0-to-support-NuGet.patch diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 3d544c01a..13514762b 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -47,10 +47,10 @@ stages: - job: Publish_Build_Configuration pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: NetCore1ESPool-Public + name: NetCore1ESPool-Svc-Public demands: ImageOverride -equals build.windows.10.amd64.vs2019.open ${{ if eq(variables['System.TeamProject'], 'internal') }}: - name: NetCore1ESPool-Internal + name: NetCore1ESPool-Svc-Internal demands: ImageOverride -equals build.windows.10.amd64.vs2019 steps: - publish: $(Build.SourcesDirectory)\eng\BuildConfiguration @@ -61,10 +61,10 @@ stages: agentOs: Windows_NT pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: NetCore1ESPool-Public + name: NetCore1ESPool-Svc-Public demands: ImageOverride -equals build.windows.10.amd64.vs2019.open ${{ if eq(variables['System.TeamProject'], 'internal') }}: - name: NetCore1ESPool-Internal + name: NetCore1ESPool-Svc-Internal demands: ImageOverride -equals build.windows.10.amd64.vs2019 timeoutInMinutes: 180 strategy: @@ -105,7 +105,7 @@ stages: agentOs: Windows_NT pool: ${{ if eq(variables['System.TeamProject'], 'internal') }}: - name: NetCore1ESPool-Internal + name: NetCore1ESPool-Svc-Internal demands: ImageOverride -equals build.windows.10.amd64.vs2019 timeoutInMinutes: 180 strategy: @@ -137,10 +137,10 @@ stages: agentOs: Linux pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: NetCore1ESPool-Public + name: NetCore1ESPool-Svc-Public demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open ${{ if eq(variables['System.TeamProject'], 'internal') }}: - name: NetCore1ESPool-Internal + name: NetCore1ESPool-Svc-Internal demands: ImageOverride -equals Build.Ubuntu.1804.Amd64 timeoutInMinutes: 180 strategy: @@ -281,7 +281,7 @@ stages: agentOs: Linux pool: ${{ if eq(variables['System.TeamProject'], 'internal') }}: - name: NetCore1ESPool-Internal + name: NetCore1ESPool-Svc-Internal demands: ImageOverride -equals Build.Ubuntu.1804.Amd64 timeoutInMinutes: 180 strategy: diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 3f7950f3a..dc18d432e 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,51 +1,51 @@ - + https://github.com/dotnet/windowsdesktop - d5046afdd2d0e6234ae3fc5bd4ae878594079cc7 + 6e1f6b8ee9f18133d5c8f543753b38a30384eebe - + https://github.com/dotnet/windowsdesktop - d5046afdd2d0e6234ae3fc5bd4ae878594079cc7 + 6e1f6b8ee9f18133d5c8f543753b38a30384eebe - + https://github.com/dotnet/windowsdesktop - d5046afdd2d0e6234ae3fc5bd4ae878594079cc7 + 6e1f6b8ee9f18133d5c8f543753b38a30384eebe - + https://github.com/dotnet/windowsdesktop - d5046afdd2d0e6234ae3fc5bd4ae878594079cc7 + 6e1f6b8ee9f18133d5c8f543753b38a30384eebe - + https://github.com/dotnet/llvm-project - 754d13817d834b716d339183e21aac7d2489c496 + e73d65f0f80655b463162bd41a8365377ba6565d - + https://github.com/dotnet/runtime - f52d8c59bb49360eb2cbeeb863c5856ebd62adda + ef077d0b58ffddcf54fa73bd85dace6b999b8992 - + https://github.com/dotnet/runtime - f52d8c59bb49360eb2cbeeb863c5856ebd62adda + ef077d0b58ffddcf54fa73bd85dace6b999b8992 - + https://github.com/dotnet/runtime - f52d8c59bb49360eb2cbeeb863c5856ebd62adda + ef077d0b58ffddcf54fa73bd85dace6b999b8992 - + https://github.com/dotnet/runtime - f52d8c59bb49360eb2cbeeb863c5856ebd62adda + ef077d0b58ffddcf54fa73bd85dace6b999b8992 - + https://github.com/dotnet/runtime - f52d8c59bb49360eb2cbeeb863c5856ebd62adda + ef077d0b58ffddcf54fa73bd85dace6b999b8992 - + https://github.com/dotnet/runtime - f52d8c59bb49360eb2cbeeb863c5856ebd62adda + ef077d0b58ffddcf54fa73bd85dace6b999b8992 @@ -53,38 +53,38 @@ https://github.com/dotnet/core-setup 7d57652f33493fa022125b7f63aad0d70c52d810 - + https://github.com/dotnet/runtime - f52d8c59bb49360eb2cbeeb863c5856ebd62adda + ef077d0b58ffddcf54fa73bd85dace6b999b8992 - + https://github.com/dotnet/aspnetcore - 0438e7ec04808230c67b00caa3d584bd2b991f57 + 0e0cb263176b2ff6f048aa48c7870986c37d894d - + https://github.com/dotnet/aspnetcore - 0438e7ec04808230c67b00caa3d584bd2b991f57 + 0e0cb263176b2ff6f048aa48c7870986c37d894d - + https://github.com/dotnet/aspnetcore - 0438e7ec04808230c67b00caa3d584bd2b991f57 - + 0e0cb263176b2ff6f048aa48c7870986c37d894d + - + https://github.com/dotnet/aspnetcore - 0438e7ec04808230c67b00caa3d584bd2b991f57 + 0e0cb263176b2ff6f048aa48c7870986c37d894d - + https://github.com/dotnet/aspnetcore - 0438e7ec04808230c67b00caa3d584bd2b991f57 + 0e0cb263176b2ff6f048aa48c7870986c37d894d - + https://github.com/dotnet/aspnetcore - 0438e7ec04808230c67b00caa3d584bd2b991f57 + 0e0cb263176b2ff6f048aa48c7870986c37d894d - + https://github.com/dotnet/aspnetcore - 0438e7ec04808230c67b00caa3d584bd2b991f57 + 0e0cb263176b2ff6f048aa48c7870986c37d894d https://github.com/dotnet/test-templates @@ -103,80 +103,74 @@ 8a75efaa853cd17f1336f5e99e626ab3e0fa68d1 - + https://github.com/dotnet/sdk - 80a77fd427d34e038ff2fa21f6c807695292cf7e + 361ca8ea760d7ed69da76f0b968f3b119d5bd222 - + https://github.com/dotnet/sdk - 80a77fd427d34e038ff2fa21f6c807695292cf7e + 361ca8ea760d7ed69da76f0b968f3b119d5bd222 - + https://github.com/dotnet/sdk - 80a77fd427d34e038ff2fa21f6c807695292cf7e + 361ca8ea760d7ed69da76f0b968f3b119d5bd222 - + https://github.com/dotnet/sdk - 80a77fd427d34e038ff2fa21f6c807695292cf7e + 361ca8ea760d7ed69da76f0b968f3b119d5bd222 - + https://github.com/dotnet/winforms - 55b296932065022705a6af218ab04a9d90049a28 + ce337305aafff2839761d8c006894f9ff470e54b - + https://github.com/dotnet/wpf - cd58f79f496337e608662e168c80ac8abd0d151b + 9aaba46c4c7a6d94a580d4bb1555a6d51fa97b02 - + https://github.com/dotnet/fsharp - ee745b0455fe651b6f5e5f9b85fc59a7b2574395 + 4e67cca0eff2507bcc1e5c63ea10834949b92a8a - + https://github.com/dotnet/fsharp - ee745b0455fe651b6f5e5f9b85fc59a7b2574395 + 4e67cca0eff2507bcc1e5c63ea10834949b92a8a https://github.com/microsoft/vstest ef0aa102e9c7d5cf55af06c2747d11e07d12b69a - + - + https://github.com/dotnet/linker - 6252a2194dd32911db2c0669fc818555687d5570 + 313671b195b1b36d56a8888a9a0e12edaac52c57 linker - + https://github.com/dotnet/roslyn - 65dc2845b5287ac972f7299616c13d3270720e44 + dc87952b28a159487ddab48586511b480a5c3488 - + https://github.com/dotnet/msbuild - 50f6081beda4c565252ff51be4ab1fe27005372b - + 5d102ae37163fc1f22610bb433c3ab9a2fff91f0 + - + https://github.com/nuget/nuget.client - 26a0cf27a2d4dcf52d19238606c269d6fed9ff66 + 745617ea6fc239737c80abb424e13faca4249bf1 https://github.com/Microsoft/ApplicationInsights-dotnet 53b80940842204f78708a538628288ff5d741a1d - - - https://github.com/dotnet/xdt - 698fdad58fa64a55f16cd9562c90224cc498ed02 - - - + https://github.com/dotnet/emsdk - 7b2cd1ee7169143248a7da9fd749caf22affa624 + 216093204c415b6e37dfadfcbcf183881b443636 https://github.com/dotnet/deployment-tools @@ -186,17 +180,17 @@ https://github.com/dotnet/diagnostics ab3eb7a525e31dc6fb4d9cc0b7154fa2be58dac1 - + - + https://github.com/dotnet/source-build-externals - 5d2a2f63bb10119240df8082dfc7646589dc1efb + 98d428bee8b5b034d6956bf3d199619cb07e00cf https://github.com/dotnet/symreader 7b9791daa3a3477eb22ec805946c9fff8b42d8ca - + diff --git a/eng/Versions.props b/eng/Versions.props index 695a0f692..62ffa5bab 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -34,11 +34,11 @@ - 7.0.0-rc.1.22377.2 + 7.0.0-rc.2.22424.12 - 7.0.0-rc.1.22379.2 + 7.0.0-rc.2.22424.8 @@ -53,46 +53,46 @@ - 7.0.0-rc.1.22415.4 - 7.0.0-rc.1.22415.4 - 7.0.0-rc.1.22415.4 - 7.0.0-rc.1.22415.4 - 7.0.0-rc.1.22415.4 - 7.0.0-rc.1.22415.4 - 7.0.0-rc.1.22415.4 + 7.0.0-rc.2.22424.4 + 7.0.0-rc.2.22424.4 + 7.0.0-rc.2.22424.4 + 7.0.0-rc.2.22424.4 + 7.0.0-rc.2.22424.4 + 7.0.0-rc.2.22424.4 + 7.0.0-rc.2.22424.4 0.2.0 - 7.0.100-rc.1.22416.35 - 7.0.100-rc.1.22416.35 - 7.0.100-rc.1.22416.35 + 7.0.100-rc.2.22425.6 + 7.0.100-rc.2.22425.6 + 7.0.100-rc.2.22425.6 $(MicrosoftNETSdkPackageVersion) $(MicrosoftNETSdkPackageVersion) $(MicrosoftNETSdkPackageVersion) - 7.0.0-rc.1.22411.12 + 7.0.0-rc.1.22422.12 - 7.0.0-rc.1.22411.12 - 7.0.0-rc.1.22411.12 - 7.0.0-rc.1.22411.12 - 7.0.0-rc.1.22411.12 - 7.0.0-rc.1.22411.12 - 7.0.0-rc.1.22411.12 + 7.0.0-rc.1.22422.12 + 7.0.0-rc.1.22422.12 + 7.0.0-rc.1.22422.12 + 7.0.0-rc.1.22422.12 + 7.0.0-rc.1.22422.12 + 7.0.0-rc.1.22422.12 2.1.0 - 7.0.0-rc.1.22379.3 - 7.0.0-rc.1.22379.3 - 7.0.0-rc.1.22379.3 - 7.0.0-rc.1.22379.3 + 7.0.0-rc.2.22424.8 + 7.0.0-rc.2.22424.8 + 7.0.0-rc.2.22424.8 + 7.0.0-rc.2.22424.8 @@ -198,7 +198,7 @@ necessary, and this property is removed from the file. --> 0.1.0-7.0.100-bootstrap.11 - 0.1.0-7.0.100-5 + 0.1.0-7.0.100-8 @@ -209,7 +209,7 @@ 12.3.303 15.4.303 $(MicrosoftNETCoreAppRefPackageVersion) - 7.0.0-rc.1.22368.1 + 7.0.0-rc.1.22411.1 $(MicrosoftNETWorkloadEmscriptenManifest70100Version) diff --git a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-create-tarball.yml b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-create-tarball.yml index a2d550fce..8e55a40b5 100644 --- a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-create-tarball.yml +++ b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-create-tarball.yml @@ -6,10 +6,10 @@ jobs: displayName: Source-Build Create Tarball pool: ${{ if eq(variables['System.TeamProject'], 'public') }}: - name: NetCore1ESPool-Public + name: NetCore1ESPool-Svc-Public demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open ${{ if eq(variables['System.TeamProject'], 'internal') }}: - name: NetCore1ESPool-Internal + name: NetCore1ESPool-Svc-Internal demands: ImageOverride -equals Build.Ubuntu.1804.Amd64 variables: - name: _BuildConfig diff --git a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml index 32d8df03b..ee58d6abb 100644 --- a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml +++ b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml @@ -13,12 +13,10 @@ parameters: # The following parameters aren't expected to be passed in rather they are used for encapsulation # ----------------------------------------------------------------------------------------------- centOSStream8Container: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8-20220809204800-17a4aab - centOS8Container: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-8-source-build-20211118190102-9355e7b centOSStream9Container: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9-20220107135047-4cd394c - debian9Container: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-stretch-20211001171226-047508b - debian9Arm64Container: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-9-arm64v8-20220405201138-a251961 - fedora33Container: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-33-20210222183538-031e7d2 - ubuntu1804Container: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-20210924170306-047508b + debian11Arm64Container: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-11-arm64v8-20220812185233-b286fae + fedora36Container: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-36-20220818134137-a09384f + ubuntu2004Container: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-20220813234344-4c008dd poolInternalAmd64: name: NetCore1ESPool-Svc-Internal demands: ImageOverride -equals Build.Ubuntu.1804.Amd64 @@ -51,27 +49,21 @@ jobs: _EnablePoison: false _ExcludeOmniSharpTests: true _RunOnline: false - CentOS8-Offline: - _BootstrapPrep: false - _Container: ${{ parameters.centOS8Container }} - _EnablePoison: false - _ExcludeOmniSharpTests: false - _RunOnline: false CentOSStream9-Offline: _BootstrapPrep: false _Container: ${{ parameters.centOSStream9Container }} _EnablePoison: false _ExcludeOmniSharpTests: false _RunOnline: false - Fedora33-Offline: + Fedora36-Offline: _BootstrapPrep: false - _Container: ${{ parameters.fedora33Container }} + _Container: ${{ parameters.fedora36Container }} _EnablePoison: true _ExcludeOmniSharpTests: false _RunOnline: false - Ubuntu1804-Offline: + Ubuntu2004-Offline: _BootstrapPrep: false - _Container: ${{ parameters.ubuntu1804Container }} + _Container: ${{ parameters.ubuntu2004Container }} _EnablePoison: false _ExcludeOmniSharpTests: false _RunOnline: false @@ -93,9 +85,9 @@ jobs: installerBuildResourceId: ${{ parameters.installerBuildResourceId }} matrix: ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: - Debian9-Offline: + Debian11-Offline: _BootstrapPrep: true - _Container: ${{ parameters.debian9Arm64Container }} + _Container: ${{ parameters.debian11Arm64Container }} _EnablePoison: false _ExcludeOmniSharpTests: false _RunOnline: false @@ -113,9 +105,9 @@ jobs: excludeSdkContentTests: true installerBuildResourceId: ${{ parameters.installerBuildResourceId }} matrix: - Fedora33-Offline: - _PreviousSourceBuildArtifact: Build_Tarball_x64 Fedora33-Offline_Artifacts - _Container: ${{ parameters.fedora33Container }} + Fedora36-Offline: + _PreviousSourceBuildArtifact: Build_Tarball_x64 Fedora36-Offline_Artifacts + _Container: ${{ parameters.fedora36Container }} _EnablePoison: false _ExcludeOmniSharpTests: false _RunOnline: false diff --git a/src/SourceBuild/tarball/content/eng/bootstrap/buildBootstrapPreviouslySB.csproj b/src/SourceBuild/tarball/content/eng/bootstrap/buildBootstrapPreviouslySB.csproj index 9d74856ca..9a00e2a48 100644 --- a/src/SourceBuild/tarball/content/eng/bootstrap/buildBootstrapPreviouslySB.csproj +++ b/src/SourceBuild/tarball/content/eng/bootstrap/buildBootstrapPreviouslySB.csproj @@ -12,27 +12,36 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -61,7 +70,7 @@ + Properties="SourcePath=$(RestorePackagesPath);DestinationPath=$(UnpackedTarPath);PackageName=%(PackageDownload.Identity);PackageVersion=%(PackageDownload.Version)" /> diff --git a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/PoisonTests.cs b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/PoisonTests.cs index 11ea0667f..f600d558d 100644 --- a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/PoisonTests.cs +++ b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/PoisonTests.cs @@ -24,6 +24,7 @@ namespace Microsoft.DotNet.SourceBuild.SmokeTests string currentPoisonReport = File.ReadAllText(Config.PoisonReportPath); currentPoisonReport = RemoveHashes(currentPoisonReport); currentPoisonReport = BaselineHelper.RemoveRids(currentPoisonReport); + currentPoisonReport = BaselineHelper.RemoveRids(currentPoisonReport, true); currentPoisonReport = BaselineHelper.RemoveVersions(currentPoisonReport); BaselineHelper.CompareContents("PoisonUsage.txt", currentPoisonReport, OutputHelper, Config.WarnOnPoisonDiffs); diff --git a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/assets/baselines/PoisonUsage.txt b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/assets/baselines/PoisonUsage.txt index 25f79024b..fcac02fbd 100644 --- a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/assets/baselines/PoisonUsage.txt +++ b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/assets/baselines/PoisonUsage.txt @@ -1,77 +1,218 @@ - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + AssemblyAttribute @@ -80,70 +221,130 @@ AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - + + AssemblyAttribute + + AssemblyAttribute AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + AssemblyAttribute AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + AssemblyAttribute @@ -152,28 +353,16 @@ AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - - + AssemblyAttribute @@ -182,142 +371,115 @@ AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + + AssemblyAttribute + + AssemblyAttribute @@ -326,202 +488,94 @@ AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - + AssemblyAttribute @@ -530,226 +584,154 @@ AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - + AssemblyAttribute @@ -758,190 +740,91 @@ AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - - AssemblyAttribute - - + AssemblyAttribute @@ -950,34 +833,64 @@ AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - + AssemblyAttribute - + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + AssemblyAttribute @@ -986,100 +899,67 @@ AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - - + AssemblyAttribute @@ -1088,52 +968,55 @@ AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + AssemblyAttribute @@ -1142,52 +1025,55 @@ AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + AssemblyAttribute @@ -1196,88 +1082,76 @@ AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - - AssemblyAttribute - - - AssemblyAttribute - AssemblyAttribute AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + AssemblyAttribute @@ -1286,43 +1160,250 @@ AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + AssemblyAttribute - + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + + AssemblyAttribute + + AssemblyAttribute diff --git a/src/SourceBuild/tarball/content/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.LeakDetection/CheckForPoison.cs b/src/SourceBuild/tarball/content/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.LeakDetection/CheckForPoison.cs index d3c683c56..b8d3ffe24 100644 --- a/src/SourceBuild/tarball/content/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.LeakDetection/CheckForPoison.cs +++ b/src/SourceBuild/tarball/content/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.LeakDetection/CheckForPoison.cs @@ -79,7 +79,6 @@ namespace Microsoft.DotNet.SourceBuild.Tasks.LeakDetection "_._", "-.-", ".bowerrc", - ".editorconfig", ".gitignore", ".gitkeep", ".rels", @@ -97,9 +96,11 @@ namespace Microsoft.DotNet.SourceBuild.Tasks.LeakDetection ".csproj", ".css", ".db", + ".editorconfig", ".eot", ".fs", ".fsproj", + ".h", ".html", ".ico", ".js", @@ -107,18 +108,26 @@ namespace Microsoft.DotNet.SourceBuild.Tasks.LeakDetection ".map", ".md", ".nuspec", + ".otf", ".png", ".props", + ".proto", + ".proj", ".psmdcp", + ".pubxml", + ".razor", ".rtf", ".scss", + ".sln", ".svg", ".targets", + ".transform", ".ts", ".ttf", ".txt", ".vb", ".vbproj", + ".win32manifest", ".woff", ".woff2", ".xaml", @@ -209,7 +218,8 @@ namespace Microsoft.DotNet.SourceBuild.Tasks.LeakDetection // skip some common files that get copied verbatim from nupkgs - LICENSE, _._, etc as well as // file types that we never care about - text files, .gitconfig, etc. if (FileNamesToSkip.Any(f => Path.GetFileName(fileToCheck).ToLowerInvariant() == f.ToLowerInvariant()) || - FileExtensionsToSkip.Any(e => Path.GetExtension(fileToCheck).ToLowerInvariant() == e.ToLowerInvariant())) + FileExtensionsToSkip.Any(e => Path.GetExtension(fileToCheck).ToLowerInvariant() == e.ToLowerInvariant()) || + (new FileInfo(fileToCheck).Length == 0)) { return null; } diff --git a/src/SourceBuild/tarball/patches/aspnetcore/0004-Don-t-override-BuildNodeJS-in-build.sh.patch b/src/SourceBuild/tarball/patches/aspnetcore/0004-Don-t-override-BuildNodeJS-in-build.sh.patch new file mode 100644 index 000000000..e006dc156 --- /dev/null +++ b/src/SourceBuild/tarball/patches/aspnetcore/0004-Don-t-override-BuildNodeJS-in-build.sh.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Logan Bussell +Date: Mon, 15 Aug 2022 16:21:57 -0700 +Subject: [PATCH] Don't override BuildNodeJS in build.sh + +Backport: https://github.com/dotnet/aspnetcore/issues/43310 +--- + eng/build.sh | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/eng/build.sh b/eng/build.sh +index a6b6ba99be..0e4daad48c 100755 +--- a/eng/build.sh ++++ b/eng/build.sh +@@ -271,7 +271,6 @@ fi + # Only set these MSBuild properties if they were explicitly set by build parameters. + [ ! -z "$build_java" ] && msbuild_args[${#msbuild_args[*]}]="-p:BuildJava=$build_java" + [ ! -z "$build_native" ] && msbuild_args[${#msbuild_args[*]}]="-p:BuildNative=$build_native" +-[ ! -z "$build_nodejs" ] && msbuild_args[${#msbuild_args[*]}]="-p:BuildNodeJS=$build_nodejs" + [ ! -z "$build_managed" ] && msbuild_args[${#msbuild_args[*]}]="-p:BuildManaged=$build_managed" + [ ! -z "$build_installers" ] && msbuild_args[${#msbuild_args[*]}]="-p:BuildInstallers=$build_installers" + diff --git a/src/SourceBuild/tarball/patches/llvm-project/0001-Upgrade-to-an-MS.Build.Traversal-version-we-have-a-r.patch b/src/SourceBuild/tarball/patches/llvm-project/0001-Upgrade-to-an-MS.Build.Traversal-version-we-have-a-r.patch index 098694eff..335153660 100644 --- a/src/SourceBuild/tarball/patches/llvm-project/0001-Upgrade-to-an-MS.Build.Traversal-version-we-have-a-r.patch +++ b/src/SourceBuild/tarball/patches/llvm-project/0001-Upgrade-to-an-MS.Build.Traversal-version-we-have-a-r.patch @@ -16,8 +16,8 @@ index df77e9a199d6..19b99be1f71b 100644 +++ b/global.json @@ -5,6 +5,6 @@ "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22358.3", - "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22358.3", + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22405.6", + "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22405.6", - "Microsoft.Build.Traversal": "2.0.2" + "Microsoft.Build.Traversal": "2.0.34" } diff --git a/src/SourceBuild/tarball/patches/roslyn/0002-Lift-System.Memory-version.patch b/src/SourceBuild/tarball/patches/roslyn/0002-Lift-System.Memory-version.patch new file mode 100644 index 000000000..fe1fcb174 --- /dev/null +++ b/src/SourceBuild/tarball/patches/roslyn/0002-Lift-System.Memory-version.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MichaelSimons +Date: Wed, 24 Aug 2022 12:21:13 +0000 +Subject: [PATCH] Lift System.Memory version + +System.Memory version needs to align with the runtime since System.Collections.Immutable is lifted in order to prevent the following situation: +error NU1605: Detected package downgrade: System.Memory from 4.5.5 to 4.5.4. Reference the package directly from the project to select a different version. [/repos/tarball-rc1/src/razor-compiler/artifacts/source-build/self/src/razor-compiler.sln] +error NU1605: Microsoft.CodeAnalysis.Razor -> Microsoft.CodeAnalysis.CSharp 4.4.0 -> Microsoft.CodeAnalysis.Common 4.4.0 -> System.Collections.Immutable 7.0.0-rc.1.22422.23 -> System.Memory (>= 4.5.5) [/repos/tarball-rc1/src/razor-compiler/artifacts/source-build/self/src/razor-compiler.sln] +error NU1605: Microsoft.CodeAnalysis.Razor -> Microsoft.CodeAnalysis.CSharp 4.4.0 -> Microsoft.CodeAnalysis.Common 4.4.0 -> System.Memory (>= 4.5.4) [/repos/tarball-rc1/src/razor-compiler/artifacts/source-build/self/src/razor-compiler.sln] + +Requires https://github.com/dotnet/source-build/issues/2482 in order to eliminate this patch +--- + eng/Versions.props | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/eng/Versions.props b/eng/Versions.props +index 627f9c46824..711593e2a1e 100644 +--- a/eng/Versions.props ++++ b/eng/Versions.props +@@ -214,7 +214,7 @@ + 5.0.0 + 6.0.1 + 5.0.0-preview.8.20407.11 +- 4.5.4 ++ 4.5.5 + 6.0.0 + 6.0.0 + 6.0.1 diff --git a/src/SourceBuild/tarball/patches/runtime/0004-Update-Compiler-Changes.patch b/src/SourceBuild/tarball/patches/runtime/0004-Update-Compiler-Changes.patch deleted file mode 100644 index 93daf765c..000000000 --- a/src/SourceBuild/tarball/patches/runtime/0004-Update-Compiler-Changes.patch +++ /dev/null @@ -1,2504 +0,0 @@ -From 41c373f179df5697aafe5d0b0ca16dae28f0cdf1 Mon Sep 17 00:00:00 2001 -From: Charles Stoner <10732005+cston@users.noreply.github.com> -Date: Fri, 5 Aug 2022 07:08:31 -0700 -Subject: Update for recent compiler changes for ref fields - -Backport: https://github.com/dotnet/runtime/pull/73466 - ---- - .../Globalization/FormatProvider.Number.cs | 20 ++-- - .../System/Net/Sockets/SocketPal.Windows.cs | 2 +- - .../src/System/Globalization/DateTimeParse.cs | 106 +++++++++--------- - .../src/System/Number.Formatting.cs | 2 +- - .../src/System/Number.Parsing.cs | 2 +- - .../System/Reflection/AssemblyNameParser.cs | 2 +- - .../Reader/Utf8JsonReader.MultiSegment.cs | 20 ++-- - .../System/Text/Json/Reader/Utf8JsonReader.cs | 14 +-- - .../Converters/CastingConverter.cs | 2 +- - .../Converters/Collection/ArrayConverter.cs | 4 +- - .../Collection/ConcurrentQueueOfTConverter.cs | 2 +- - .../Collection/ConcurrentStackOfTConverter.cs | 2 +- - .../DictionaryOfTKeyTValueConverter.cs | 2 +- - .../IAsyncEnumerableOfTConverter.cs | 6 +- - .../Collection/ICollectionOfTConverter.cs | 4 +- - .../Collection/IDictionaryConverter.cs | 4 +- - .../IDictionaryOfTKeyTValueConverter.cs | 4 +- - .../Collection/IEnumerableConverter.cs | 4 +- - .../Collection/IEnumerableOfTConverter.cs | 4 +- - .../Converters/Collection/IListConverter.cs | 4 +- - .../Collection/IListOfTConverter.cs | 4 +- - ...ReadOnlyDictionaryOfTKeyTValueConverter.cs | 4 +- - .../Converters/Collection/ISetOfTConverter.cs | 4 +- - ...mmutableDictionaryOfTKeyTValueConverter.cs | 4 +- - .../ImmutableEnumerableOfTConverter.cs | 4 +- - .../Collection/JsonCollectionConverter.cs | 6 +- - .../Collection/JsonDictionaryConverter.cs | 8 +- - .../Converters/Collection/ListOfTConverter.cs | 4 +- - .../Collection/QueueOfTConverter.cs | 4 +- - .../Collection/StackOfTConverter.cs | 4 +- - .../Collection/StackOrQueueConverter.cs | 4 +- - .../Converters/FSharp/FSharpListConverter.cs | 4 +- - .../Converters/FSharp/FSharpMapConverter.cs | 4 +- - .../FSharp/FSharpOptionConverter.cs | 2 +- - .../Converters/FSharp/FSharpSetConverter.cs | 4 +- - .../FSharp/FSharpValueOptionConverter.cs | 2 +- - .../JsonMetadataServicesConverter.cs | 2 +- - .../Converters/Node/JsonObjectConverter.cs | 2 +- - .../Converters/Object/ObjectConverter.cs | 2 +- - .../Object/ObjectDefaultConverter.cs | 6 +- - ...ParameterizedConstructorConverter.Large.cs | 4 +- - ...ParameterizedConstructorConverter.Small.cs | 6 +- - ...ctWithParameterizedConstructorConverter.cs | 18 +-- - .../Converters/Value/NullableConverter.cs | 2 +- - .../Serialization/JsonConverter.ReadAhead.cs | 4 +- - .../Text/Json/Serialization/JsonConverter.cs | 8 +- - .../Serialization/JsonConverterFactory.cs | 6 +- - .../JsonConverterOfT.ReadCore.cs | 4 +- - .../Json/Serialization/JsonConverterOfT.cs | 8 +- - .../JsonSerializer.Read.HandleMetadata.cs | 10 +- - .../JsonSerializer.Read.HandlePropertyName.cs | 4 +- - .../JsonSerializer.Read.Helpers.cs | 2 +- - .../Metadata/JsonPropertyInfo.cs | 8 +- - .../Metadata/JsonPropertyInfoOfT.cs | 4 +- - .../Text/Json/ThrowHelper.Serialization.cs | 30 ++--- - 55 files changed, 203 insertions(+), 203 deletions(-) - -diff --git a/src/libraries/Common/src/System/Globalization/FormatProvider.Number.cs b/src/libraries/Common/src/System/Globalization/FormatProvider.Number.cs -index 8636878c89502..3e12859eba454 100644 ---- a/src/libraries/Common/src/System/Globalization/FormatProvider.Number.cs -+++ b/src/libraries/Common/src/System/Globalization/FormatProvider.Number.cs -@@ -356,7 +356,7 @@ private static unsafe bool AllowHyphenDuringParsing(NumberFormatInfo info) - return ret; - } - -- private static unsafe bool ParseNumber(ref char* str, char* strEnd, NumberStyles options, ref NumberBuffer number, StringBuilder? sb, NumberFormatInfo numfmt, bool parseDecimal) -+ private static unsafe bool ParseNumber(ref char* str, char* strEnd, NumberStyles options, scoped ref NumberBuffer number, StringBuilder? sb, NumberFormatInfo numfmt, bool parseDecimal) - { - Debug.Assert(str != null); - Debug.Assert(strEnd != null); -@@ -589,7 +589,7 @@ private static unsafe bool ParseNumber(ref char* str, char* strEnd, NumberStyles - // For compatibility, we need to allow trailing zeros at the end of a number string - s.Slice(index).IndexOfAnyExcept('\0') < 0; - -- internal static unsafe bool TryStringToNumber(ReadOnlySpan str, NumberStyles options, ref NumberBuffer number, StringBuilder sb, NumberFormatInfo numfmt, bool parseDecimal) -+ internal static unsafe bool TryStringToNumber(ReadOnlySpan str, NumberStyles options, scoped ref NumberBuffer number, StringBuilder sb, NumberFormatInfo numfmt, bool parseDecimal) - { - Debug.Assert(numfmt != null); - -@@ -732,7 +732,7 @@ internal static char ParseFormatSpecifier(ReadOnlySpan format, out int dig - '\0'; - } - -- internal static unsafe void NumberToString(ref ValueStringBuilder sb, ref NumberBuffer number, char format, int nMaxDigits, NumberFormatInfo info, bool isDecimal) -+ internal static unsafe void NumberToString(ref ValueStringBuilder sb, scoped ref NumberBuffer number, char format, int nMaxDigits, NumberFormatInfo info, bool isDecimal) - { - int nMinDigits = -1; - -@@ -892,7 +892,7 @@ internal static unsafe void NumberToString(ref ValueStringBuilder sb, ref Number - } - } - -- private static void FormatCurrency(ref ValueStringBuilder sb, ref NumberBuffer number, int nMinDigits, int nMaxDigits, NumberFormatInfo info) -+ private static void FormatCurrency(ref ValueStringBuilder sb, scoped ref NumberBuffer number, int nMinDigits, int nMaxDigits, NumberFormatInfo info) - { - string fmt = number.sign ? - s_negCurrencyFormats[info.CurrencyNegativePattern] : -@@ -918,7 +918,7 @@ private static void FormatCurrency(ref ValueStringBuilder sb, ref NumberBuffer n - } - } - -- private static unsafe void FormatFixed(ref ValueStringBuilder sb, ref NumberBuffer number, int nMinDigits, int nMaxDigits, NumberFormatInfo info, int[]? groupDigits, string sDecimal, string? sGroup) -+ private static unsafe void FormatFixed(ref ValueStringBuilder sb, scoped ref NumberBuffer number, int nMinDigits, int nMaxDigits, NumberFormatInfo info, int[]? groupDigits, string sDecimal, string? sGroup) - { - Debug.Assert(sGroup != null || groupDigits == null); - -@@ -1039,7 +1039,7 @@ private static unsafe void FormatFixed(ref ValueStringBuilder sb, ref NumberBuff - } - } - -- private static void FormatNumber(ref ValueStringBuilder sb, ref NumberBuffer number, int nMinDigits, int nMaxDigits, NumberFormatInfo info) -+ private static void FormatNumber(ref ValueStringBuilder sb, scoped ref NumberBuffer number, int nMinDigits, int nMaxDigits, NumberFormatInfo info) - { - string fmt = number.sign ? - s_negNumberFormats[info.NumberNegativePattern] : -@@ -1062,7 +1062,7 @@ private static void FormatNumber(ref ValueStringBuilder sb, ref NumberBuffer num - } - } - -- private static unsafe void FormatScientific(ref ValueStringBuilder sb, ref NumberBuffer number, int nMinDigits, int nMaxDigits, NumberFormatInfo info, char expChar) -+ private static unsafe void FormatScientific(ref ValueStringBuilder sb, scoped ref NumberBuffer number, int nMinDigits, int nMaxDigits, NumberFormatInfo info, char expChar) - { - char* dig = number.digits; - -@@ -1109,7 +1109,7 @@ private static unsafe void FormatExponent(ref ValueStringBuilder sb, NumberForma - } - } - -- private static unsafe void FormatGeneral(ref ValueStringBuilder sb, ref NumberBuffer number, int nMinDigits, int nMaxDigits, NumberFormatInfo info, char expChar, bool bSuppressScientific) -+ private static unsafe void FormatGeneral(ref ValueStringBuilder sb, scoped ref NumberBuffer number, int nMinDigits, int nMaxDigits, NumberFormatInfo info, char expChar, bool bSuppressScientific) - { - int digPos = number.scale; - bool scientific = false; -@@ -1160,7 +1160,7 @@ private static unsafe void FormatGeneral(ref ValueStringBuilder sb, ref NumberBu - } - } - -- private static void FormatPercent(ref ValueStringBuilder sb, ref NumberBuffer number, int nMinDigits, int nMaxDigits, NumberFormatInfo info) -+ private static void FormatPercent(ref ValueStringBuilder sb, scoped ref NumberBuffer number, int nMinDigits, int nMaxDigits, NumberFormatInfo info) - { - string fmt = number.sign ? - s_negPercentFormats[info.PercentNegativePattern] : -@@ -1280,7 +1280,7 @@ private static unsafe int FindSection(ReadOnlySpan format, int section) - } - } - -- internal static unsafe void NumberToStringFormat(ref ValueStringBuilder sb, ref NumberBuffer number, ReadOnlySpan format, NumberFormatInfo info) -+ internal static unsafe void NumberToStringFormat(ref ValueStringBuilder sb, scoped ref NumberBuffer number, ReadOnlySpan format, NumberFormatInfo info) - { - int digitCount; - int decimalPos; -diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Windows.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Windows.cs -index b18ca11541275..872e9ee128424 100644 ---- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Windows.cs -+++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Windows.cs -@@ -883,7 +883,7 @@ public static unsafe SocketError Poll(SafeSocketHandle handle, int microseconds, - public static unsafe SocketError Select(IList? checkRead, IList? checkWrite, IList? checkError, int microseconds) - { - const int StackThreshold = 64; // arbitrary limit to avoid too much space on stack -- static bool ShouldStackAlloc(IList? list, ref IntPtr[]? lease, out Span span) -+ static bool ShouldStackAlloc(IList? list, scoped ref IntPtr[]? lease, out Span span) - { - int count; - if (list == null || (count = list.Count) == 0) -diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/DateTimeParse.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/DateTimeParse.cs -index 6455793addd00..28ba7c96a9c5d 100644 ---- a/src/libraries/System.Private.CoreLib/src/System/Globalization/DateTimeParse.cs -+++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/DateTimeParse.cs -@@ -79,7 +79,7 @@ internal static bool TryParseExact(ReadOnlySpan s, ReadOnlySpan form - return false; - } - -- internal static bool TryParseExact(ReadOnlySpan s, ReadOnlySpan format, DateTimeFormatInfo dtfi, DateTimeStyles style, ref DateTimeResult result) -+ internal static bool TryParseExact(ReadOnlySpan s, ReadOnlySpan format, DateTimeFormatInfo dtfi, DateTimeStyles style, scoped ref DateTimeResult result) - { - if (s.Length == 0) - { -@@ -166,7 +166,7 @@ internal static bool TryParseExact(ReadOnlySpan s, ReadOnlySpan form - } - - internal static bool TryParseExactMultiple(ReadOnlySpan s, string?[]? formats, -- DateTimeFormatInfo dtfi, DateTimeStyles style, ref DateTimeResult result) -+ DateTimeFormatInfo dtfi, DateTimeStyles style, scoped ref DateTimeResult result) - { - if (formats == null) - { -@@ -491,7 +491,7 @@ private static bool ParseFraction(ref __DTString str, out double result) - ** FormatException if invalid timezone format is found. - ============================================================================*/ - -- private static bool ParseTimeZone(ref __DTString str, ref TimeSpan result) -+ private static bool ParseTimeZone(ref __DTString str, scoped ref TimeSpan result) - { - // The hour/minute offset for timezone. - int hourOffset; -@@ -565,7 +565,7 @@ private static bool ParseTimeZone(ref __DTString str, ref TimeSpan result) - } - - // This is the helper function to handle timezone in string in the format like +/-0800 -- private static bool HandleTimeZone(ref __DTString str, ref DateTimeResult result) -+ private static bool HandleTimeZone(ref __DTString str, scoped ref DateTimeResult result) - { - if (str.Index < str.Length - 1) - { -@@ -601,7 +601,7 @@ private static bool HandleTimeZone(ref __DTString str, ref DateTimeResult result - // This is the lexer. Check the character at the current index, and put the found token in dtok and - // some raw date/time information in raw. - // -- private static bool Lex(DS dps, ref __DTString str, ref DateTimeToken dtok, ref DateTimeRawInfo raw, ref DateTimeResult result, ref DateTimeFormatInfo dtfi, DateTimeStyles styles) -+ private static bool Lex(DS dps, ref __DTString str, scoped ref DateTimeToken dtok, scoped ref DateTimeRawInfo raw, scoped ref DateTimeResult result, scoped ref DateTimeFormatInfo dtfi, DateTimeStyles styles) - { - int indexBeforeSeparator; - char charBeforeSeparator; -@@ -1539,14 +1539,14 @@ private static bool SetDateYDM(ref DateTimeResult result, int year, int day, int - return SetDateYMD(ref result, year, month, day); - } - -- private static void GetDefaultYear(ref DateTimeResult result, ref DateTimeStyles styles) -+ private static void GetDefaultYear(ref DateTimeResult result, scoped ref DateTimeStyles styles) - { - result.Year = result.calendar.GetYear(GetDateTimeNow(ref result, ref styles)); - result.flags |= ParseFlags.YearDefault; - } - - // Processing teriminal case: DS.DX_NN -- private static bool GetDayOfNN(ref DateTimeResult result, ref DateTimeStyles styles, ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) -+ private static bool GetDayOfNN(ref DateTimeResult result, scoped ref DateTimeStyles styles, scoped ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) - { - if ((result.flags & ParseFlags.HaveDate) != 0) - { -@@ -1588,7 +1588,7 @@ private static bool GetDayOfNN(ref DateTimeResult result, ref DateTimeStyles sty - } - - // Processing teriminal case: DS.DX_NNN -- private static bool GetDayOfNNN(ref DateTimeResult result, ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) -+ private static bool GetDayOfNNN(ref DateTimeResult result, scoped ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) - { - if ((result.flags & ParseFlags.HaveDate) != 0) - { -@@ -1644,7 +1644,7 @@ private static bool GetDayOfNNN(ref DateTimeResult result, ref DateTimeRawInfo r - return false; - } - -- private static bool GetDayOfMN(ref DateTimeResult result, ref DateTimeStyles styles, ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) -+ private static bool GetDayOfMN(ref DateTimeResult result, scoped ref DateTimeStyles styles, scoped ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) - { - if ((result.flags & ParseFlags.HaveDate) != 0) - { -@@ -1703,7 +1703,7 @@ private static bool GetDayOfMN(ref DateTimeResult result, ref DateTimeStyles sty - // - //////////////////////////////////////////////////////////////////////// - -- private static bool GetHebrewDayOfNM(ref DateTimeResult result, ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) -+ private static bool GetHebrewDayOfNM(ref DateTimeResult result, scoped ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) - { - if (!GetMonthDayOrder(dtfi.MonthDayPattern, out int monthDayOrder)) - { -@@ -1723,7 +1723,7 @@ private static bool GetHebrewDayOfNM(ref DateTimeResult result, ref DateTimeRawI - return false; - } - -- private static bool GetDayOfNM(ref DateTimeResult result, ref DateTimeStyles styles, ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) -+ private static bool GetDayOfNM(ref DateTimeResult result, scoped ref DateTimeStyles styles, scoped ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) - { - if ((result.flags & ParseFlags.HaveDate) != 0) - { -@@ -1776,7 +1776,7 @@ private static bool GetDayOfNM(ref DateTimeResult result, ref DateTimeStyles sty - return true; - } - -- private static bool GetDayOfMNN(ref DateTimeResult result, ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) -+ private static bool GetDayOfMNN(ref DateTimeResult result, scoped ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) - { - if ((result.flags & ParseFlags.HaveDate) != 0) - { -@@ -1845,7 +1845,7 @@ private static bool GetDayOfMNN(ref DateTimeResult result, ref DateTimeRawInfo r - return false; - } - -- private static bool GetDayOfYNN(ref DateTimeResult result, ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) -+ private static bool GetDayOfYNN(ref DateTimeResult result, scoped ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) - { - if ((result.flags & ParseFlags.HaveDate) != 0) - { -@@ -1879,7 +1879,7 @@ private static bool GetDayOfYNN(ref DateTimeResult result, ref DateTimeRawInfo r - return false; - } - -- private static bool GetDayOfNNY(ref DateTimeResult result, ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) -+ private static bool GetDayOfNNY(ref DateTimeResult result, scoped ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) - { - if ((result.flags & ParseFlags.HaveDate) != 0) - { -@@ -1917,7 +1917,7 @@ private static bool GetDayOfNNY(ref DateTimeResult result, ref DateTimeRawInfo r - return false; - } - -- private static bool GetDayOfYMN(ref DateTimeResult result, ref DateTimeRawInfo raw) -+ private static bool GetDayOfYMN(ref DateTimeResult result, scoped ref DateTimeRawInfo raw) - { - if ((result.flags & ParseFlags.HaveDate) != 0) - { -@@ -1935,7 +1935,7 @@ private static bool GetDayOfYMN(ref DateTimeResult result, ref DateTimeRawInfo r - return false; - } - -- private static bool GetDayOfYN(ref DateTimeResult result, ref DateTimeRawInfo raw) -+ private static bool GetDayOfYN(ref DateTimeResult result, scoped ref DateTimeRawInfo raw) - { - if ((result.flags & ParseFlags.HaveDate) != 0) - { -@@ -1953,7 +1953,7 @@ private static bool GetDayOfYN(ref DateTimeResult result, ref DateTimeRawInfo ra - return false; - } - -- private static bool GetDayOfYM(ref DateTimeResult result, ref DateTimeRawInfo raw) -+ private static bool GetDayOfYM(ref DateTimeResult result, scoped ref DateTimeRawInfo raw) - { - if ((result.flags & ParseFlags.HaveDate) != 0) - { -@@ -1971,7 +1971,7 @@ private static bool GetDayOfYM(ref DateTimeResult result, ref DateTimeRawInfo ra - return false; - } - -- private static void AdjustTimeMark(DateTimeFormatInfo dtfi, ref DateTimeRawInfo raw) -+ private static void AdjustTimeMark(DateTimeFormatInfo dtfi, scoped ref DateTimeRawInfo raw) - { - // Specail case for culture which uses AM as empty string. - // E.g. af-ZA (0x0436) -@@ -2025,7 +2025,7 @@ private static bool AdjustHour(ref int hour, TM timeMark) - return true; - } - -- private static bool GetTimeOfN(ref DateTimeResult result, ref DateTimeRawInfo raw) -+ private static bool GetTimeOfN(ref DateTimeResult result, scoped ref DateTimeRawInfo raw) - { - if ((result.flags & ParseFlags.HaveTime) != 0) - { -@@ -2046,7 +2046,7 @@ private static bool GetTimeOfN(ref DateTimeResult result, ref DateTimeRawInfo ra - return true; - } - -- private static bool GetTimeOfNN(ref DateTimeResult result, ref DateTimeRawInfo raw) -+ private static bool GetTimeOfNN(ref DateTimeResult result, scoped ref DateTimeRawInfo raw) - { - Debug.Assert(raw.numCount >= 2, "raw.numCount >= 2"); - if ((result.flags & ParseFlags.HaveTime) != 0) -@@ -2062,7 +2062,7 @@ private static bool GetTimeOfNN(ref DateTimeResult result, ref DateTimeRawInfo r - return true; - } - -- private static bool GetTimeOfNNN(ref DateTimeResult result, ref DateTimeRawInfo raw) -+ private static bool GetTimeOfNNN(ref DateTimeResult result, scoped ref DateTimeRawInfo raw) - { - if ((result.flags & ParseFlags.HaveTime) != 0) - { -@@ -2081,7 +2081,7 @@ private static bool GetTimeOfNNN(ref DateTimeResult result, ref DateTimeRawInfo - // - // Processing terminal state: A Date suffix followed by one number. - // -- private static bool GetDateOfDSN(ref DateTimeResult result, ref DateTimeRawInfo raw) -+ private static bool GetDateOfDSN(ref DateTimeResult result, scoped ref DateTimeRawInfo raw) - { - if (raw.numCount != 1 || result.Day != -1) - { -@@ -2092,7 +2092,7 @@ private static bool GetDateOfDSN(ref DateTimeResult result, ref DateTimeRawInfo - return true; - } - -- private static bool GetDateOfNDS(ref DateTimeResult result, ref DateTimeRawInfo raw) -+ private static bool GetDateOfNDS(ref DateTimeResult result, scoped ref DateTimeRawInfo raw) - { - if (result.Month == -1) - { -@@ -2116,7 +2116,7 @@ private static bool GetDateOfNDS(ref DateTimeResult result, ref DateTimeRawInfo - return true; - } - -- private static bool GetDateOfNNDS(ref DateTimeResult result, ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) -+ private static bool GetDateOfNNDS(ref DateTimeResult result, scoped ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) - { - // For partial CJK Dates, the only valid formats are with a specified year, followed by two numbers, which - // will be the Month and Day, and with a specified Month, when the numbers are either the year and day or -@@ -2165,7 +2165,7 @@ private static bool GetDateOfNNDS(ref DateTimeResult result, ref DateTimeRawInfo - // - // A date suffix is found, use this method to put the number into the result. - // -- private static bool ProcessDateTimeSuffix(ref DateTimeResult result, ref DateTimeRawInfo raw, ref DateTimeToken dtok) -+ private static bool ProcessDateTimeSuffix(ref DateTimeResult result, scoped ref DateTimeRawInfo raw, scoped ref DateTimeToken dtok) - { - switch (dtok.suffix) - { -@@ -2229,7 +2229,7 @@ private static bool ProcessDateTimeSuffix(ref DateTimeResult result, ref DateTim - // - //////////////////////////////////////////////////////////////////////// - -- internal static bool ProcessHebrewTerminalState(DS dps, ref DateTimeResult result, ref DateTimeStyles styles, ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) -+ internal static bool ProcessHebrewTerminalState(DS dps, scoped ref DateTimeResult result, scoped ref DateTimeStyles styles, scoped ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) - { - // The following are accepted terminal state for Hebrew date. - switch (dps) -@@ -2339,7 +2339,7 @@ internal static bool ProcessHebrewTerminalState(DS dps, ref DateTimeResult resul - // A terminal state has been reached, call the appropriate function to fill in the parsing result. - // Return true if the state is a terminal state. - // -- internal static bool ProcessTerminalState(DS dps, ref DateTimeResult result, ref DateTimeStyles styles, ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) -+ internal static bool ProcessTerminalState(DS dps, scoped ref DateTimeResult result, scoped ref DateTimeStyles styles, scoped ref DateTimeRawInfo raw, DateTimeFormatInfo dtfi) - { - bool passed = true; - switch (dps) -@@ -2484,7 +2484,7 @@ internal static bool TryParse(ReadOnlySpan s, DateTimeFormatInfo dtfi, Dat - // - // This is the real method to do the parsing work. - // -- internal static bool TryParse(ReadOnlySpan s, DateTimeFormatInfo dtfi, DateTimeStyles styles, ref DateTimeResult result) -+ internal static bool TryParse(ReadOnlySpan s, DateTimeFormatInfo dtfi, DateTimeStyles styles, scoped ref DateTimeResult result) - { - if (s.Length == 0) - { -@@ -2951,7 +2951,7 @@ private static bool AdjustTimeZoneToLocal(ref DateTimeResult result, bool bTimeO - // Parse the ISO8601 format string found during Parse(); - // - // -- private static bool ParseISO8601(ref DateTimeRawInfo raw, ref __DTString str, DateTimeStyles styles, ref DateTimeResult result) -+ private static bool ParseISO8601(scoped ref DateTimeRawInfo raw, ref __DTString str, DateTimeStyles styles, scoped ref DateTimeResult result) - { - str.Index--; - int second = 0; -@@ -3158,7 +3158,7 @@ internal static bool ParseDigits(ref __DTString str, int minDigitLen, int maxDig - **Exceptions: FormatException if error in parsing number. - ==============================================================================*/ - -- private static bool ParseFractionExact(ref __DTString str, int maxDigitLen, ref double result) -+ private static bool ParseFractionExact(ref __DTString str, int maxDigitLen, scoped ref double result) - { - if (!str.GetNextDigit()) - { -@@ -3191,7 +3191,7 @@ private static bool ParseFractionExact(ref __DTString str, int maxDigitLen, ref - ** symbol is not found. - ==============================================================================*/ - -- private static bool ParseSign(ref __DTString str, ref bool result) -+ private static bool ParseSign(ref __DTString str, scoped ref bool result) - { - if (!str.GetNext()) - { -@@ -3222,7 +3222,7 @@ private static bool ParseSign(ref __DTString str, ref bool result) - **Exceptions: FormatException if errors in parsing. - ==============================================================================*/ - -- private static bool ParseTimeZoneOffset(ref __DTString str, int len, ref TimeSpan result) -+ private static bool ParseTimeZoneOffset(ref __DTString str, int len, scoped ref TimeSpan result) - { - bool isPositive = true; - int hourOffset; -@@ -3293,7 +3293,7 @@ private static bool ParseTimeZoneOffset(ref __DTString str, int len, ref TimeSpa - **Exceptions: FormatException if an abbreviated month name can not be found. - ==============================================================================*/ - -- private static bool MatchAbbreviatedMonthName(ref __DTString str, DateTimeFormatInfo dtfi, ref int result) -+ private static bool MatchAbbreviatedMonthName(ref __DTString str, DateTimeFormatInfo dtfi, scoped ref int result) - { - int maxMatchStrLen = 0; - result = -1; -@@ -3364,7 +3364,7 @@ private static bool MatchAbbreviatedMonthName(ref __DTString str, DateTimeFormat - **Exceptions: FormatException if a month name can not be found. - ==============================================================================*/ - -- private static bool MatchMonthName(ref __DTString str, DateTimeFormatInfo dtfi, ref int result) -+ private static bool MatchMonthName(ref __DTString str, DateTimeFormatInfo dtfi, scoped ref int result) - { - int maxMatchStrLen = 0; - result = -1; -@@ -3436,7 +3436,7 @@ private static bool MatchMonthName(ref __DTString str, DateTimeFormatInfo dtfi, - **Exceptions: FormatException if a abbreviated day of week name can not be found. - ==============================================================================*/ - -- private static bool MatchAbbreviatedDayName(ref __DTString str, DateTimeFormatInfo dtfi, ref int result) -+ private static bool MatchAbbreviatedDayName(ref __DTString str, DateTimeFormatInfo dtfi, scoped ref int result) - { - int maxMatchStrLen = 0; - result = -1; -@@ -3474,7 +3474,7 @@ private static bool MatchAbbreviatedDayName(ref __DTString str, DateTimeFormatIn - **Exceptions: FormatException if a day of week name can not be found. - ==============================================================================*/ - -- private static bool MatchDayName(ref __DTString str, DateTimeFormatInfo dtfi, ref int result) -+ private static bool MatchDayName(ref __DTString str, DateTimeFormatInfo dtfi, scoped ref int result) - { - // Turkish (tr-TR) got day names with the same prefix. - int maxMatchStrLen = 0; -@@ -3513,7 +3513,7 @@ private static bool MatchDayName(ref __DTString str, DateTimeFormatInfo dtfi, re - **Exceptions: FormatException if an era name can not be found. - ==============================================================================*/ - -- private static bool MatchEraName(ref __DTString str, DateTimeFormatInfo dtfi, ref int result) -+ private static bool MatchEraName(ref __DTString str, DateTimeFormatInfo dtfi, scoped ref int result) - { - if (str.GetNext()) - { -@@ -3551,7 +3551,7 @@ private static bool MatchEraName(ref __DTString str, DateTimeFormatInfo dtfi, re - **Exceptions: FormatException if a time mark can not be found. - ==============================================================================*/ - -- private static bool MatchTimeMark(ref __DTString str, DateTimeFormatInfo dtfi, ref TM result) -+ private static bool MatchTimeMark(ref __DTString str, DateTimeFormatInfo dtfi, scoped ref TM result) - { - result = TM.NotSet; - // In some cultures have empty strings in AM/PM mark. E.g. af-ZA (0x0436), the AM mark is "", and PM mark is "nm". -@@ -3606,7 +3606,7 @@ private static bool MatchTimeMark(ref __DTString str, DateTimeFormatInfo dtfi, r - **Exceptions: FormatException if a abbreviated time mark can not be found. - ==============================================================================*/ - -- private static bool MatchAbbreviatedTimeMark(ref __DTString str, DateTimeFormatInfo dtfi, ref TM result) -+ private static bool MatchAbbreviatedTimeMark(ref __DTString str, DateTimeFormatInfo dtfi, scoped ref TM result) - { - // NOTENOTE : the assumption here is that abbreviated time mark is the first - // character of the AM/PM designator. If this invariant changes, we have to -@@ -3640,7 +3640,7 @@ private static bool MatchAbbreviatedTimeMark(ref __DTString str, DateTimeFormatI - **Exceptions: - ==============================================================================*/ - -- private static bool CheckNewValue(ref int currentValue, int newValue, char patternChar, ref DateTimeResult result) -+ private static bool CheckNewValue(scoped ref int currentValue, int newValue, char patternChar, scoped ref DateTimeResult result) - { - if (currentValue == -1) - { -@@ -3658,7 +3658,7 @@ private static bool CheckNewValue(ref int currentValue, int newValue, char patte - return true; - } - -- private static DateTime GetDateTimeNow(ref DateTimeResult result, ref DateTimeStyles styles) -+ private static DateTime GetDateTimeNow(scoped ref DateTimeResult result, scoped ref DateTimeStyles styles) - { - if ((result.flags & ParseFlags.CaptureOffset) != 0) - { -@@ -3678,7 +3678,7 @@ private static DateTime GetDateTimeNow(ref DateTimeResult result, ref DateTimeSt - return DateTime.Now; - } - -- private static bool CheckDefaultDateTime(ref DateTimeResult result, ref Calendar cal, DateTimeStyles styles) -+ private static bool CheckDefaultDateTime(scoped ref DateTimeResult result, scoped ref Calendar cal, DateTimeStyles styles) - { - if ((result.flags & ParseFlags.CaptureOffset) != 0) - { -@@ -3779,7 +3779,7 @@ private static bool CheckDefaultDateTime(ref DateTimeResult result, ref Calendar - // This method also set the dtfi according/parseInfo to some special pre-defined - // formats. - // -- private static string ExpandPredefinedFormat(ReadOnlySpan format, ref DateTimeFormatInfo dtfi, ref ParsingInfo parseInfo, ref DateTimeResult result) -+ private static string ExpandPredefinedFormat(ReadOnlySpan format, scoped ref DateTimeFormatInfo dtfi, scoped ref ParsingInfo parseInfo, scoped ref DateTimeResult result) - { - // - // Check the format to see if we need to override the dtfi to be InvariantInfo, -@@ -3842,7 +3842,7 @@ private static bool ParseJapaneseEraStart(ref __DTString str, DateTimeFormatInfo - return true; - } - -- private static void ConfigureFormatR(ref DateTimeFormatInfo dtfi, ref ParsingInfo parseInfo, ref DateTimeResult result) -+ private static void ConfigureFormatR(scoped ref DateTimeFormatInfo dtfi, scoped ref ParsingInfo parseInfo, scoped ref DateTimeResult result) - { - parseInfo.calendar = GregorianCalendar.GetDefaultInstance(); - dtfi = DateTimeFormatInfo.InvariantInfo; -@@ -3852,7 +3852,7 @@ private static void ConfigureFormatR(ref DateTimeFormatInfo dtfi, ref ParsingInf - } - } - -- private static void ConfigureFormatOS(ref DateTimeFormatInfo dtfi, ref ParsingInfo parseInfo) -+ private static void ConfigureFormatOS(scoped ref DateTimeFormatInfo dtfi, scoped ref ParsingInfo parseInfo) - { - parseInfo.calendar = GregorianCalendar.GetDefaultInstance(); - dtfi = DateTimeFormatInfo.InvariantInfo; -@@ -3863,9 +3863,9 @@ private static void ConfigureFormatOS(ref DateTimeFormatInfo dtfi, ref ParsingIn - private static bool ParseByFormat( - ref __DTString str, - ref __DTString format, -- ref ParsingInfo parseInfo, -+ scoped ref ParsingInfo parseInfo, - DateTimeFormatInfo dtfi, -- ref DateTimeResult result) -+ scoped ref DateTimeResult result) - { - int tokenLen; - int tempYear = 0, tempMonth = 0, tempDay = 0, tempDayOfWeek = 0, tempHour = 0, tempMinute = 0, tempSecond = 0; -@@ -4451,7 +4451,7 @@ internal static bool TryParseQuoteString(ReadOnlySpan format, int pos, ref - ReadOnlySpan formatParam, - DateTimeStyles styles, - DateTimeFormatInfo dtfi, -- ref DateTimeResult result) -+ scoped ref DateTimeResult result) - { - ParsingInfo parseInfo = default; - parseInfo.Init(); -@@ -4657,7 +4657,7 @@ internal static bool TryParseQuoteString(ReadOnlySpan format, int pos, ref - return DetermineTimeZoneAdjustments(ref result, styles, bTimeOnly); - } - -- private static bool ParseFormatR(ReadOnlySpan source, ref ParsingInfo parseInfo, ref DateTimeResult result) -+ private static bool ParseFormatR(ReadOnlySpan source, scoped ref ParsingInfo parseInfo, scoped ref DateTimeResult result) - { - // Example: - // Tue, 03 Jan 2017 08:08:05 GMT -@@ -4852,7 +4852,7 @@ private static bool ParseFormatR(ReadOnlySpan source, ref ParsingInfo pars - return true; - } - -- private static bool ParseFormatO(ReadOnlySpan source, ref DateTimeResult result) -+ private static bool ParseFormatO(ReadOnlySpan source, scoped ref DateTimeResult result) - { - // Examples: - // 2017-06-12T05:30:45.7680000 (interpreted as local time wrt to current time zone) -@@ -5066,7 +5066,7 @@ private static bool ParseFormatO(ReadOnlySpan source, ref DateTimeResult r - return DetermineTimeZoneAdjustments(ref result, DateTimeStyles.None, bTimeOnly: false); - } - -- private static Exception GetDateTimeParseException(ref DateTimeResult result) -+ private static Exception GetDateTimeParseException(scoped ref DateTimeResult result) - { - switch (result.failure) - { -@@ -5438,7 +5438,7 @@ internal TokenType GetSeparatorToken(DateTimeFormatInfo dtfi, out int indexBefor - Index + target.Length <= Length && - m_info.Compare(Value.Slice(Index, target.Length), target, CompareOptions.IgnoreCase) == 0; - -- internal bool MatchSpecifiedWords(string target, bool checkWordBoundary, ref int matchLength) -+ internal bool MatchSpecifiedWords(string target, bool checkWordBoundary, scoped ref int matchLength) - { - int valueRemaining = Value.Length - Index; - matchLength = target.Length; -@@ -5584,7 +5584,7 @@ internal bool Match(char ch) - // maxMatchStrLen [in/out] the initialized maximum length. This parameter can be used to - // find the longest match in two string arrays. - // -- internal int MatchLongestWords(string[] words, ref int maxMatchStrLen) -+ internal int MatchLongestWords(string[] words, scoped ref int maxMatchStrLen) - { - int result = -1; - for (int i = 0; i < words.Length; i++) -diff --git a/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs b/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs -index d84220ef8889b..1b28f08a0049f 100644 ---- a/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs -+++ b/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs -@@ -349,7 +349,7 @@ public static unsafe bool TryFormatDecimal(decimal value, ReadOnlySpan for - return sb.TryCopyTo(destination, out charsWritten); - } - -- internal static unsafe void DecimalToNumber(ref decimal d, ref NumberBuffer number) -+ internal static unsafe void DecimalToNumber(scoped ref decimal d, ref NumberBuffer number) - { - byte* buffer = number.GetDigitsPointer(); - number.DigitsCount = DecimalPrecision; -diff --git a/src/libraries/System.Private.CoreLib/src/System/Number.Parsing.cs b/src/libraries/System.Private.CoreLib/src/System/Number.Parsing.cs -index 65c1c8745eb65..a9bb8ec61bd68 100644 ---- a/src/libraries/System.Private.CoreLib/src/System/Number.Parsing.cs -+++ b/src/libraries/System.Private.CoreLib/src/System/Number.Parsing.cs -@@ -342,7 +342,7 @@ internal static UInt128 ParseUInt128(ReadOnlySpan value, NumberStyles styl - return result; - } - -- private static unsafe bool TryParseNumber(ref char* str, char* strEnd, NumberStyles styles, ref NumberBuffer number, NumberFormatInfo info) -+ private static unsafe bool TryParseNumber(scoped ref char* str, char* strEnd, NumberStyles styles, ref NumberBuffer number, NumberFormatInfo info) - { - Debug.Assert(str != null); - Debug.Assert(strEnd != null); -diff --git a/src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyNameParser.cs b/src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyNameParser.cs -index ab6dce32c2b95..8ab6b644581f7 100644 ---- a/src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyNameParser.cs -+++ b/src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyNameParser.cs -@@ -73,7 +73,7 @@ public static AssemblyNameParts Parse(ReadOnlySpan name) - return new AssemblyNameParser(name).Parse(); - } - -- private void RecordNewSeenOrThrow(ref AttributeKind seenAttributes, AttributeKind newAttribute) -+ private void RecordNewSeenOrThrow(scoped ref AttributeKind seenAttributes, AttributeKind newAttribute) - { - if ((seenAttributes & newAttribute) != 0) - { -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.MultiSegment.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.MultiSegment.cs -index 9bdc3a1cad151..8635031292e32 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.MultiSegment.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.MultiSegment.cs -@@ -1102,7 +1102,7 @@ private bool ConsumeStringAndValidateMultiSegment(ReadOnlySpan data, int i - return true; - } - -- private void RollBackState(in PartialStateForRollback state, bool isError = false) -+ private void RollBackState(scoped in PartialStateForRollback state, bool isError = false) - { - _totalConsumed = state._prevTotalConsumed; - -@@ -1251,7 +1251,7 @@ private bool TryGetNumberMultiSegment(ReadOnlySpan data, out int consumed) - return true; - } - -- private ConsumeNumberResult ConsumeNegativeSignMultiSegment(ref ReadOnlySpan data, ref int i, in PartialStateForRollback rollBackState) -+ private ConsumeNumberResult ConsumeNegativeSignMultiSegment(ref ReadOnlySpan data, scoped ref int i, scoped in PartialStateForRollback rollBackState) - { - Debug.Assert(i == 0); - byte nextByte = data[i]; -@@ -1293,7 +1293,7 @@ private ConsumeNumberResult ConsumeNegativeSignMultiSegment(ref ReadOnlySpan data, ref int i, in PartialStateForRollback rollBackState) -+ private ConsumeNumberResult ConsumeZeroMultiSegment(ref ReadOnlySpan data, scoped ref int i, scoped in PartialStateForRollback rollBackState) - { - Debug.Assert(data[i] == (byte)'0'); - Debug.Assert(i == 0 || i == 1); -@@ -1349,7 +1349,7 @@ private ConsumeNumberResult ConsumeZeroMultiSegment(ref ReadOnlySpan data, - return ConsumeNumberResult.OperationIncomplete; - } - -- private ConsumeNumberResult ConsumeIntegerDigitsMultiSegment(ref ReadOnlySpan data, ref int i) -+ private ConsumeNumberResult ConsumeIntegerDigitsMultiSegment(ref ReadOnlySpan data, scoped ref int i) - { - byte nextByte = default; - int counter = 0; -@@ -1427,7 +1427,7 @@ private ConsumeNumberResult ConsumeIntegerDigitsMultiSegment(ref ReadOnlySpan data, ref int i, in PartialStateForRollback rollBackState) -+ private ConsumeNumberResult ConsumeDecimalDigitsMultiSegment(ref ReadOnlySpan data, scoped ref int i, scoped in PartialStateForRollback rollBackState) - { - if (i >= data.Length) - { -@@ -1461,7 +1461,7 @@ private ConsumeNumberResult ConsumeDecimalDigitsMultiSegment(ref ReadOnlySpan data, ref int i, in PartialStateForRollback rollBackState) -+ private ConsumeNumberResult ConsumeSignMultiSegment(ref ReadOnlySpan data, scoped ref int i, scoped in PartialStateForRollback rollBackState) - { - if (i >= data.Length) - { -@@ -1926,7 +1926,7 @@ private ConsumeTokenResult ConsumeNextTokenFromLastNonCommentTokenMultiSegment() - return ConsumeTokenResult.NotEnoughDataRollBackState; - } - -- private bool SkipAllCommentsMultiSegment(ref byte marker) -+ private bool SkipAllCommentsMultiSegment(scoped ref byte marker) - { - while (marker == JsonConstants.Slash) - { -@@ -1961,7 +1961,7 @@ private bool SkipAllCommentsMultiSegment(ref byte marker) - return false; - } - -- private bool SkipAllCommentsMultiSegment(ref byte marker, ExceptionResource resource) -+ private bool SkipAllCommentsMultiSegment(scoped ref byte marker, ExceptionResource resource) - { - while (marker == JsonConstants.Slash) - { -@@ -2394,7 +2394,7 @@ private bool SkipSingleLineCommentMultiSegment(ReadOnlySpan localBuffer, o - return true; - } - -- private int FindLineSeparatorMultiSegment(ReadOnlySpan localBuffer, ref int dangerousLineSeparatorBytesConsumed) -+ private int FindLineSeparatorMultiSegment(ReadOnlySpan localBuffer, scoped ref int dangerousLineSeparatorBytesConsumed) - { - Debug.Assert(dangerousLineSeparatorBytesConsumed >= 0 && dangerousLineSeparatorBytesConsumed <= 2); - -@@ -2444,7 +2444,7 @@ private int FindLineSeparatorMultiSegment(ReadOnlySpan localBuffer, ref in - } - - // assumes first byte (JsonConstants.UnexpectedEndOfLineSeparator) is already read -- private void ThrowOnDangerousLineSeparatorMultiSegment(ReadOnlySpan localBuffer, ref int dangerousLineSeparatorBytesConsumed) -+ private void ThrowOnDangerousLineSeparatorMultiSegment(ReadOnlySpan localBuffer, scoped ref int dangerousLineSeparatorBytesConsumed) - { - Debug.Assert(dangerousLineSeparatorBytesConsumed == 1 || dangerousLineSeparatorBytesConsumed == 2); - -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.cs -index 699ccb6fb5a71..eb8518376681c 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.cs -@@ -1524,7 +1524,7 @@ private bool TryGetNumber(ReadOnlySpan data, out int consumed) - return true; - } - -- private ConsumeNumberResult ConsumeNegativeSign(ref ReadOnlySpan data, ref int i) -+ private ConsumeNumberResult ConsumeNegativeSign(ref ReadOnlySpan data, scoped ref int i) - { - byte nextByte = data[i]; - -@@ -1551,7 +1551,7 @@ private ConsumeNumberResult ConsumeNegativeSign(ref ReadOnlySpan data, ref - return ConsumeNumberResult.OperationIncomplete; - } - -- private ConsumeNumberResult ConsumeZero(ref ReadOnlySpan data, ref int i) -+ private ConsumeNumberResult ConsumeZero(ref ReadOnlySpan data, scoped ref int i) - { - Debug.Assert(data[i] == (byte)'0'); - i++; -@@ -1590,7 +1590,7 @@ private ConsumeNumberResult ConsumeZero(ref ReadOnlySpan data, ref int i) - return ConsumeNumberResult.OperationIncomplete; - } - -- private ConsumeNumberResult ConsumeIntegerDigits(ref ReadOnlySpan data, ref int i) -+ private ConsumeNumberResult ConsumeIntegerDigits(ref ReadOnlySpan data, scoped ref int i) - { - byte nextByte = default; - for (; i < data.Length; i++) -@@ -1623,7 +1623,7 @@ private ConsumeNumberResult ConsumeIntegerDigits(ref ReadOnlySpan data, re - return ConsumeNumberResult.OperationIncomplete; - } - -- private ConsumeNumberResult ConsumeDecimalDigits(ref ReadOnlySpan data, ref int i) -+ private ConsumeNumberResult ConsumeDecimalDigits(ref ReadOnlySpan data, scoped ref int i) - { - if (i >= data.Length) - { -@@ -1645,7 +1645,7 @@ private ConsumeNumberResult ConsumeDecimalDigits(ref ReadOnlySpan data, re - return ConsumeIntegerDigits(ref data, ref i); - } - -- private ConsumeNumberResult ConsumeSign(ref ReadOnlySpan data, ref int i) -+ private ConsumeNumberResult ConsumeSign(ref ReadOnlySpan data, scoped ref int i) - { - if (i >= data.Length) - { -@@ -2059,7 +2059,7 @@ private ConsumeTokenResult ConsumeNextTokenFromLastNonCommentToken() - return ConsumeTokenResult.NotEnoughDataRollBackState; - } - -- private bool SkipAllComments(ref byte marker) -+ private bool SkipAllComments(scoped ref byte marker) - { - while (marker == JsonConstants.Slash) - { -@@ -2094,7 +2094,7 @@ private bool SkipAllComments(ref byte marker) - return false; - } - -- private bool SkipAllComments(ref byte marker, ExceptionResource resource) -+ private bool SkipAllComments(scoped ref byte marker, ExceptionResource resource) - { - while (marker == JsonConstants.Slash) - { -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/CastingConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/CastingConverter.cs -index 090480c83fb90..d33924a4dcdce 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/CastingConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/CastingConverter.cs -@@ -43,7 +43,7 @@ internal CastingConverter(JsonConverter sourceConverter) : base(initial - public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options) - => _sourceConverter.Write(writer, CastOnWrite(value), options); - -- internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, ref ReadStack state, out T? value) -+ internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out T? value) - { - bool result = _sourceConverter.OnTryRead(ref reader, typeToConvert, options, ref state, out TSource? sourceValue); - value = CastOnRead(sourceValue); -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ArrayConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ArrayConverter.cs -index 3aa53102d60e1..6ed3d1905fd30 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ArrayConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ArrayConverter.cs -@@ -13,13 +13,13 @@ internal sealed class ArrayConverter : IEnumerableDefault - { - internal override bool CanHaveMetadata => false; - -- protected override void Add(in TElement value, ref ReadStack state) -+ protected override void Add(in TElement value, scoped ref ReadStack state) - { - ((List)state.Current.ReturnValue!).Add(value); - } - - internal override bool SupportsCreateObjectDelegate => false; -- protected override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state, JsonSerializerOptions options) -+ protected override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options) - { - state.Current.ReturnValue = new List(); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ConcurrentQueueOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ConcurrentQueueOfTConverter.cs -index 55c70f35f257d..1053a27bcdfdf 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ConcurrentQueueOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ConcurrentQueueOfTConverter.cs -@@ -9,7 +9,7 @@ internal sealed class ConcurrentQueueOfTConverter - : IEnumerableDefaultConverter - where TCollection : ConcurrentQueue - { -- protected override void Add(in TElement value, ref ReadStack state) -+ protected override void Add(in TElement value, scoped ref ReadStack state) - { - ((TCollection)state.Current.ReturnValue!).Enqueue(value); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ConcurrentStackOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ConcurrentStackOfTConverter.cs -index 87506619bbfe7..5f7f9a5be84b4 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ConcurrentStackOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ConcurrentStackOfTConverter.cs -@@ -9,7 +9,7 @@ internal sealed class ConcurrentStackOfTConverter - : IEnumerableDefaultConverter - where TCollection : ConcurrentStack - { -- protected override void Add(in TElement value, ref ReadStack state) -+ protected override void Add(in TElement value, scoped ref ReadStack state) - { - ((TCollection)state.Current.ReturnValue!).Push(value); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/DictionaryOfTKeyTValueConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/DictionaryOfTKeyTValueConverter.cs -index cd83ea2925921..5d78f1e62ff1d 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/DictionaryOfTKeyTValueConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/DictionaryOfTKeyTValueConverter.cs -@@ -15,7 +15,7 @@ internal sealed class DictionaryOfTKeyTValueConverter - where TCollection : Dictionary - where TKey : notnull - { -- protected override void Add(TKey key, in TValue value, JsonSerializerOptions options, ref ReadStack state) -+ protected override void Add(TKey key, in TValue value, JsonSerializerOptions options, scoped ref ReadStack state) - { - ((TCollection)state.Current.ReturnValue!)[key] = value; - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IAsyncEnumerableOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IAsyncEnumerableOfTConverter.cs -index 8dd3924f66189..fb1887e30c813 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IAsyncEnumerableOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IAsyncEnumerableOfTConverter.cs -@@ -12,7 +12,7 @@ internal sealed class IAsyncEnumerableOfTConverter - : JsonCollectionConverter - where TAsyncEnumerable : IAsyncEnumerable - { -- internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, ref ReadStack state, out TAsyncEnumerable value) -+ internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out TAsyncEnumerable value) - { - if (!typeToConvert.IsAssignableFrom(typeof(IAsyncEnumerable))) - { -@@ -22,13 +22,13 @@ internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, - return base.OnTryRead(ref reader, typeToConvert, options, ref state, out value!); - } - -- protected override void Add(in TElement value, ref ReadStack state) -+ protected override void Add(in TElement value, scoped ref ReadStack state) - { - ((BufferedAsyncEnumerable)state.Current.ReturnValue!)._buffer.Add(value); - } - - internal override bool SupportsCreateObjectDelegate => false; -- protected override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state, JsonSerializerOptions options) -+ protected override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options) - { - state.Current.ReturnValue = new BufferedAsyncEnumerable(); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ICollectionOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ICollectionOfTConverter.cs -index b975961d21c57..a423ae1b98f8c 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ICollectionOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ICollectionOfTConverter.cs -@@ -14,7 +14,7 @@ internal sealed class ICollectionOfTConverter - : IEnumerableDefaultConverter - where TCollection : ICollection - { -- protected override void Add(in TElement value, ref ReadStack state) -+ protected override void Add(in TElement value, scoped ref ReadStack state) - { - TCollection collection = (TCollection)state.Current.ReturnValue!; - collection.Add(value); -@@ -24,7 +24,7 @@ protected override void Add(in TElement value, ref ReadStack state) - }; - } - -- protected override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state, JsonSerializerOptions options) -+ protected override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options) - { - base.CreateCollection(ref reader, ref state, options); - TCollection returnValue = (TCollection)state.Current.ReturnValue!; -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IDictionaryConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IDictionaryConverter.cs -index 3d86186659976..07c2165c68ca8 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IDictionaryConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IDictionaryConverter.cs -@@ -16,7 +16,7 @@ internal sealed class IDictionaryConverter - : JsonDictionaryConverter - where TDictionary : IDictionary - { -- protected override void Add(string key, in object? value, JsonSerializerOptions options, ref ReadStack state) -+ protected override void Add(string key, in object? value, JsonSerializerOptions options, scoped ref ReadStack state) - { - TDictionary collection = (TDictionary)state.Current.ReturnValue!; - collection[key] = value; -@@ -26,7 +26,7 @@ protected override void Add(string key, in object? value, JsonSerializerOptions - } - } - -- protected override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state) -+ protected override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state) - { - base.CreateCollection(ref reader, ref state); - TDictionary returnValue = (TDictionary)state.Current.ReturnValue!; -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IDictionaryOfTKeyTValueConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IDictionaryOfTKeyTValueConverter.cs -index 4102404974c1c..85ec30b2a9fb3 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IDictionaryOfTKeyTValueConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IDictionaryOfTKeyTValueConverter.cs -@@ -16,7 +16,7 @@ internal sealed class IDictionaryOfTKeyTValueConverter - where TKey : notnull - { -- protected override void Add(TKey key, in TValue value, JsonSerializerOptions options, ref ReadStack state) -+ protected override void Add(TKey key, in TValue value, JsonSerializerOptions options, scoped ref ReadStack state) - { - TDictionary collection = (TDictionary)state.Current.ReturnValue!; - collection[key] = value; -@@ -26,7 +26,7 @@ protected override void Add(TKey key, in TValue value, JsonSerializerOptions opt - }; - } - -- protected override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state) -+ protected override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state) - { - base.CreateCollection(ref reader, ref state); - TDictionary returnValue = (TDictionary)state.Current.ReturnValue!; -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableConverter.cs -index 9c98de517695b..f69d6780f5996 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableConverter.cs -@@ -17,13 +17,13 @@ internal sealed class IEnumerableConverter - { - private readonly bool _isDeserializable = typeof(TCollection).IsAssignableFrom(typeof(List)); - -- protected override void Add(in object? value, ref ReadStack state) -+ protected override void Add(in object? value, scoped ref ReadStack state) - { - ((List)state.Current.ReturnValue!).Add(value); - } - - internal override bool SupportsCreateObjectDelegate => false; -- protected override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state, JsonSerializerOptions options) -+ protected override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options) - { - if (!_isDeserializable) - { -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableOfTConverter.cs -index ed1ba61a2132b..c11602fc75112 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableOfTConverter.cs -@@ -15,13 +15,13 @@ internal sealed class IEnumerableOfTConverter - { - private readonly bool _isDeserializable = typeof(TCollection).IsAssignableFrom(typeof(List)); - -- protected override void Add(in TElement value, ref ReadStack state) -+ protected override void Add(in TElement value, scoped ref ReadStack state) - { - ((List)state.Current.ReturnValue!).Add(value); - } - - internal override bool SupportsCreateObjectDelegate => false; -- protected override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state, JsonSerializerOptions options) -+ protected override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options) - { - if (!_isDeserializable) - { -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IListConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IListConverter.cs -index 7c54b27ad93b5..d405282a054f1 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IListConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IListConverter.cs -@@ -13,7 +13,7 @@ internal sealed class IListConverter - : JsonCollectionConverter - where TCollection : IList - { -- protected override void Add(in object? value, ref ReadStack state) -+ protected override void Add(in object? value, scoped ref ReadStack state) - { - TCollection collection = (TCollection)state.Current.ReturnValue!; - collection.Add(value); -@@ -23,7 +23,7 @@ protected override void Add(in object? value, ref ReadStack state) - } - } - -- protected override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state, JsonSerializerOptions options) -+ protected override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options) - { - base.CreateCollection(ref reader, ref state, options); - TCollection returnValue = (TCollection)state.Current.ReturnValue!; -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IListOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IListOfTConverter.cs -index 4de171768d793..47a7f8c116283 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IListOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IListOfTConverter.cs -@@ -14,7 +14,7 @@ internal sealed class IListOfTConverter - : IEnumerableDefaultConverter - where TCollection : IList - { -- protected override void Add(in TElement value, ref ReadStack state) -+ protected override void Add(in TElement value, scoped ref ReadStack state) - { - TCollection collection = (TCollection)state.Current.ReturnValue!; - collection.Add(value); -@@ -24,7 +24,7 @@ protected override void Add(in TElement value, ref ReadStack state) - }; - } - -- protected override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state, JsonSerializerOptions options) -+ protected override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options) - { - base.CreateCollection(ref reader, ref state, options); - TCollection returnValue = (TCollection)state.Current.ReturnValue!; -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IReadOnlyDictionaryOfTKeyTValueConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IReadOnlyDictionaryOfTKeyTValueConverter.cs -index 9841403ec7acc..29cafebf4013a 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IReadOnlyDictionaryOfTKeyTValueConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IReadOnlyDictionaryOfTKeyTValueConverter.cs -@@ -13,13 +13,13 @@ internal sealed class IReadOnlyDictionaryOfTKeyTValueConverter)); - -- protected override void Add(TKey key, in TValue value, JsonSerializerOptions options, ref ReadStack state) -+ protected override void Add(TKey key, in TValue value, JsonSerializerOptions options, scoped ref ReadStack state) - { - ((Dictionary)state.Current.ReturnValue!)[key] = value; - } - - internal override bool SupportsCreateObjectDelegate => false; -- protected override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state) -+ protected override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state) - { - if (!_isDeserializable) - { -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ISetOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ISetOfTConverter.cs -index 2c1fd6b756f3e..71da570158b2f 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ISetOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ISetOfTConverter.cs -@@ -11,7 +11,7 @@ internal sealed class ISetOfTConverter - : IEnumerableDefaultConverter - where TCollection : ISet - { -- protected override void Add(in TElement value, ref ReadStack state) -+ protected override void Add(in TElement value, scoped ref ReadStack state) - { - TCollection collection = (TCollection)state.Current.ReturnValue!; - collection.Add(value); -@@ -21,7 +21,7 @@ protected override void Add(in TElement value, ref ReadStack state) - }; - } - -- protected override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state, JsonSerializerOptions options) -+ protected override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options) - { - base.CreateCollection(ref reader, ref state, options); - TCollection returnValue = (TCollection)state.Current.ReturnValue!; -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ImmutableDictionaryOfTKeyTValueConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ImmutableDictionaryOfTKeyTValueConverter.cs -index de10ec730bf0f..464d5b87caf7c 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ImmutableDictionaryOfTKeyTValueConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ImmutableDictionaryOfTKeyTValueConverter.cs -@@ -12,7 +12,7 @@ internal class ImmutableDictionaryOfTKeyTValueConverter - where TKey : notnull - { -- protected sealed override void Add(TKey key, in TValue value, JsonSerializerOptions options, ref ReadStack state) -+ protected sealed override void Add(TKey key, in TValue value, JsonSerializerOptions options, scoped ref ReadStack state) - { - ((Dictionary)state.Current.ReturnValue!)[key] = value; - } -@@ -20,7 +20,7 @@ protected sealed override void Add(TKey key, in TValue value, JsonSerializerOpti - internal sealed override bool CanHaveMetadata => false; - - internal override bool SupportsCreateObjectDelegate => false; -- protected sealed override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state) -+ protected sealed override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state) - { - state.Current.ReturnValue = new Dictionary(); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ImmutableEnumerableOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ImmutableEnumerableOfTConverter.cs -index 46d7f2cc11b8b..4bcd70e1341b0 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ImmutableEnumerableOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ImmutableEnumerableOfTConverter.cs -@@ -11,7 +11,7 @@ internal class ImmutableEnumerableOfTConverter - : IEnumerableDefaultConverter - where TCollection : IEnumerable - { -- protected sealed override void Add(in TElement value, ref ReadStack state) -+ protected sealed override void Add(in TElement value, scoped ref ReadStack state) - { - ((List)state.Current.ReturnValue!).Add(value); - } -@@ -19,7 +19,7 @@ protected sealed override void Add(in TElement value, ref ReadStack state) - internal sealed override bool CanHaveMetadata => false; - - internal override bool SupportsCreateObjectDelegate => false; -- protected sealed override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state, JsonSerializerOptions options) -+ protected sealed override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options) - { - state.Current.ReturnValue = new List(); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/JsonCollectionConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/JsonCollectionConverter.cs -index 0116002987455..2e3198ce33f2b 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/JsonCollectionConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/JsonCollectionConverter.cs -@@ -18,12 +18,12 @@ internal abstract class JsonCollectionConverter : JsonRes - internal sealed override ConverterStrategy ConverterStrategy => ConverterStrategy.Enumerable; - internal override Type ElementType => typeof(TElement); - -- protected abstract void Add(in TElement value, ref ReadStack state); -+ protected abstract void Add(in TElement value, scoped ref ReadStack state); - - /// - /// When overridden, create the collection. It may be a temporary collection or the final collection. - /// -- protected virtual void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state, JsonSerializerOptions options) -+ protected virtual void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options) - { - JsonTypeInfo typeInfo = state.Current.JsonTypeInfo; - -@@ -63,7 +63,7 @@ protected static JsonConverter GetElementConverter(ref WriteStack stat - ref Utf8JsonReader reader, - Type typeToConvert, - JsonSerializerOptions options, -- ref ReadStack state, -+ scoped ref ReadStack state, - [MaybeNullWhen(false)] out TCollection value) - { - JsonTypeInfo elementTypeInfo = state.Current.JsonTypeInfo.ElementTypeInfo!; -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/JsonDictionaryConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/JsonDictionaryConverter.cs -index b255d679b3446..0b148fefb7203 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/JsonDictionaryConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/JsonDictionaryConverter.cs -@@ -27,7 +27,7 @@ internal abstract class JsonDictionaryConverter : Jso - /// - /// When overridden, adds the value to the collection. - /// -- protected abstract void Add(TKey key, in TValue value, JsonSerializerOptions options, ref ReadStack state); -+ protected abstract void Add(TKey key, in TValue value, JsonSerializerOptions options, scoped ref ReadStack state); - - /// - /// When overridden, converts the temporary collection held in state.Current.ReturnValue to the final collection. -@@ -38,7 +38,7 @@ internal abstract class JsonDictionaryConverter : Jso - /// - /// When overridden, create the collection. It may be a temporary collection or the final collection. - /// -- protected virtual void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state) -+ protected virtual void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state) - { - JsonTypeInfo typeInfo = state.Current.JsonTypeInfo; - -@@ -78,7 +78,7 @@ protected static JsonConverter GetConverter(JsonTypeInfo typeInfo) - ref Utf8JsonReader reader, - Type typeToConvert, - JsonSerializerOptions options, -- ref ReadStack state, -+ scoped ref ReadStack state, - [MaybeNullWhen(false)] out TDictionary value) - { - JsonTypeInfo keyTypeInfo = state.Current.JsonTypeInfo.KeyTypeInfo!; -@@ -301,7 +301,7 @@ protected static JsonConverter GetConverter(JsonTypeInfo typeInfo) - value = (TDictionary)state.Current.ReturnValue!; - return true; - -- static TKey ReadDictionaryKey(JsonConverter keyConverter, ref Utf8JsonReader reader, ref ReadStack state, JsonSerializerOptions options) -+ static TKey ReadDictionaryKey(JsonConverter keyConverter, ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options) - { - TKey key; - string unescapedPropertyNameAsString = reader.GetString()!; -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ListOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ListOfTConverter.cs -index 35e398fe5869f..76aebb4d29cb8 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ListOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ListOfTConverter.cs -@@ -10,12 +10,12 @@ internal sealed class ListOfTConverter - : IEnumerableDefaultConverter - where TCollection: List - { -- protected override void Add(in TElement value, ref ReadStack state) -+ protected override void Add(in TElement value, scoped ref ReadStack state) - { - ((TCollection)state.Current.ReturnValue!).Add(value); - } - -- protected override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state, JsonSerializerOptions options) -+ protected override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options) - { - if (state.Current.JsonTypeInfo.CreateObject == null) - { -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/QueueOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/QueueOfTConverter.cs -index 6e28f4ef2458b..d0f95108cebd6 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/QueueOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/QueueOfTConverter.cs -@@ -9,12 +9,12 @@ internal sealed class QueueOfTConverter - : IEnumerableDefaultConverter - where TCollection : Queue - { -- protected override void Add(in TElement value, ref ReadStack state) -+ protected override void Add(in TElement value, scoped ref ReadStack state) - { - ((TCollection)state.Current.ReturnValue!).Enqueue(value); - } - -- protected override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state, JsonSerializerOptions options) -+ protected override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options) - { - if (state.Current.JsonTypeInfo.CreateObject == null) - { -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/StackOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/StackOfTConverter.cs -index 565754d6a24b8..429071bc2858d 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/StackOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/StackOfTConverter.cs -@@ -10,12 +10,12 @@ internal sealed class StackOfTConverter - : IEnumerableDefaultConverter - where TCollection : Stack - { -- protected override void Add(in TElement value, ref ReadStack state) -+ protected override void Add(in TElement value, scoped ref ReadStack state) - { - ((TCollection)state.Current.ReturnValue!).Push(value); - } - -- protected override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state, JsonSerializerOptions options) -+ protected override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options) - { - if (state.Current.JsonTypeInfo.CreateObject == null) - { -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/StackOrQueueConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/StackOrQueueConverter.cs -index 59f3f3c336ec9..410975df09bef 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/StackOrQueueConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/StackOrQueueConverter.cs -@@ -11,14 +11,14 @@ internal class StackOrQueueConverter - : JsonCollectionConverter - where TCollection : IEnumerable - { -- protected sealed override void Add(in object? value, ref ReadStack state) -+ protected sealed override void Add(in object? value, scoped ref ReadStack state) - { - var addMethodDelegate = ((Action?)state.Current.JsonTypeInfo.AddMethodDelegate); - Debug.Assert(addMethodDelegate != null); - addMethodDelegate((TCollection)state.Current.ReturnValue!, value); - } - -- protected sealed override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state, JsonSerializerOptions options) -+ protected sealed override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options) - { - JsonTypeInfo typeInfo = state.Current.JsonTypeInfo; - Func? constructorDelegate = typeInfo.CreateObject; -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpListConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpListConverter.cs -index fa228e000f360..ae424affe9082 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpListConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpListConverter.cs -@@ -20,13 +20,13 @@ public FSharpListConverter() - _listConstructor = FSharpCoreReflectionProxy.Instance.CreateFSharpListConstructor(); - } - -- protected override void Add(in TElement value, ref ReadStack state) -+ protected override void Add(in TElement value, scoped ref ReadStack state) - { - ((List)state.Current.ReturnValue!).Add(value); - } - - internal override bool SupportsCreateObjectDelegate => false; -- protected override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state, JsonSerializerOptions options) -+ protected override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options) - { - state.Current.ReturnValue = new List(); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpMapConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpMapConverter.cs -index c7cebda077438..86ba3e913f432 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpMapConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpMapConverter.cs -@@ -21,7 +21,7 @@ public FSharpMapConverter() - _mapConstructor = FSharpCoreReflectionProxy.Instance.CreateFSharpMapConstructor(); - } - -- protected override void Add(TKey key, in TValue value, JsonSerializerOptions options, ref ReadStack state) -+ protected override void Add(TKey key, in TValue value, JsonSerializerOptions options, scoped ref ReadStack state) - { - ((List>)state.Current.ReturnValue!).Add (new Tuple(key, value)); - } -@@ -29,7 +29,7 @@ protected override void Add(TKey key, in TValue value, JsonSerializerOptions opt - internal override bool CanHaveMetadata => false; - - internal override bool SupportsCreateObjectDelegate => false; -- protected override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state) -+ protected override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state) - { - state.Current.ReturnValue = new List>(); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpOptionConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpOptionConverter.cs -index c0ba55e63d2a4..8130f829471c7 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpOptionConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpOptionConverter.cs -@@ -37,7 +37,7 @@ public FSharpOptionConverter(JsonConverter elementConverter) - RequiresReadAhead = elementConverter.RequiresReadAhead; - } - -- internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, ref ReadStack state, out TOption? value) -+ internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out TOption? value) - { - // `null` values deserialize as `None` - if (!state.IsContinuation && reader.TokenType == JsonTokenType.Null) -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpSetConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpSetConverter.cs -index 73230b273c99d..5993b7830ba93 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpSetConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpSetConverter.cs -@@ -20,13 +20,13 @@ public FSharpSetConverter() - _setConstructor = FSharpCoreReflectionProxy.Instance.CreateFSharpSetConstructor(); - } - -- protected override void Add(in TElement value, ref ReadStack state) -+ protected override void Add(in TElement value, scoped ref ReadStack state) - { - ((List)state.Current.ReturnValue!).Add(value); - } - - internal override bool SupportsCreateObjectDelegate => false; -- protected override void CreateCollection(ref Utf8JsonReader reader, ref ReadStack state, JsonSerializerOptions options) -+ protected override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options) - { - state.Current.ReturnValue = new List(); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpValueOptionConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpValueOptionConverter.cs -index 1c147c4b64069..7d960e17b0458 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpValueOptionConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpValueOptionConverter.cs -@@ -37,7 +37,7 @@ public FSharpValueOptionConverter(JsonConverter elementConverter) - RequiresReadAhead = elementConverter.RequiresReadAhead; - } - -- internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, ref ReadStack state, out TValueOption value) -+ internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out TValueOption value) - { - // `null` values deserialize as `ValueNone` - if (!state.IsContinuation && reader.TokenType == JsonTokenType.Null) -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/JsonMetadataServicesConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/JsonMetadataServicesConverter.cs -index 45f8a66ce57c5..e029760aa9152 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/JsonMetadataServicesConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/JsonMetadataServicesConverter.cs -@@ -60,7 +60,7 @@ public JsonMetadataServicesConverter(JsonConverter converter) - _converterStrategy = converter.ConverterStrategy; - } - -- internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, ref ReadStack state, out T? value) -+ internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out T? value) - => Converter.OnTryRead(ref reader, typeToConvert, options, ref state, out value); - - internal override bool OnTryWrite(Utf8JsonWriter writer, T value, JsonSerializerOptions options, ref WriteStack state) -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Node/JsonObjectConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Node/JsonObjectConverter.cs -index b3279a01936dd..b8e2d7eea528b 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Node/JsonObjectConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Node/JsonObjectConverter.cs -@@ -19,7 +19,7 @@ internal override void ConfigureJsonTypeInfo(JsonTypeInfo jsonTypeInfo, JsonSeri - string propertyName, - ref Utf8JsonReader reader, - JsonSerializerOptions options, -- ref ReadStack state) -+ scoped ref ReadStack state) - { - bool success = JsonNodeConverter.Instance.TryRead(ref reader, typeof(JsonNode), options, ref state, out JsonNode? value); - Debug.Assert(success); // Node converters are not resumable. -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectConverter.cs -index 6c0a095061fac..62835f45b9406 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectConverter.cs -@@ -35,7 +35,7 @@ public override void Write(Utf8JsonWriter writer, object? value, JsonSerializerO - writer.WriteEndObject(); - } - -- internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, ref ReadStack state, out object? value) -+ internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out object? value) - { - object? referenceValue; - -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectDefaultConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectDefaultConverter.cs -index f12f1991b5625..4a2090f659a99 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectDefaultConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectDefaultConverter.cs -@@ -17,7 +17,7 @@ internal class ObjectDefaultConverter : JsonObjectConverter where T : notn - internal override bool CanHaveMetadata => true; - internal override bool SupportsCreateObjectDelegate => true; - -- internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, ref ReadStack state, [MaybeNullWhen(false)] out T value) -+ internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, [MaybeNullWhen(false)] out T value) - { - JsonTypeInfo jsonTypeInfo = state.Current.JsonTypeInfo; - -@@ -413,7 +413,7 @@ internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected static void ReadPropertyValue( - object obj, -- ref ReadStack state, -+ scoped ref ReadStack state, - ref Utf8JsonReader reader, - JsonPropertyInfo jsonPropertyInfo, - bool useExtensionProperty) -@@ -442,7 +442,7 @@ internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, - state.Current.EndProperty(); - } - -- protected static bool ReadAheadPropertyValue(ref ReadStack state, ref Utf8JsonReader reader, JsonPropertyInfo jsonPropertyInfo) -+ protected static bool ReadAheadPropertyValue(scoped ref ReadStack state, ref Utf8JsonReader reader, JsonPropertyInfo jsonPropertyInfo) - { - // Returning false below will cause the read-ahead functionality to finish the read. - state.Current.PropertyState = StackFramePropertyState.ReadValue; -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Large.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Large.cs -index eabe8e6a62fec..1059bd1ef3971 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Large.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Large.cs -@@ -14,7 +14,7 @@ namespace System.Text.Json.Serialization.Converters - /// - internal class LargeObjectWithParameterizedConstructorConverter : ObjectWithParameterizedConstructorConverter where T : notnull - { -- protected sealed override bool ReadAndCacheConstructorArgument(ref ReadStack state, ref Utf8JsonReader reader, JsonParameterInfo jsonParameterInfo) -+ protected sealed override bool ReadAndCacheConstructorArgument(scoped ref ReadStack state, ref Utf8JsonReader reader, JsonParameterInfo jsonParameterInfo) - { - Debug.Assert(jsonParameterInfo.ShouldDeserialize); - Debug.Assert(jsonParameterInfo.Options != null); -@@ -51,7 +51,7 @@ protected sealed override object CreateObject(ref ReadStackFrame frame) - return obj; - } - -- protected sealed override void InitializeConstructorArgumentCaches(ref ReadStack state, JsonSerializerOptions options) -+ protected sealed override void InitializeConstructorArgumentCaches(scoped ref ReadStack state, JsonSerializerOptions options) - { - JsonTypeInfo typeInfo = state.Current.JsonTypeInfo; - -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Small.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Small.cs -index 1482a32144ec4..1c7314b1b5960 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Small.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Small.cs -@@ -22,7 +22,7 @@ protected override object CreateObject(ref ReadStackFrame frame) - } - - protected override bool ReadAndCacheConstructorArgument( -- ref ReadStack state, -+ scoped ref ReadStack state, - ref Utf8JsonReader reader, - JsonParameterInfo jsonParameterInfo) - { -@@ -54,7 +54,7 @@ protected override object CreateObject(ref ReadStackFrame frame) - } - - private static bool TryRead( -- ref ReadStack state, -+ scoped ref ReadStack state, - ref Utf8JsonReader reader, - JsonParameterInfo jsonParameterInfo, - out TArg arg) -@@ -79,7 +79,7 @@ protected override object CreateObject(ref ReadStackFrame frame) - return success; - } - -- protected override void InitializeConstructorArgumentCaches(ref ReadStack state, JsonSerializerOptions options) -+ protected override void InitializeConstructorArgumentCaches(scoped ref ReadStack state, JsonSerializerOptions options) - { - JsonTypeInfo typeInfo = state.Current.JsonTypeInfo; - -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.cs -index aeba2b9fc95d2..cb501ff8aa307 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.cs -@@ -21,7 +21,7 @@ internal abstract partial class ObjectWithParameterizedConstructorConverter : - { - internal sealed override bool ConstructorIsParameterized => true; - -- internal sealed override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, ref ReadStack state, [MaybeNullWhen(false)] out T value) -+ internal sealed override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, [MaybeNullWhen(false)] out T value) - { - JsonTypeInfo jsonTypeInfo = state.Current.JsonTypeInfo; - -@@ -246,9 +246,9 @@ internal sealed override bool OnTryRead(ref Utf8JsonReader reader, Type typeToCo - return true; - } - -- protected abstract void InitializeConstructorArgumentCaches(ref ReadStack state, JsonSerializerOptions options); -+ protected abstract void InitializeConstructorArgumentCaches(scoped ref ReadStack state, JsonSerializerOptions options); - -- protected abstract bool ReadAndCacheConstructorArgument(ref ReadStack state, ref Utf8JsonReader reader, JsonParameterInfo jsonParameterInfo); -+ protected abstract bool ReadAndCacheConstructorArgument(scoped ref ReadStack state, ref Utf8JsonReader reader, JsonParameterInfo jsonParameterInfo); - - protected abstract object CreateObject(ref ReadStackFrame frame); - -@@ -256,7 +256,7 @@ internal sealed override bool OnTryRead(ref Utf8JsonReader reader, Type typeToCo - /// Performs a full first pass of the JSON input and deserializes the ctor args. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] -- private void ReadConstructorArguments(ref ReadStack state, ref Utf8JsonReader reader, JsonSerializerOptions options) -+ private void ReadConstructorArguments(scoped ref ReadStack state, ref Utf8JsonReader reader, JsonSerializerOptions options) - { - BeginRead(ref state, ref reader, options); - -@@ -342,7 +342,7 @@ private void ReadConstructorArguments(ref ReadStack state, ref Utf8JsonReader re - } - } - -- private bool ReadConstructorArgumentsWithContinuation(ref ReadStack state, ref Utf8JsonReader reader, JsonSerializerOptions options) -+ private bool ReadConstructorArgumentsWithContinuation(scoped ref ReadStack state, ref Utf8JsonReader reader, JsonSerializerOptions options) - { - // Process all properties. - while (true) -@@ -425,7 +425,7 @@ private bool ReadConstructorArgumentsWithContinuation(ref ReadStack state, ref U - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private bool HandleConstructorArgumentWithContinuation( -- ref ReadStack state, -+ scoped ref ReadStack state, - ref Utf8JsonReader reader, - JsonParameterInfo jsonParameterInfo) - { -@@ -462,7 +462,7 @@ private bool ReadConstructorArgumentsWithContinuation(ref ReadStack state, ref U - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static bool HandlePropertyWithContinuation( -- ref ReadStack state, -+ scoped ref ReadStack state, - ref Utf8JsonReader reader, - JsonPropertyInfo jsonPropertyInfo) - { -@@ -537,7 +537,7 @@ private bool ReadConstructorArgumentsWithContinuation(ref ReadStack state, ref U - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] -- private void BeginRead(ref ReadStack state, ref Utf8JsonReader reader, JsonSerializerOptions options) -+ private void BeginRead(scoped ref ReadStack state, ref Utf8JsonReader reader, JsonSerializerOptions options) - { - JsonTypeInfo jsonTypeInfo = state.Current.JsonTypeInfo; - -@@ -562,7 +562,7 @@ private void BeginRead(ref ReadStack state, ref Utf8JsonReader reader, JsonSeria - /// Lookup the constructor parameter given its name in the reader. - /// - protected virtual bool TryLookupConstructorParameter( -- ref ReadStack state, -+ scoped ref ReadStack state, - ref Utf8JsonReader reader, - JsonSerializerOptions options, - out JsonParameterInfo? jsonParameterInfo) -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/NullableConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/NullableConverter.cs -index 292d70e42b646..1e31cba7043ea 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/NullableConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/NullableConverter.cs -@@ -25,7 +25,7 @@ public NullableConverter(JsonConverter elementConverter) - RequiresReadAhead = elementConverter.RequiresReadAhead; - } - -- internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, ref ReadStack state, out T? value) -+ internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out T? value) - { - if (!state.IsContinuation && reader.TokenType == JsonTokenType.Null) - { -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverter.ReadAhead.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverter.ReadAhead.cs -index 50987aa96cb65..b15deac8c486a 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverter.ReadAhead.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverter.ReadAhead.cs -@@ -17,7 +17,7 @@ public abstract partial class JsonConverter - // AggressiveInlining used since this method is on a hot path and short. The optionally called - // method DoSingleValueReadWithReadAhead is not inlined. - [MethodImpl(MethodImplOptions.AggressiveInlining)] -- internal static bool SingleValueReadWithReadAhead(bool requiresReadAhead, ref Utf8JsonReader reader, ref ReadStack state) -+ internal static bool SingleValueReadWithReadAhead(bool requiresReadAhead, ref Utf8JsonReader reader, scoped ref ReadStack state) - { - bool readAhead = requiresReadAhead && state.ReadAhead; - if (!readAhead) -@@ -28,7 +28,7 @@ internal static bool SingleValueReadWithReadAhead(bool requiresReadAhead, ref Ut - return DoSingleValueReadWithReadAhead(ref reader, ref state); - } - -- internal static bool DoSingleValueReadWithReadAhead(ref Utf8JsonReader reader, ref ReadStack state) -+ internal static bool DoSingleValueReadWithReadAhead(ref Utf8JsonReader reader, scoped ref ReadStack state) - { - // When we're reading ahead we always have to save the state as we don't know if the next token - // is an opening object or an array brace. -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverter.cs -index 652637873a2d5..f2a4693dc73de 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverter.cs -@@ -62,7 +62,7 @@ public abstract partial class JsonConverter - string propertyName, - ref Utf8JsonReader reader, - JsonSerializerOptions options, -- ref ReadStack state) -+ scoped ref ReadStack state) - { - Debug.Fail("Should not be reachable."); - -@@ -95,7 +95,7 @@ public abstract partial class JsonConverter - /// - /// Loosely-typed ReadCore() that forwards to strongly-typed ReadCore(). - /// -- internal abstract object? ReadCoreAsObject(ref Utf8JsonReader reader, JsonSerializerOptions options, ref ReadStack state); -+ internal abstract object? ReadCoreAsObject(ref Utf8JsonReader reader, JsonSerializerOptions options, scoped ref ReadStack state); - - - internal static bool ShouldFlush(Utf8JsonWriter writer, ref WriteStack state) -@@ -107,8 +107,8 @@ internal static bool ShouldFlush(Utf8JsonWriter writer, ref WriteStack state) - // This is used internally to quickly determine the type being converted for JsonConverter. - internal abstract Type TypeToConvert { get; } - -- internal abstract bool OnTryReadAsObject(ref Utf8JsonReader reader, JsonSerializerOptions options, ref ReadStack state, out object? value); -- internal abstract bool TryReadAsObject(ref Utf8JsonReader reader, JsonSerializerOptions options, ref ReadStack state, out object? value); -+ internal abstract bool OnTryReadAsObject(ref Utf8JsonReader reader, JsonSerializerOptions options, scoped ref ReadStack state, out object? value); -+ internal abstract bool TryReadAsObject(ref Utf8JsonReader reader, JsonSerializerOptions options, scoped ref ReadStack state, out object? value); - - internal abstract bool TryWriteAsObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options, ref WriteStack state); - -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterFactory.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterFactory.cs -index fbc407b4a347f..ecd84de71c066 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterFactory.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterFactory.cs -@@ -64,7 +64,7 @@ internal JsonConverter GetConverterInternal(Type typeToConvert, JsonSerializerOp - internal sealed override object ReadCoreAsObject( - ref Utf8JsonReader reader, - JsonSerializerOptions options, -- ref ReadStack state) -+ scoped ref ReadStack state) - { - Debug.Fail("We should never get here."); - -@@ -74,7 +74,7 @@ internal JsonConverter GetConverterInternal(Type typeToConvert, JsonSerializerOp - internal sealed override bool OnTryReadAsObject( - ref Utf8JsonReader reader, - JsonSerializerOptions options, -- ref ReadStack state, -+ scoped ref ReadStack state, - out object? value) - { - Debug.Fail("We should never get here."); -@@ -85,7 +85,7 @@ internal JsonConverter GetConverterInternal(Type typeToConvert, JsonSerializerOp - internal sealed override bool TryReadAsObject( - ref Utf8JsonReader reader, - JsonSerializerOptions options, -- ref ReadStack state, -+ scoped ref ReadStack state, - out object? value) - { - Debug.Fail("We should never get here."); -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.ReadCore.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.ReadCore.cs -index 129416323bc4c..df4963e3b6ef2 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.ReadCore.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.ReadCore.cs -@@ -10,7 +10,7 @@ public partial class JsonConverter - internal sealed override object? ReadCoreAsObject( - ref Utf8JsonReader reader, - JsonSerializerOptions options, -- ref ReadStack state) -+ scoped ref ReadStack state) - { - return ReadCore(ref reader, options, ref state); - } -@@ -18,7 +18,7 @@ public partial class JsonConverter - internal T? ReadCore( - ref Utf8JsonReader reader, - JsonSerializerOptions options, -- ref ReadStack state) -+ scoped ref ReadStack state) - { - try - { -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs -index 522f134a95296..551002c4b774f 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonConverterOfT.cs -@@ -147,7 +147,7 @@ internal virtual bool OnTryWrite(Utf8JsonWriter writer, T value, JsonSerializerO - } - - // Provide a default implementation for value converters. -- internal virtual bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, ref ReadStack state, out T? value) -+ internal virtual bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out T? value) - { - value = Read(ref reader, typeToConvert, options); - return true; -@@ -166,7 +166,7 @@ internal virtual bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, J - /// Note that the value of determines if the converter handles null JSON tokens. - public abstract T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options); - -- internal bool TryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, ref ReadStack state, out T? value) -+ internal bool TryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out T? value) - { - // For perf and converter simplicity, handle null here instead of forwarding to the converter. - if (reader.TokenType == JsonTokenType.Null && !HandleNullOnRead && !state.IsContinuation) -@@ -288,14 +288,14 @@ internal bool TryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSeriali - return success; - } - -- internal sealed override bool OnTryReadAsObject(ref Utf8JsonReader reader, JsonSerializerOptions options, ref ReadStack state, out object? value) -+ internal sealed override bool OnTryReadAsObject(ref Utf8JsonReader reader, JsonSerializerOptions options, scoped ref ReadStack state, out object? value) - { - bool success = OnTryRead(ref reader, TypeToConvert, options, ref state, out T? typedValue); - value = typedValue; - return success; - } - -- internal sealed override bool TryReadAsObject(ref Utf8JsonReader reader, JsonSerializerOptions options, ref ReadStack state, out object? value) -+ internal sealed override bool TryReadAsObject(ref Utf8JsonReader reader, JsonSerializerOptions options, scoped ref ReadStack state, out object? value) - { - bool success = TryRead(ref reader, TypeToConvert, options, ref state, out T? typedValue); - value = typedValue; -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandleMetadata.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandleMetadata.cs -index 029c2b43fc38c..73cf9844ce392 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandleMetadata.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandleMetadata.cs -@@ -21,7 +21,7 @@ public static partial class JsonSerializer - internal static readonly byte[] s_typePropertyName = Encoding.UTF8.GetBytes(TypePropertyName); - internal static readonly byte[] s_valuesPropertyName = Encoding.UTF8.GetBytes(ValuesPropertyName); - -- internal static bool TryReadMetadata(JsonConverter converter, JsonTypeInfo jsonTypeInfo, ref Utf8JsonReader reader, ref ReadStack state) -+ internal static bool TryReadMetadata(JsonConverter converter, JsonTypeInfo jsonTypeInfo, ref Utf8JsonReader reader, scoped ref ReadStack state) - { - Debug.Assert(state.Current.ObjectState == StackFrameObjectState.StartToken); - Debug.Assert(state.Current.CanContainMetadata); -@@ -285,7 +285,7 @@ internal static MetadataPropertyName GetMetadataPropertyName(ReadOnlySpan - - internal static bool TryHandleReferenceFromJsonElement( - ref Utf8JsonReader reader, -- ref ReadStack state, -+ scoped ref ReadStack state, - JsonElement element, - [NotNullWhen(true)] out object? referenceValue) - { -@@ -349,7 +349,7 @@ internal static MetadataPropertyName GetMetadataPropertyName(ReadOnlySpan - - internal static bool TryHandleReferenceFromJsonNode( - ref Utf8JsonReader reader, -- ref ReadStack state, -+ scoped ref ReadStack state, - JsonNode jsonNode, - [NotNullWhen(true)] out object? referenceValue) - { -@@ -425,7 +425,7 @@ static string ReadAsStringMetadataValue(JsonNode? jsonNode) - return refMetadataFound; - } - -- internal static void ValidateMetadataForObjectConverter(JsonConverter converter, ref Utf8JsonReader reader, ref ReadStack state) -+ internal static void ValidateMetadataForObjectConverter(JsonConverter converter, ref Utf8JsonReader reader, scoped ref ReadStack state) - { - if (state.Current.MetadataPropertyNames.HasFlag(MetadataPropertyName.Values)) - { -@@ -434,7 +434,7 @@ internal static void ValidateMetadataForObjectConverter(JsonConverter converter, - } - } - -- internal static void ValidateMetadataForArrayConverter(JsonConverter converter, ref Utf8JsonReader reader, ref ReadStack state) -+ internal static void ValidateMetadataForArrayConverter(JsonConverter converter, ref Utf8JsonReader reader, scoped ref ReadStack state) - { - switch (reader.TokenType) - { -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandlePropertyName.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandlePropertyName.cs -index f374fc70daf79..b44461f661167 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandlePropertyName.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandlePropertyName.cs -@@ -19,7 +19,7 @@ public static partial class JsonSerializer - internal static JsonPropertyInfo LookupProperty( - object? obj, - ReadOnlySpan unescapedPropertyName, -- ref ReadStack state, -+ scoped ref ReadStack state, - JsonSerializerOptions options, - out bool useExtensionProperty, - bool createExtensionProperty = true) -@@ -71,7 +71,7 @@ public static partial class JsonSerializer - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static ReadOnlySpan GetPropertyName( -- ref ReadStack state, -+ scoped ref ReadStack state, - ref Utf8JsonReader reader, - JsonSerializerOptions options) - { -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Helpers.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Helpers.cs -index f3cb5b762fa59..318e25da2bc7a 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Helpers.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Helpers.cs -@@ -9,7 +9,7 @@ namespace System.Text.Json - { - public static partial class JsonSerializer - { -- private static TValue? ReadCore(ref Utf8JsonReader reader, JsonTypeInfo jsonTypeInfo, ref ReadStack state) -+ private static TValue? ReadCore(ref Utf8JsonReader reader, JsonTypeInfo jsonTypeInfo, scoped ref ReadStack state) - { - if (jsonTypeInfo is JsonTypeInfo typedInfo) - { -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfo.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfo.cs -index 137a3b238bace..dee80c211cbc9 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfo.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfo.cs -@@ -700,7 +700,7 @@ public int Order - - internal bool ReadJsonAndAddExtensionProperty( - object obj, -- ref ReadStack state, -+ scoped ref ReadStack state, - ref Utf8JsonReader reader) - { - object propValue = GetValueAsObject(obj)!; -@@ -748,11 +748,11 @@ JsonConverter GetDictionaryValueConverter() - } - } - -- internal abstract bool ReadJsonAndSetMember(object obj, ref ReadStack state, ref Utf8JsonReader reader); -+ internal abstract bool ReadJsonAndSetMember(object obj, scoped ref ReadStack state, ref Utf8JsonReader reader); - -- internal abstract bool ReadJsonAsObject(ref ReadStack state, ref Utf8JsonReader reader, out object? value); -+ internal abstract bool ReadJsonAsObject(scoped ref ReadStack state, ref Utf8JsonReader reader, out object? value); - -- internal bool ReadJsonExtensionDataValue(ref ReadStack state, ref Utf8JsonReader reader, out object? value) -+ internal bool ReadJsonExtensionDataValue(scoped ref ReadStack state, ref Utf8JsonReader reader, out object? value) - { - Debug.Assert(this == state.Current.JsonTypeInfo.ExtensionDataProperty); - -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfoOfT.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfoOfT.cs -index f75d1da274f30..8c86d9462246c 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfoOfT.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/JsonPropertyInfoOfT.cs -@@ -334,7 +334,7 @@ internal override bool GetMemberAndWriteJsonExtensionData(object obj, ref WriteS - return success; - } - -- internal override bool ReadJsonAndSetMember(object obj, ref ReadStack state, ref Utf8JsonReader reader) -+ internal override bool ReadJsonAndSetMember(object obj, scoped ref ReadStack state, ref Utf8JsonReader reader) - { - bool success; - -@@ -387,7 +387,7 @@ internal override bool ReadJsonAndSetMember(object obj, ref ReadStack state, ref - return success; - } - -- internal override bool ReadJsonAsObject(ref ReadStack state, ref Utf8JsonReader reader, out object? value) -+ internal override bool ReadJsonAsObject(scoped ref ReadStack state, ref Utf8JsonReader reader, out object? value) - { - bool success; - bool isNullToken = reader.TokenType == JsonTokenType.Null; -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Serialization.cs b/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Serialization.cs -index c0d750799106e..b8ce2bacfd3f8 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Serialization.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.Serialization.cs -@@ -334,7 +334,7 @@ public static void ThrowInvalidOperationException_ConverterCanConvertMultipleTyp - public static void ThrowNotSupportedException_ObjectWithParameterizedCtorRefMetadataNotSupported( - ReadOnlySpan propertyName, - ref Utf8JsonReader reader, -- ref ReadStack state) -+ scoped ref ReadStack state) - { - JsonTypeInfo jsonTypeInfo = state.GetTopJsonTypeInfoWithParameterizedConstructor(); - state.Current.JsonPropertyName = propertyName.ToArray(); -@@ -357,7 +357,7 @@ public static void ThrowInvalidOperationException_CreateObjectConverterNotCompat - } - - [DoesNotReturn] -- public static void ReThrowWithPath(ref ReadStack state, JsonReaderException ex) -+ public static void ReThrowWithPath(scoped ref ReadStack state, JsonReaderException ex) - { - Debug.Assert(ex.Path == null); - -@@ -383,14 +383,14 @@ public static void ReThrowWithPath(ref ReadStack state, JsonReaderException ex) - } - - [DoesNotReturn] -- public static void ReThrowWithPath(ref ReadStack state, in Utf8JsonReader reader, Exception ex) -+ public static void ReThrowWithPath(scoped ref ReadStack state, in Utf8JsonReader reader, Exception ex) - { - JsonException jsonException = new JsonException(null, ex); - AddJsonExceptionInformation(ref state, reader, jsonException); - throw jsonException; - } - -- public static void AddJsonExceptionInformation(ref ReadStack state, in Utf8JsonReader reader, JsonException ex) -+ public static void AddJsonExceptionInformation(scoped ref ReadStack state, in Utf8JsonReader reader, JsonException ex) - { - Debug.Assert(ex.Path is null); // do not overwrite existing path information - -@@ -482,7 +482,7 @@ public static void ThrowInvalidOperationException_NodeJsonObjectCustomConverterN - } - - [DoesNotReturn] -- public static void ThrowNotSupportedException(ref ReadStack state, in Utf8JsonReader reader, NotSupportedException ex) -+ public static void ThrowNotSupportedException(scoped ref ReadStack state, in Utf8JsonReader reader, NotSupportedException ex) - { - string message = ex.Message; - -@@ -536,7 +536,7 @@ public static void ThrowNotSupportedException(ref WriteStack state, NotSupported - } - - [DoesNotReturn] -- public static void ThrowNotSupportedException_DeserializeNoConstructor(Type type, ref Utf8JsonReader reader, ref ReadStack state) -+ public static void ThrowNotSupportedException_DeserializeNoConstructor(Type type, ref Utf8JsonReader reader, scoped ref ReadStack state) - { - string message; - -@@ -553,7 +553,7 @@ public static void ThrowNotSupportedException_DeserializeNoConstructor(Type type - } - - [DoesNotReturn] -- public static void ThrowNotSupportedException_CannotPopulateCollection(Type type, ref Utf8JsonReader reader, ref ReadStack state) -+ public static void ThrowNotSupportedException_CannotPopulateCollection(Type type, ref Utf8JsonReader reader, scoped ref ReadStack state) - { - ThrowNotSupportedException(ref state, reader, new NotSupportedException(SR.Format(SR.CannotPopulateCollection, type))); - } -@@ -583,14 +583,14 @@ public static void ThrowJsonException_MetadataValueWasNotString(JsonValueKind va - } - - [DoesNotReturn] -- public static void ThrowJsonException_MetadataReferenceObjectCannotContainOtherProperties(ReadOnlySpan propertyName, ref ReadStack state) -+ public static void ThrowJsonException_MetadataReferenceObjectCannotContainOtherProperties(ReadOnlySpan propertyName, scoped ref ReadStack state) - { - state.Current.JsonPropertyName = propertyName.ToArray(); - ThrowJsonException_MetadataReferenceObjectCannotContainOtherProperties(); - } - - [DoesNotReturn] -- public static void ThrowJsonException_MetadataUnexpectedProperty(ReadOnlySpan propertyName, ref ReadStack state) -+ public static void ThrowJsonException_MetadataUnexpectedProperty(ReadOnlySpan propertyName, scoped ref ReadStack state) - { - state.Current.JsonPropertyName = propertyName.ToArray(); - ThrowJsonException(SR.Format(SR.MetadataUnexpectedProperty)); -@@ -603,21 +603,21 @@ public static void ThrowJsonException_MetadataReferenceObjectCannotContainOtherP - } - - [DoesNotReturn] -- public static void ThrowJsonException_MetadataIdIsNotFirstProperty(ReadOnlySpan propertyName, ref ReadStack state) -+ public static void ThrowJsonException_MetadataIdIsNotFirstProperty(ReadOnlySpan propertyName, scoped ref ReadStack state) - { - state.Current.JsonPropertyName = propertyName.ToArray(); - ThrowJsonException(SR.MetadataIdIsNotFirstProperty); - } - - [DoesNotReturn] -- public static void ThrowJsonException_MetadataStandaloneValuesProperty(ref ReadStack state, ReadOnlySpan propertyName) -+ public static void ThrowJsonException_MetadataStandaloneValuesProperty(scoped ref ReadStack state, ReadOnlySpan propertyName) - { - state.Current.JsonPropertyName = propertyName.ToArray(); - ThrowJsonException(SR.MetadataStandaloneValuesProperty); - } - - [DoesNotReturn] -- public static void ThrowJsonException_MetadataInvalidPropertyWithLeadingDollarSign(ReadOnlySpan propertyName, ref ReadStack state, in Utf8JsonReader reader) -+ public static void ThrowJsonException_MetadataInvalidPropertyWithLeadingDollarSign(ReadOnlySpan propertyName, scoped ref ReadStack state, in Utf8JsonReader reader) - { - // Set PropertyInfo or KeyName to write down the conflicting property name in JsonException.Path - if (state.Current.IsProcessingDictionary()) -@@ -651,7 +651,7 @@ public static void ThrowJsonException_MetadataInvalidReferenceToValueType(Type p - } - - [DoesNotReturn] -- public static void ThrowJsonException_MetadataInvalidPropertyInArrayMetadata(ref ReadStack state, Type propertyType, in Utf8JsonReader reader) -+ public static void ThrowJsonException_MetadataInvalidPropertyInArrayMetadata(scoped ref ReadStack state, Type propertyType, in Utf8JsonReader reader) - { - state.Current.JsonPropertyName = reader.HasValueSequence ? reader.ValueSequence.ToArray() : reader.ValueSpan.ToArray(); - string propertyNameAsString = reader.GetString()!; -@@ -662,7 +662,7 @@ public static void ThrowJsonException_MetadataInvalidPropertyInArrayMetadata(ref - } - - [DoesNotReturn] -- public static void ThrowJsonException_MetadataPreservedArrayValuesNotFound(ref ReadStack state, Type propertyType) -+ public static void ThrowJsonException_MetadataPreservedArrayValuesNotFound(scoped ref ReadStack state, Type propertyType) - { - // Missing $values, JSON path should point to the property's object. - state.Current.JsonPropertyName = null; -@@ -695,7 +695,7 @@ public static void ThrowInvalidOperationException_JsonPropertyInfoIsBoundToDiffe - internal static void ThrowUnexpectedMetadataException( - ReadOnlySpan propertyName, - ref Utf8JsonReader reader, -- ref ReadStack state) -+ scoped ref ReadStack state) - { - - MetadataPropertyName name = JsonSerializer.GetMetadataPropertyName(propertyName, state.Current.BaseJsonTypeInfo.PolymorphicTypeResolver); - -From 8240b5c0847faed1a0296d1f2220ae46ec395203 Mon Sep 17 00:00:00 2001 -From: Charles Stoner <10732005+cston@users.noreply.github.com> -Date: Fri, 5 Aug 2022 09:34:02 -0700 -Subject: [PATCH 2/5] More - ---- - .../Json/Serialization/JsonSerializer.Read.Utf8JsonReader.cs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Utf8JsonReader.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Utf8JsonReader.cs -index 7eaadb22a99d2..fe0a696109f31 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Utf8JsonReader.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.Utf8JsonReader.cs -@@ -262,7 +262,7 @@ public static partial class JsonSerializer - } - } - -- private static Utf8JsonReader GetReaderScopedToNextValue(ref Utf8JsonReader reader, ref ReadStack state) -+ private static Utf8JsonReader GetReaderScopedToNextValue(ref Utf8JsonReader reader, scoped ref ReadStack state) - { - // Advances the provided reader, validating that it is pointing to a complete JSON value. - // If successful, returns a new Utf8JsonReader that is scoped to the next value, reusing existing buffers. - -From b397d760cb9718e4805f01ad678d645af63fbe93 Mon Sep 17 00:00:00 2001 -From: Charles Stoner <10732005+cston@users.noreply.github.com> -Date: Thu, 11 Aug 2022 11:02:05 -0700 -Subject: [PATCH 3/5] Remove unnecessary 'scoped' - ---- - .../Converters/Collection/DictionaryOfTKeyTValueConverter.cs | 2 +- - .../Serialization/Converters/Collection/IDictionaryConverter.cs | 2 +- - .../Converters/Collection/IDictionaryOfTKeyTValueConverter.cs | 2 +- - .../Collection/IReadOnlyDictionaryOfTKeyTValueConverter.cs | 2 +- - .../Collection/ImmutableDictionaryOfTKeyTValueConverter.cs | 2 +- - .../Converters/Collection/JsonDictionaryConverter.cs | 2 +- - .../Json/Serialization/Converters/FSharp/FSharpMapConverter.cs | 2 +- - 7 files changed, 7 insertions(+), 7 deletions(-) - -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/DictionaryOfTKeyTValueConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/DictionaryOfTKeyTValueConverter.cs -index 5d78f1e62ff1d..cd83ea2925921 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/DictionaryOfTKeyTValueConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/DictionaryOfTKeyTValueConverter.cs -@@ -15,7 +15,7 @@ internal sealed class DictionaryOfTKeyTValueConverter - where TCollection : Dictionary - where TKey : notnull - { -- protected override void Add(TKey key, in TValue value, JsonSerializerOptions options, scoped ref ReadStack state) -+ protected override void Add(TKey key, in TValue value, JsonSerializerOptions options, ref ReadStack state) - { - ((TCollection)state.Current.ReturnValue!)[key] = value; - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IDictionaryConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IDictionaryConverter.cs -index 07c2165c68ca8..8a7017f535202 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IDictionaryConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IDictionaryConverter.cs -@@ -16,7 +16,7 @@ internal sealed class IDictionaryConverter - : JsonDictionaryConverter - where TDictionary : IDictionary - { -- protected override void Add(string key, in object? value, JsonSerializerOptions options, scoped ref ReadStack state) -+ protected override void Add(string key, in object? value, JsonSerializerOptions options, ref ReadStack state) - { - TDictionary collection = (TDictionary)state.Current.ReturnValue!; - collection[key] = value; -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IDictionaryOfTKeyTValueConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IDictionaryOfTKeyTValueConverter.cs -index 85ec30b2a9fb3..9dd55564ed67f 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IDictionaryOfTKeyTValueConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IDictionaryOfTKeyTValueConverter.cs -@@ -16,7 +16,7 @@ internal sealed class IDictionaryOfTKeyTValueConverter - where TKey : notnull - { -- protected override void Add(TKey key, in TValue value, JsonSerializerOptions options, scoped ref ReadStack state) -+ protected override void Add(TKey key, in TValue value, JsonSerializerOptions options, ref ReadStack state) - { - TDictionary collection = (TDictionary)state.Current.ReturnValue!; - collection[key] = value; -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IReadOnlyDictionaryOfTKeyTValueConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IReadOnlyDictionaryOfTKeyTValueConverter.cs -index 29cafebf4013a..e42ecfe496b49 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IReadOnlyDictionaryOfTKeyTValueConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IReadOnlyDictionaryOfTKeyTValueConverter.cs -@@ -13,7 +13,7 @@ internal sealed class IReadOnlyDictionaryOfTKeyTValueConverter)); - -- protected override void Add(TKey key, in TValue value, JsonSerializerOptions options, scoped ref ReadStack state) -+ protected override void Add(TKey key, in TValue value, JsonSerializerOptions options, ref ReadStack state) - { - ((Dictionary)state.Current.ReturnValue!)[key] = value; - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ImmutableDictionaryOfTKeyTValueConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ImmutableDictionaryOfTKeyTValueConverter.cs -index 464d5b87caf7c..db6b62a8de82b 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ImmutableDictionaryOfTKeyTValueConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ImmutableDictionaryOfTKeyTValueConverter.cs -@@ -12,7 +12,7 @@ internal class ImmutableDictionaryOfTKeyTValueConverter - where TKey : notnull - { -- protected sealed override void Add(TKey key, in TValue value, JsonSerializerOptions options, scoped ref ReadStack state) -+ protected sealed override void Add(TKey key, in TValue value, JsonSerializerOptions options, ref ReadStack state) - { - ((Dictionary)state.Current.ReturnValue!)[key] = value; - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/JsonDictionaryConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/JsonDictionaryConverter.cs -index 0b148fefb7203..2f32668898434 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/JsonDictionaryConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/JsonDictionaryConverter.cs -@@ -27,7 +27,7 @@ internal abstract class JsonDictionaryConverter : Jso - /// - /// When overridden, adds the value to the collection. - /// -- protected abstract void Add(TKey key, in TValue value, JsonSerializerOptions options, scoped ref ReadStack state); -+ protected abstract void Add(TKey key, in TValue value, JsonSerializerOptions options, ref ReadStack state); - - /// - /// When overridden, converts the temporary collection held in state.Current.ReturnValue to the final collection. -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpMapConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpMapConverter.cs -index 86ba3e913f432..112da6da2c8d6 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpMapConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpMapConverter.cs -@@ -21,7 +21,7 @@ public FSharpMapConverter() - _mapConstructor = FSharpCoreReflectionProxy.Instance.CreateFSharpMapConstructor(); - } - -- protected override void Add(TKey key, in TValue value, JsonSerializerOptions options, scoped ref ReadStack state) -+ protected override void Add(TKey key, in TValue value, JsonSerializerOptions options, ref ReadStack state) - { - ((List>)state.Current.ReturnValue!).Add (new Tuple(key, value)); - } - -From c021b9559393184b4fa1e13e511d306ba4d0f88b Mon Sep 17 00:00:00 2001 -From: Charles Stoner <10732005+cston@users.noreply.github.com> -Date: Thu, 11 Aug 2022 11:07:31 -0700 -Subject: [PATCH 4/5] Remove unnecessary 'scoped' - ---- - .../Json/Serialization/Converters/Collection/ArrayConverter.cs | 2 +- - .../Converters/Collection/ConcurrentQueueOfTConverter.cs | 2 +- - .../Converters/Collection/ConcurrentStackOfTConverter.cs | 2 +- - .../Converters/Collection/IAsyncEnumerableOfTConverter.cs | 2 +- - .../Converters/Collection/ICollectionOfTConverter.cs | 2 +- - .../Serialization/Converters/Collection/IEnumerableConverter.cs | 2 +- - .../Converters/Collection/IEnumerableOfTConverter.cs | 2 +- - .../Json/Serialization/Converters/Collection/IListConverter.cs | 2 +- - .../Serialization/Converters/Collection/IListOfTConverter.cs | 2 +- - .../Serialization/Converters/Collection/ISetOfTConverter.cs | 2 +- - .../Converters/Collection/ImmutableEnumerableOfTConverter.cs | 2 +- - .../Converters/Collection/JsonCollectionConverter.cs | 2 +- - .../Serialization/Converters/Collection/ListOfTConverter.cs | 2 +- - .../Serialization/Converters/Collection/QueueOfTConverter.cs | 2 +- - .../Serialization/Converters/Collection/StackOfTConverter.cs | 2 +- - .../Converters/Collection/StackOrQueueConverter.cs | 2 +- - .../Json/Serialization/Converters/FSharp/FSharpListConverter.cs | 2 +- - .../Json/Serialization/Converters/FSharp/FSharpSetConverter.cs | 2 +- - 18 files changed, 18 insertions(+), 18 deletions(-) - -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ArrayConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ArrayConverter.cs -index 6ed3d1905fd30..3c189d499275b 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ArrayConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ArrayConverter.cs -@@ -13,7 +13,7 @@ internal sealed class ArrayConverter : IEnumerableDefault - { - internal override bool CanHaveMetadata => false; - -- protected override void Add(in TElement value, scoped ref ReadStack state) -+ protected override void Add(in TElement value, ref ReadStack state) - { - ((List)state.Current.ReturnValue!).Add(value); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ConcurrentQueueOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ConcurrentQueueOfTConverter.cs -index 1053a27bcdfdf..55c70f35f257d 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ConcurrentQueueOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ConcurrentQueueOfTConverter.cs -@@ -9,7 +9,7 @@ internal sealed class ConcurrentQueueOfTConverter - : IEnumerableDefaultConverter - where TCollection : ConcurrentQueue - { -- protected override void Add(in TElement value, scoped ref ReadStack state) -+ protected override void Add(in TElement value, ref ReadStack state) - { - ((TCollection)state.Current.ReturnValue!).Enqueue(value); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ConcurrentStackOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ConcurrentStackOfTConverter.cs -index 5f7f9a5be84b4..87506619bbfe7 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ConcurrentStackOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ConcurrentStackOfTConverter.cs -@@ -9,7 +9,7 @@ internal sealed class ConcurrentStackOfTConverter - : IEnumerableDefaultConverter - where TCollection : ConcurrentStack - { -- protected override void Add(in TElement value, scoped ref ReadStack state) -+ protected override void Add(in TElement value, ref ReadStack state) - { - ((TCollection)state.Current.ReturnValue!).Push(value); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IAsyncEnumerableOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IAsyncEnumerableOfTConverter.cs -index fb1887e30c813..d518eb1596e1d 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IAsyncEnumerableOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IAsyncEnumerableOfTConverter.cs -@@ -22,7 +22,7 @@ internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, - return base.OnTryRead(ref reader, typeToConvert, options, ref state, out value!); - } - -- protected override void Add(in TElement value, scoped ref ReadStack state) -+ protected override void Add(in TElement value, ref ReadStack state) - { - ((BufferedAsyncEnumerable)state.Current.ReturnValue!)._buffer.Add(value); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ICollectionOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ICollectionOfTConverter.cs -index a423ae1b98f8c..47bcf0b9d554a 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ICollectionOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ICollectionOfTConverter.cs -@@ -14,7 +14,7 @@ internal sealed class ICollectionOfTConverter - : IEnumerableDefaultConverter - where TCollection : ICollection - { -- protected override void Add(in TElement value, scoped ref ReadStack state) -+ protected override void Add(in TElement value, ref ReadStack state) - { - TCollection collection = (TCollection)state.Current.ReturnValue!; - collection.Add(value); -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableConverter.cs -index f69d6780f5996..33c6379542491 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableConverter.cs -@@ -17,7 +17,7 @@ internal sealed class IEnumerableConverter - { - private readonly bool _isDeserializable = typeof(TCollection).IsAssignableFrom(typeof(List)); - -- protected override void Add(in object? value, scoped ref ReadStack state) -+ protected override void Add(in object? value, ref ReadStack state) - { - ((List)state.Current.ReturnValue!).Add(value); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableOfTConverter.cs -index c11602fc75112..905e7211ae214 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableOfTConverter.cs -@@ -15,7 +15,7 @@ internal sealed class IEnumerableOfTConverter - { - private readonly bool _isDeserializable = typeof(TCollection).IsAssignableFrom(typeof(List)); - -- protected override void Add(in TElement value, scoped ref ReadStack state) -+ protected override void Add(in TElement value, ref ReadStack state) - { - ((List)state.Current.ReturnValue!).Add(value); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IListConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IListConverter.cs -index d405282a054f1..208d1c1fcc7e7 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IListConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IListConverter.cs -@@ -13,7 +13,7 @@ internal sealed class IListConverter - : JsonCollectionConverter - where TCollection : IList - { -- protected override void Add(in object? value, scoped ref ReadStack state) -+ protected override void Add(in object? value, ref ReadStack state) - { - TCollection collection = (TCollection)state.Current.ReturnValue!; - collection.Add(value); -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IListOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IListOfTConverter.cs -index 47a7f8c116283..36ee248dab4e1 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IListOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IListOfTConverter.cs -@@ -14,7 +14,7 @@ internal sealed class IListOfTConverter - : IEnumerableDefaultConverter - where TCollection : IList - { -- protected override void Add(in TElement value, scoped ref ReadStack state) -+ protected override void Add(in TElement value, ref ReadStack state) - { - TCollection collection = (TCollection)state.Current.ReturnValue!; - collection.Add(value); -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ISetOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ISetOfTConverter.cs -index 71da570158b2f..390ed6097dda7 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ISetOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ISetOfTConverter.cs -@@ -11,7 +11,7 @@ internal sealed class ISetOfTConverter - : IEnumerableDefaultConverter - where TCollection : ISet - { -- protected override void Add(in TElement value, scoped ref ReadStack state) -+ protected override void Add(in TElement value, ref ReadStack state) - { - TCollection collection = (TCollection)state.Current.ReturnValue!; - collection.Add(value); -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ImmutableEnumerableOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ImmutableEnumerableOfTConverter.cs -index 4bcd70e1341b0..541f5cbf57a70 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ImmutableEnumerableOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ImmutableEnumerableOfTConverter.cs -@@ -11,7 +11,7 @@ internal class ImmutableEnumerableOfTConverter - : IEnumerableDefaultConverter - where TCollection : IEnumerable - { -- protected sealed override void Add(in TElement value, scoped ref ReadStack state) -+ protected sealed override void Add(in TElement value, ref ReadStack state) - { - ((List)state.Current.ReturnValue!).Add(value); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/JsonCollectionConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/JsonCollectionConverter.cs -index 2e3198ce33f2b..ae28e2dc65810 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/JsonCollectionConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/JsonCollectionConverter.cs -@@ -18,7 +18,7 @@ internal abstract class JsonCollectionConverter : JsonRes - internal sealed override ConverterStrategy ConverterStrategy => ConverterStrategy.Enumerable; - internal override Type ElementType => typeof(TElement); - -- protected abstract void Add(in TElement value, scoped ref ReadStack state); -+ protected abstract void Add(in TElement value, ref ReadStack state); - - /// - /// When overridden, create the collection. It may be a temporary collection or the final collection. -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ListOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ListOfTConverter.cs -index 76aebb4d29cb8..0ab52bfc4939b 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ListOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/ListOfTConverter.cs -@@ -10,7 +10,7 @@ internal sealed class ListOfTConverter - : IEnumerableDefaultConverter - where TCollection: List - { -- protected override void Add(in TElement value, scoped ref ReadStack state) -+ protected override void Add(in TElement value, ref ReadStack state) - { - ((TCollection)state.Current.ReturnValue!).Add(value); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/QueueOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/QueueOfTConverter.cs -index d0f95108cebd6..5c02525afa980 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/QueueOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/QueueOfTConverter.cs -@@ -9,7 +9,7 @@ internal sealed class QueueOfTConverter - : IEnumerableDefaultConverter - where TCollection : Queue - { -- protected override void Add(in TElement value, scoped ref ReadStack state) -+ protected override void Add(in TElement value, ref ReadStack state) - { - ((TCollection)state.Current.ReturnValue!).Enqueue(value); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/StackOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/StackOfTConverter.cs -index 429071bc2858d..87e7369cee5b4 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/StackOfTConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/StackOfTConverter.cs -@@ -10,7 +10,7 @@ internal sealed class StackOfTConverter - : IEnumerableDefaultConverter - where TCollection : Stack - { -- protected override void Add(in TElement value, scoped ref ReadStack state) -+ protected override void Add(in TElement value, ref ReadStack state) - { - ((TCollection)state.Current.ReturnValue!).Push(value); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/StackOrQueueConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/StackOrQueueConverter.cs -index 410975df09bef..f291a263f3b9e 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/StackOrQueueConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/StackOrQueueConverter.cs -@@ -11,7 +11,7 @@ internal class StackOrQueueConverter - : JsonCollectionConverter - where TCollection : IEnumerable - { -- protected sealed override void Add(in object? value, scoped ref ReadStack state) -+ protected sealed override void Add(in object? value, ref ReadStack state) - { - var addMethodDelegate = ((Action?)state.Current.JsonTypeInfo.AddMethodDelegate); - Debug.Assert(addMethodDelegate != null); -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpListConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpListConverter.cs -index ae424affe9082..0cd7ccb1a3020 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpListConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpListConverter.cs -@@ -20,7 +20,7 @@ public FSharpListConverter() - _listConstructor = FSharpCoreReflectionProxy.Instance.CreateFSharpListConstructor(); - } - -- protected override void Add(in TElement value, scoped ref ReadStack state) -+ protected override void Add(in TElement value, ref ReadStack state) - { - ((List)state.Current.ReturnValue!).Add(value); - } -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpSetConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpSetConverter.cs -index 5993b7830ba93..167534d8de3f7 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpSetConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/FSharp/FSharpSetConverter.cs -@@ -20,7 +20,7 @@ public FSharpSetConverter() - _setConstructor = FSharpCoreReflectionProxy.Instance.CreateFSharpSetConstructor(); - } - -- protected override void Add(in TElement value, scoped ref ReadStack state) -+ protected override void Add(in TElement value, ref ReadStack state) - { - ((List)state.Current.ReturnValue!).Add(value); - } - -From 65818d01f0690f612b0661d512c3acfa8610aa2f Mon Sep 17 00:00:00 2001 -From: Charles Stoner <10732005+cston@users.noreply.github.com> -Date: Thu, 11 Aug 2022 11:23:40 -0700 -Subject: [PATCH 5/5] Remove unnecessary 'scoped' - ---- - .../Object/ObjectWithParameterizedConstructorConverter.Large.cs | 2 +- - .../Object/ObjectWithParameterizedConstructorConverter.Small.cs | 2 +- - .../Object/ObjectWithParameterizedConstructorConverter.cs | 2 +- - .../Serialization/JsonSerializer.Read.HandlePropertyName.cs | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Large.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Large.cs -index 1059bd1ef3971..938d2a9605699 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Large.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Large.cs -@@ -51,7 +51,7 @@ protected sealed override object CreateObject(ref ReadStackFrame frame) - return obj; - } - -- protected sealed override void InitializeConstructorArgumentCaches(scoped ref ReadStack state, JsonSerializerOptions options) -+ protected sealed override void InitializeConstructorArgumentCaches(ref ReadStack state, JsonSerializerOptions options) - { - JsonTypeInfo typeInfo = state.Current.JsonTypeInfo; - -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Small.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Small.cs -index 1c7314b1b5960..3c7fd1a7c27f6 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Small.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.Small.cs -@@ -79,7 +79,7 @@ protected override object CreateObject(ref ReadStackFrame frame) - return success; - } - -- protected override void InitializeConstructorArgumentCaches(scoped ref ReadStack state, JsonSerializerOptions options) -+ protected override void InitializeConstructorArgumentCaches(ref ReadStack state, JsonSerializerOptions options) - { - JsonTypeInfo typeInfo = state.Current.JsonTypeInfo; - -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.cs -index cb501ff8aa307..74137c578c7e8 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectWithParameterizedConstructorConverter.cs -@@ -246,7 +246,7 @@ internal sealed override bool OnTryRead(ref Utf8JsonReader reader, Type typeToCo - return true; - } - -- protected abstract void InitializeConstructorArgumentCaches(scoped ref ReadStack state, JsonSerializerOptions options); -+ protected abstract void InitializeConstructorArgumentCaches(ref ReadStack state, JsonSerializerOptions options); - - protected abstract bool ReadAndCacheConstructorArgument(scoped ref ReadStack state, ref Utf8JsonReader reader, JsonParameterInfo jsonParameterInfo); - -diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandlePropertyName.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandlePropertyName.cs -index b44461f661167..e88a52dd52ba7 100644 ---- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandlePropertyName.cs -+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandlePropertyName.cs -@@ -19,7 +19,7 @@ public static partial class JsonSerializer - internal static JsonPropertyInfo LookupProperty( - object? obj, - ReadOnlySpan unescapedPropertyName, -- scoped ref ReadStack state, -+ ref ReadStack state, - JsonSerializerOptions options, - out bool useExtensionProperty, - bool createExtensionProperty = true) diff --git a/src/SourceBuild/tarball/patches/runtime/0005-More-update-for-recent-compiler-changes-for-ref-fields.patch b/src/SourceBuild/tarball/patches/runtime/0005-More-update-for-recent-compiler-changes-for-ref-fields.patch deleted file mode 100644 index ca5e4ac53..000000000 --- a/src/SourceBuild/tarball/patches/runtime/0005-More-update-for-recent-compiler-changes-for-ref-fields.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 67062893af45f36d9b4ed1d0a46dca64aa427f7c Mon Sep 17 00:00:00 2001 -From: Charles Stoner <10732005+cston@users.noreply.github.com> -Date: Fri, 12 Aug 2022 20:34:14 -0700 -Subject: [PATCH 1/2] Add scoped - -Original PR is https://github.com/dotnet/runtime/pull/73883. - ---- - .../Runtime.Base/src/System/Runtime/ExceptionHandling.cs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ExceptionHandling.cs b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ExceptionHandling.cs -index 9e576853a44cb..81242191d1aab 100644 ---- a/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ExceptionHandling.cs -+++ b/src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ExceptionHandling.cs -@@ -588,7 +588,7 @@ public static void RhRethrow(ref ExInfo activeExInfo, ref ExInfo exInfo) - FallbackFailFast(RhFailFastReason.InternalError, null); - } - -- private static void DispatchEx(ref StackFrameIterator frameIter, ref ExInfo exInfo, uint startIdx) -+ private static void DispatchEx(scoped ref StackFrameIterator frameIter, ref ExInfo exInfo, uint startIdx) - { - Debug.Assert(exInfo._passNumber == 1, "expected asm throw routine to set the pass"); - object exceptionObj = exInfo.ThrownException; - -From 86f07e350629aacf17db6b3f539eca214579a479 Mon Sep 17 00:00:00 2001 -From: Charles Stoner <10732005+cston@users.noreply.github.com> -Date: Fri, 12 Aug 2022 20:49:01 -0700 -Subject: [PATCH 2/2] More scoped - ---- - .../tests/System.Text.Json.Tests/JsonDocumentTests.cs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonDocumentTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonDocumentTests.cs -index 45590069c094f..cc3d827ca729f 100644 ---- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonDocumentTests.cs -+++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonDocumentTests.cs -@@ -3611,7 +3611,7 @@ public static void NameEquals_Empty_Throws() - out Utf8JsonReader reader, - ReadOnlyMemory data, - int segmentCount, -- in JsonReaderState state, -+ scoped in JsonReaderState state, - bool isFinalBlock = false) - { - if (segmentCount == 0) diff --git a/src/SourceBuild/tarball/patches/xdt/0001-Also-build-for-netstandard2.0-to-support-NuGet.patch b/src/SourceBuild/tarball/patches/xdt/0001-Also-build-for-netstandard2.0-to-support-NuGet.patch deleted file mode 100644 index 7a2a1e2b0..000000000 --- a/src/SourceBuild/tarball/patches/xdt/0001-Also-build-for-netstandard2.0-to-support-NuGet.patch +++ /dev/null @@ -1,26 +0,0 @@ -From e5fa6b10f5e4bcb14e3930e4eeae7181765529ee Mon Sep 17 00:00:00 2001 -From: Chris Rummel -Date: Thu, 21 Oct 2021 16:29:32 -0500 -Subject: [PATCH] Also build for netstandard2.0 to support NuGet. - -Backport: https://github.com/dotnet/source-build/issues/2557. ---- - .../Microsoft.Web.XmlTransform.csproj | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/Microsoft.Web.XmlTransform/Microsoft.Web.XmlTransform.csproj b/src/Microsoft.Web.XmlTransform/Microsoft.Web.XmlTransform.csproj -index 7cb81d1..f272d7f 100644 ---- a/src/Microsoft.Web.XmlTransform/Microsoft.Web.XmlTransform.csproj -+++ b/src/Microsoft.Web.XmlTransform/Microsoft.Web.XmlTransform.csproj -@@ -3,7 +3,7 @@ - - - -- netstandard2.1 -+ netstandard2.0;netstandard2.1 - AnyCPU - true - false --- -2.31.1 -