Strange error raises when building SwiftPM

This error raised when I was trying to build SwiftPM locally on my Windows machine:

...
D:\workspace\repos\github.com\apple\swift-package-manager\Sources\PackageGraph\Resolution\PubGrub\PubGrubDependencyResolver.swift:615:22: error: referencing operator function '+=' on 'RangeReplaceableCollection' requires that 'OrderedSet<Term>' conform to 'RangeReplaceableCollection'
            newTerms += priorCause.terms.filter { $0.node != _mostRecentSatisfier.term.node }
                     ^
Swift.RangeReplaceableCollection:1:11: note: where 'Self' = 'OrderedSet<Term>'
extension RangeReplaceableCollection {
          ^
D:\workspace\repos\github.com\apple\swift-package-manager\Sources\PackageGraph\Resolution\PubGrub\PubGrubDependencyResolver.swift:615:22: error: referencing operator function '+=' on 'RangeReplaceableCollection' requires that 'OrderedSet<Term>' conform to 'RangeReplaceableCollection'
            newTerms += priorCause.terms.filter { $0.node != _mostRecentSatisfier.term.node }
                     ^
Swift.RangeReplaceableCollection:1:11: note: where 'Self' = 'OrderedSet<Term>'
extension RangeReplaceableCollection {
          ^
error: fatalError

I was using the latest Swift 5.10 RELEASE on Windows, building SwiftPM main branch (b49a22787). I couldn't find any posts/pages talking about such situation and it is so strange to have this error.

Are you using the PowerShell script to build the entire trunk toolchain or just building the trunk SwiftPM package alone with a 5.10 toolchain using swift build? I have never built Swift on Windows and do not recognize that error, but trunk SwiftPM is only ever built on the CI with a trunk Swift compiler, so it is possible it is using newer features not in Swift 5.10.

I was building trunk SwiftPM using swift build with the 5.10 toolchain. I was working with one downstream repo so the PowerShell script is a bit overhead to me.

trunk SwiftPM is only ever built on the CI with a trunk Swift compiler, so it is possible it is using newer features not in Swift 5.10.

Thanks for the hint, I was able to build it by switching to a more recent nightly build toolchain. I assumed that it should be able to do it with the latest release which is not actually feasible. There must be newer features in the codebase.