bazel packages: delete NativeProvider, dematerialize StructImpl.provider

This change merges NativeProvider into BuiltinProvider. The two
classes were almost identical.

Also, it removes the StructImpl.provider
field to save one word of space in each instance of NativeInfo.
This requires each subclass to define getProvider,
which is straightforward but leads to a tiresome diff.
(Sadly this doesn't yield tangible space savings; I'm not sure why.)

All the interesting changes are in lib.packages. The rest is repetitive.

This is a small step towards withering StructImpl and StructApi
out of existence.

NO_IFTTT=spurious warning
PiperOrigin-RevId: 341102857
diff --git a/src/main/java/com/google/devtools/build/lib/packages/Info.java b/src/main/java/com/google/devtools/build/lib/packages/Info.java
index 2d013b2..5eb2527 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/Info.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/Info.java
@@ -23,6 +23,34 @@
  * values, each keyed by its Provider. Every Info is an instance of a Provider: if a Provider is
  * like a Java class, then an Info is like an instance of that class.
  */
+// TODO(adonovan): simplify the hierarchies below in these steps:
+// - Once to_{json,proto} are gone, StructApi can be deleted; structs should never again have
+//   methods.
+// - StructImpl.location can be pushed down into subclasses that need it, much as we did for
+//   StructImpl.provider in this CL.
+// - getErrorMessageFormatForUnknownField can become a method on provider.
+//   It should compute a string from a parameter, not use higher-order formatting.
+// - StructImpl is then really just a collection of helper functions for subclasses
+//   getValue(String, Class), repr, equals, hash. Move them, and merge it into Info interface.
+// - Move StructProvider.STRUCT and make StructProvider private.
+//   The StructProvider.createStruct method could be a simple function like depset, select.
+//   StructProviderApi could be eliminated.
+// - eliminate StarlarkInfo + StarlarkInfo.
+// - NativeInfo's two methods can (IIUC) be deleted immediately, and then NativeInfo itself.
+//
+// Info (result of analysis)
+// - StructImpl (structure with fields, to_{json,proto}). Implements Structure, StructApi.
+//   - OutputGroupInfo. Fields are output group names.
+//   - NativeInfo. Fields are Java annotated methods (tricky).
+//     - dozens of subclasses
+//   - StarlarkInfo. Has table of k/v pairs. Final. Supports x+y.
+//
+// Provider (key for analysis result Info; class symbol for StructImpls). Implements ProviderApi.
+// - BuiltinProvider
+//   - StructProvider (for basic 'struct' values). Callable. Implements ProviderApi.
+//   - dozens of singleton subclasses
+// - StarlarkProvider. Callable.
+//
 public interface Info extends StarlarkValue {
 
   /** Returns the provider that instantiated this Info. */