For #37438
Change-Id: Icb28035ae4027aa09d8959d4ac2f4b94a6c843a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/266339
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Bryan C. Mills <bcmills@google.com>
                }
                node.required = required
                for _, r := range node.required {
-                       work.Add(r)
+                       if r.Version != "none" {
+                               work.Add(r)
+                       }
                }
 
                if upgrade != nil {
                n := modGraph[module.Version{Path: path, Version: vers}]
                required := n.required
                for _, r := range required {
+                       if r.Version == "none" {
+                               continue
+                       }
                        v := min[r.Path]
                        if r.Path != target.Path && reqs.Max(v, r.Version) != v {
                                panic(fmt.Sprintf("mistake: version %q does not satisfy requirement %+v", v, r)) // TODO: Don't panic.
 
 X1: I1
 X2: 
 req M: A1 B1
+
+name: reqnone
+M: Anone B1 D1 E1
+B1: Cnone D1
+E1: Fnone
+build M: M B1 D1 E1
+req M: B1 E1
 `
 
 func Test(t *testing.T) {