diff --git a/core/modules/user/src/UserAutocomplete.php b/core/modules/user/src/UserAutocomplete.php
index c831c78..cb75d5b 100644
--- a/core/modules/user/src/UserAutocomplete.php
+++ b/core/modules/user/src/UserAutocomplete.php
@@ -9,7 +9,6 @@
 
 use Drupal\Component\Utility\String;
 use Drupal\Core\Config\ConfigFactoryInterface;
-use Drupal\Core\Database\Connection;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\Query\QueryFactory;
 
@@ -19,13 +18,6 @@
 class UserAutocomplete {
 
   /**
-   * The database connection to query for the user names.
-   *
-   * @var \Drupal\Core\Database\Connection
-   */
-  protected $connection;
-
-  /**
    * The config factory to get the anonymous user name.
    *
    * @var \Drupal\Core\Config\ConfigFactoryInterface
@@ -49,13 +41,14 @@ class UserAutocomplete {
   /**
    * Constructs a UserAutocomplete object.
    *
-   * @param \Drupal\Core\Database\Connection $connection
-   *   The database connection to query for the user names.
    * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
    *   The config factory.
+   * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
+   *   The entity manager.
+   * @param \Drupal\Core\Entity\Query\QueryFactory $entity_query
+   *   The entity query factory.
    */
-  public function __construct(Connection $connection, ConfigFactoryInterface $config_factory, EntityManagerInterface $entity_manager, QueryFactory $entity_query) {
-    $this->connection = $connection;
+  public function __construct(ConfigFactoryInterface $config_factory, EntityManagerInterface $entity_manager, QueryFactory $entity_query) {
     $this->configFactory = $config_factory;
     $this->entityQuery = $entity_query;
     $this->entityManager = $entity_manager;
diff --git a/core/modules/user/user.services.yml b/core/modules/user/user.services.yml
index c4e3439..c703c0b 100644
--- a/core/modules/user/user.services.yml
+++ b/core/modules/user/user.services.yml
@@ -35,7 +35,7 @@ services:
     arguments: ['@database']
   user.autocomplete:
     class: Drupal\user\UserAutocomplete
-    arguments: ['@database', '@config.factory', '@entity.manager', '@entity.query']
+    arguments: ['@config.factory', '@entity.manager', '@entity.query']
   user_maintenance_mode_subscriber:
     class: Drupal\user\EventSubscriber\MaintenanceModeSubscriber
     arguments: ['@maintenance_mode', '@current_user']
