Fine. Remove library self-dependency from 'instances'.

We already re-compute the library element when its API signature
changes, and re-analyze the library when any of its files changes.

Change-Id: I400096d7a94a8d3c12866c36994e6f2f324bf614
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430980
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analyzer/lib/src/fine/requirements.dart b/pkg/analyzer/lib/src/fine/requirements.dart
index 8f9d816..b50d8b0 100644
--- a/pkg/analyzer/lib/src/fine/requirements.dart
+++ b/pkg/analyzer/lib/src/fine/requirements.dart
@@ -791,9 +791,7 @@
 
     for (var libUri in bundleLibraryUriList) {
       topLevels.remove(libUri);
-    }
-
-    for (var libUri in bundleLibraryUriList) {
+      instances.remove(libUri);
       interfaces.remove(libUri);
     }
   }
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
index 946fc22..4d63fc5 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
@@ -6656,10 +6656,6 @@
     instances
       package:test/a.dart
         A
-      package:test/test.dart
-        B
-          requestedMethods
-            noSuchMethod: <null>
     interfaces
       package:test/a.dart
         A
@@ -6738,10 +6734,6 @@
     instances
       package:test/a.dart
         A
-      package:test/test.dart
-        B
-          requestedMethods
-            noSuchMethod: <null>
     interfaces
       package:test/a.dart
         A
@@ -8740,16 +8732,6 @@
     topLevels
       dart:core
         int: #M5
-    instances
-      package:test/test.dart
-        A
-          requestedFields
-            _foo: #M1
-          requestedMethods
-            noSuchMethod: <null>
-        B
-          requestedMethods
-            noSuchMethod: <null>
 [status] idle
 ''',
       updateFiles: () {
@@ -8799,16 +8781,6 @@
     topLevels
       dart:core
         String: #M8
-    instances
-      package:test/test.dart
-        A
-          requestedFields
-            _foo: #M6
-          requestedMethods
-            noSuchMethod: <null>
-        B
-          requestedMethods
-            noSuchMethod: <null>
 [status] idle
 ''',
     );
@@ -10425,15 +10397,6 @@
     topLevels
       dart:core
         int: #M4
-    instances
-      package:test/test.dart
-        A
-          requestedMethods
-            noSuchMethod: <null>
-          allDeclaredMethods: #M1
-        B
-          requestedMethods
-            noSuchMethod: <null>
 [status] idle
 ''',
       updateFiles: () {
@@ -10481,15 +10444,6 @@
     topLevels
       dart:core
         String: #M6
-    instances
-      package:test/test.dart
-        A
-          requestedMethods
-            noSuchMethod: <null>
-          allDeclaredMethods: #M5
-        B
-          requestedMethods
-            noSuchMethod: <null>
 [status] idle
 ''',
     );
@@ -10548,15 +10502,6 @@
     topLevels
       dart:core
         int: #M4
-    instances
-      package:test/test.dart
-        A
-          requestedMethods
-            noSuchMethod: <null>
-          allDeclaredMethods: #M1
-        B
-          requestedMethods
-            noSuchMethod: <null>
 [status] idle
 ''',
       updateFiles: () {
@@ -10602,15 +10547,6 @@
     topLevels
       dart:core
         double: #M6
-    instances
-      package:test/test.dart
-        A
-          requestedMethods
-            noSuchMethod: <null>
-          allDeclaredMethods: #M5
-        B
-          requestedMethods
-            noSuchMethod: <null>
 [status] idle
 ''',
     );
@@ -10680,12 +10616,6 @@
         B: <null>
       package:test/a.dart
         B: #M0
-    instances
-      package:test/test.dart
-        A
-          requestedMethods
-            noSuchMethod: <null>
-          allDeclaredMethods: #M2
 [status] idle
 ''',
       updateFiles: () {
@@ -10746,14 +10676,6 @@
             _foo: <null>
           requestedMethods
             _foo: <null>
-      package:test/test.dart
-        A
-          requestedGetters
-            _foo: <null>
-          requestedMethods
-            _foo: <null>
-            noSuchMethod: <null>
-          allDeclaredMethods: #M4
 [status] idle
 ''',
     );
@@ -11779,16 +11701,6 @@
     topLevels
       dart:core
         int: #M5
-    instances
-      package:test/test.dart
-        A
-          requestedFields
-            _foo: #M1
-          requestedMethods
-            noSuchMethod: <null>
-        B
-          requestedMethods
-            noSuchMethod: <null>
 [status] idle
 ''',
       updateFiles: () {
@@ -11838,16 +11750,6 @@
     topLevels
       dart:core
         String: #M8
-    instances
-      package:test/test.dart
-        A
-          requestedFields
-            _foo: #M6
-          requestedMethods
-            noSuchMethod: <null>
-        B
-          requestedMethods
-            noSuchMethod: <null>
 [status] idle
 ''',
     );