Change the default visibility for packages to //visibility:private
and then change individual build rules back to their prior visibility.

The motivation for this change is making sure future additions are
private by default so that new rules are not accidentally public.

Some of the rules that are currently public were not meant to be, and
the fact that they are marked public does not mean they should be
used. As always, the rule is never spell out anything with the word
internal (or any synonym for internal). Some of these accidentally
public rules will be manually corrected with future changes.

PiperOrigin-RevId: 940610526
Change-Id: Ia8ca7e432d6310f44cd11d3eae8ca34c8edf4efe
diff --git a/absl/hash/BUILD.bazel b/absl/hash/BUILD.bazel
index a2d3a02..9f12e9a 100644
--- a/absl/hash/BUILD.bazel
+++ b/absl/hash/BUILD.bazel
@@ -25,7 +25,7 @@
 )
 
 package(
-    default_visibility = ["//visibility:public"],
+    default_visibility = ["//visibility:private"],
     features = [
         "header_modules",
         "layering_check",
@@ -44,6 +44,7 @@
     hdrs = ["hash.h"],
     copts = ABSL_DEFAULT_COPTS,
     linkopts = ABSL_DEFAULT_LINKOPTS,
+    visibility = ["//visibility:public"],
     deps = [
         ":city",
         ":weakly_mixed_integer",
@@ -68,6 +69,7 @@
     testonly = True,
     hdrs = ["hash_testing.h"],
     linkopts = ABSL_DEFAULT_LINKOPTS,
+    visibility = ["//visibility:public"],
     deps = [
         ":spy_hash_state",
         "//absl/meta:type_traits",
@@ -168,6 +170,9 @@
     ],
     copts = ABSL_DEFAULT_COPTS,
     linkopts = ABSL_DEFAULT_LINKOPTS,
+    visibility = [
+        "//absl/hash:__pkg__",
+    ],
     deps = [
         "//absl/base:config",
         "//absl/base:core_headers",