pw_span: Remove pw_polyfill dependency

This dependency was added back when the type needed to support more
limited constexpr semantics for C++11 and/or C++14. Those language
versions are no longer targeted, and so the header is now just hanging
around as a ghost.

Note that compatibility_test.cc still depends on pw_polyfill. As a
result, I've added the relevant dependency for the module that builds
that test.

Also, pw_varint/varint.h was naughty and depended on pw_polyfill
transitively through pw_span, so I also have had to fix it.

Change-Id: I1f7817a331937b06e06e677e165977f002d62cfa
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/124873
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Anqi Dong <anqid@google.com>
diff --git a/pw_span/Android.bp b/pw_span/Android.bp
index d6f09ca..10f9db8 100644
--- a/pw_span/Android.bp
+++ b/pw_span/Android.bp
@@ -21,8 +21,6 @@
     vendor_available: true,
     cpp_std: "c++2a",
     export_include_dirs: ["public"],
-    header_libs: [
-        "pw_polyfill_headers",
-    ],
+    header_libs: [],
     host_supported: true,
 }
diff --git a/pw_span/BUILD.bazel b/pw_span/BUILD.bazel
index 5b4eeee..ec57864 100644
--- a/pw_span/BUILD.bazel
+++ b/pw_span/BUILD.bazel
@@ -32,7 +32,6 @@
     includes = ["public"],
     deps = [
         # TODO(b/243851191): Depending on pw_assert causes a dependency cycle.
-        "//pw_polyfill",
     ],
 )
 
@@ -41,6 +40,7 @@
     srcs = ["span_test.cc"],
     deps = [
         ":pw_span",
+        "//pw_polyfill",
         "//pw_unit_test",
     ],
 )
@@ -48,5 +48,8 @@
 pw_cc_test(
     name = "compatibility_test",
     srcs = ["compatibility_test.cc"],
-    deps = [":pw_span"],
+    deps = [
+        ":pw_span",
+        "//pw_polyfill",
+    ],
 )
diff --git a/pw_span/BUILD.gn b/pw_span/BUILD.gn
index 1f667ec..91e294c 100644
--- a/pw_span/BUILD.gn
+++ b/pw_span/BUILD.gn
@@ -70,10 +70,7 @@
 pw_source_set("pw_span") {
   public_configs = [ ":public_config" ]
   public = [ "public/pw_span/span.h" ]
-  public_deps = [
-    ":config",
-    dir_pw_polyfill,
-  ]
+  public_deps = [ ":config" ]
 
   # Polyfill <cstddef> (std::byte) and <iterator> (std::size(), std::data) if
   # C++17 is not supported.
@@ -100,7 +97,10 @@
 }
 
 pw_test("pw_span_test") {
-  deps = [ ":pw_span" ]
+  deps = [
+    ":pw_span",
+    dir_pw_polyfill,
+  ]
   remove_configs = [ "$dir_pw_build:extra_strict_warnings" ]
   sources = [ "span_test.cc" ]
 }
diff --git a/pw_span/CMakeLists.txt b/pw_span/CMakeLists.txt
index 4f7475b..63cffd2 100644
--- a/pw_span/CMakeLists.txt
+++ b/pw_span/CMakeLists.txt
@@ -24,7 +24,6 @@
     public
   PUBLIC_DEPS
     pw_assert
-    pw_polyfill
     pw_polyfill.standard_library
 )
 
@@ -32,6 +31,7 @@
   SOURCES
     span_test.cc
   PRIVATE_DEPS
+    pw_polyfill
     pw_span
   GROUPS
     modules
diff --git a/pw_span/public/pw_span/internal/span_impl.h b/pw_span/public/pw_span/internal/span_impl.h
index 3918bba..43c3d8c 100644
--- a/pw_span/public/pw_span/internal/span_impl.h
+++ b/pw_span/public/pw_span/internal/span_impl.h
@@ -42,7 +42,6 @@
 #include <type_traits>
 #include <utility>
 
-#include "pw_polyfill/language_feature_macros.h"
 #include "pw_span/internal/config.h"
 
 #if PW_SPAN_ENABLE_ASSERTS
diff --git a/pw_varint/BUILD.gn b/pw_varint/BUILD.gn
index 03f4c57..ae545d6 100644
--- a/pw_varint/BUILD.gn
+++ b/pw_varint/BUILD.gn
@@ -25,6 +25,7 @@
 pw_source_set("pw_varint") {
   public_configs = [ ":default_config" ]
   public_deps = [
+    dir_pw_polyfill,
     dir_pw_preprocessor,
     dir_pw_span,
   ]
diff --git a/pw_varint/CMakeLists.txt b/pw_varint/CMakeLists.txt
index 53ae421..74b495d 100644
--- a/pw_varint/CMakeLists.txt
+++ b/pw_varint/CMakeLists.txt
@@ -20,6 +20,7 @@
   PUBLIC_INCLUDES
     public
   PUBLIC_DEPS
+    pw_polyfill
     pw_preprocessor
     pw_span
   SOURCES