cue/load: do not panic when load.Instances(args, nil) fails very early
The function wouldn't initialize a nil config until later on,
and Config.newErrInstance assumed that the receiver was never nil.
Note that newErrInstance is already OK with any of its fields being nil,
such as the Context, which we only initialize later on in Instances.
That's fine, and does not need any adjustment.
We also don't move Config.complete further up in Instances,
again because it's unnecessary, but also to keep the same order
of which checks are done in which order to report errors to the user.
Fixes #4286.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I262cfc9e5def463789af4e8a291060d3d79bf75e
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1232122
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Matthew Sackman <matthew@cue.works>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>