Version 2.1.1-dev.3.0

* Cherry-pick 3cb16d20e7810a2a378bb897d939f67c0b380d88 to dev
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 910c41c..f5f621a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 2.1.1-dev.3.0
+
+* Cherry-pick 3cb16d20e7810a2a378bb897d939f67c0b380d88 to dev
+
 ## 2.1.1-dev.2.0
 
 ### Core library changes
diff --git a/pkg/analyzer/lib/src/dart/analysis/file_state.dart b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
index eb87535..e9526b0 100644
--- a/pkg/analyzer/lib/src/dart/analysis/file_state.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
@@ -510,6 +510,15 @@
     //   Flush exported top-level declarations of all files.
     if (apiSignatureChanged) {
       _libraryCycle?.invalidate();
+
+      // If this is a part, invalidate the libraries.
+      var libraries = _fsState._partToLibraries[this];
+      if (libraries != null) {
+        for (var library in libraries) {
+          library.libraryCycle?.invalidate();
+        }
+      }
+
       for (FileState file in _fsState._uriToFile.values) {
         file._exportedTopLevelDeclarations = null;
       }
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
index aef3c08..0970f26 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
@@ -2781,6 +2781,32 @@
     expect(_getTopLevelVarType(result.unit, 'b'), 'B');
   }
 
+  test_part_getResult_changePart_invalidatesLibraryCycle() async {
+    var a = convertPath('/test/lib/a.dart');
+    var b = convertPath('/test/lib/b.dart');
+    newFile(a, content: r'''
+import 'dart:async';
+part 'b.dart';
+''');
+    driver.addFile(a);
+
+    // Analyze the library without the part.
+    await driver.getResult(a);
+
+    // Create the part file.
+    // This should invalidate library file state (specifically the library
+    // cycle), so that we can re-link the library, and get new dependencies.
+    newFile(b, content: r'''
+part of 'a.dart';
+Future<int> f;
+''');
+    driver.changeFile(b);
+
+    // This should not crash.
+    var result = await driver.getResult(b);
+    expect(result.errors, isEmpty);
+  }
+
   test_part_getResult_noLibrary() async {
     var c = convertPath('/test/lib/c.dart');
     newFile(c, content: r'''
diff --git a/tools/VERSION b/tools/VERSION
index 9e72048..3457917 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 2
 MINOR 1
 PATCH 1
-PRERELEASE 2
+PRERELEASE 3
 PRERELEASE_PATCH 0