You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gopls/internal/lsp/source: fix crash in definitions of builtins
Definition queries on built-ins should report the pseudo-package
"builtin", and queries on unsafe.Pointer et al should report
the real (if irregular) package "unsafe". This CL fixes a bug
wherein the latter was crashing. The solution required synthesizing
Metadata("unsafe").GoFiles=["unsafe/unsafe.go"] from the filename
in builtins, because unfortunately go/packages discards it.
Also, references queries of builtins and unsafe.Pointer should be
rejected with a clear error.
The symbol tests were tweaked to handle the new matches in
the unsafe package. Better ideas welcome.
Fixesgolang/go#43058
Change-Id: I9d7cd7ffcb679d77f9859e39b240a8eb605a267b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/491036
TryBot-Result: Gopher Robot <[email protected]>
Run-TryBot: Alan Donovan <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
0 commit comments