diff --git a/core/core.api.php b/core/core.api.php
index 3b07651..04ceec9 100644
--- a/core/core.api.php
+++ b/core/core.api.php
@@ -2465,7 +2465,7 @@ function hook_validation_constraint_alter(array &$definitions) {
  * @code
  * array('#type' => 'status_messages')
  * @endcode
- * to a render array, use drupal_render() to render it, and add a command to
+ * to a render array, use \Drupal::service() to render it, and add a command to
  * place the messages in an appropriate location.
  *
  * @section sec_other Other methods for triggering Ajax
diff --git a/core/includes/common.inc b/core/includes/common.inc
index 53e0be5..69f8fe9 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -772,7 +772,7 @@ function drupal_pre_render_link($element) {
  *
  * The purpose of this is to allow links to be logically grouped into related
  * categories, so that each child group can be rendered as its own list of
- * links if drupal_render() is called on it, but calling drupal_render() on the
+ * links if \Drupal::service() is called on it, but calling \Drupal::service() on the
  * parent element will still produce a single list containing all the remaining
  * links, regardless of what group they were in.
  *
@@ -899,7 +899,7 @@ function drupal_render(&$elements, $is_recursive_call = FALSE) {
  *   rendering when possible or loop through the elements and render them as
  *   they are available.
  *
- * @see drupal_render()
+ * @see \Drupal::service()
  * @see https://www.drupal.org/node/2912757
  */
 function drupal_render_children(&$element, $children_keys = NULL) {
@@ -954,10 +954,10 @@ function render(&$element) {
 /**
  * Hides an element from later rendering.
  *
- * The first time render() or drupal_render() is called on an element tree,
+ * The first time render() or \Drupal::service() is called on an element tree,
  * as each element in the tree is rendered, it is marked with a #printed flag
  * and the rendered children of the element are cached. Subsequent calls to
- * render() or drupal_render() will not traverse the child tree of this element
+ * render() or \Drupal::service() will not traverse the child tree of this element
  * again: they will just use the cached children. So if you want to hide an
  * element, be sure to call hide() on the element before its parent tree is
  * rendered for the first time, as it will have no effect on subsequent
@@ -983,10 +983,10 @@ function hide(&$element) {
  * You can also use render($element), which shows the element while rendering
  * it.
  *
- * The first time render() or drupal_render() is called on an element tree,
+ * The first time render() or \Drupal::service() is called on an element tree,
  * as each element in the tree is rendered, it is marked with a #printed flag
  * and the rendered children of the element are cached. Subsequent calls to
- * render() or drupal_render() will not traverse the child tree of this element
+ * render() or \Drupal::service() will not traverse the child tree of this element
  * again: they will just use the cached children. So if you want to show an
  * element, be sure to call show() on the element before its parent tree is
  * rendered for the first time, as it will have no effect on subsequent
diff --git a/core/lib/Drupal/Core/Entity/Controller/EntityListController.php b/core/lib/Drupal/Core/Entity/Controller/EntityListController.php
index d8a1ea1..047e89f 100644
--- a/core/lib/Drupal/Core/Entity/Controller/EntityListController.php
+++ b/core/lib/Drupal/Core/Entity/Controller/EntityListController.php
@@ -16,7 +16,7 @@ class EntityListController extends ControllerBase {
    *   The entity type to render.
    *
    * @return array
-   *   A render array as expected by drupal_render().
+   *   A render array as expected by \Drupal::service().
    */
   public function listing($entity_type) {
     return $this->entityManager()->getListBuilder($entity_type)->render();
diff --git a/core/lib/Drupal/Core/Entity/Controller/EntityViewController.php b/core/lib/Drupal/Core/Entity/Controller/EntityViewController.php
index 983eec8..c864cac 100644
--- a/core/lib/Drupal/Core/Entity/Controller/EntityViewController.php
+++ b/core/lib/Drupal/Core/Entity/Controller/EntityViewController.php
@@ -88,7 +88,7 @@ public function buildTitle(array $page) {
    *   Defaults to 'full'.
    *
    * @return array
-   *   A render array as expected by drupal_render().
+   *   A render array as expected by \Drupal::service().
    */
   public function view(EntityInterface $_entity, $view_mode = 'full') {
     $page = $this->entityManager
diff --git a/core/lib/Drupal/Core/Entity/EntityListBuilderInterface.php b/core/lib/Drupal/Core/Entity/EntityListBuilderInterface.php
index bab9d97..fd885a6 100644
--- a/core/lib/Drupal/Core/Entity/EntityListBuilderInterface.php
+++ b/core/lib/Drupal/Core/Entity/EntityListBuilderInterface.php
@@ -47,7 +47,7 @@ public function getOperations(EntityInterface $entity);
    * Builds a listing of entities for the given entity type.
    *
    * @return array
-   *   A render array as expected by drupal_render().
+   *   A render array as expected by \Drupal::service().
    */
   public function render();
 
diff --git a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
index faeb147..fcd7131 100644
--- a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
+++ b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
@@ -213,7 +213,7 @@ protected function getBuildDefaults(EntityInterface $entity, $view_mode) {
    * @return array
    *   The updated renderable array.
    *
-   * @see drupal_render()
+   * @see \Drupal::service()
    */
   public function build(array $build) {
     $build_list = [$build];
@@ -227,7 +227,7 @@ public function build(array $build) {
    * This function is assigned as a #pre_render callback in ::viewMultiple().
    *
    * By delaying the building of an entity until the #pre_render processing in
-   * drupal_render(), the processing cost of assembling an entity's renderable
+   * \Drupal::service(), the processing cost of assembling an entity's renderable
    * array is saved on cache-hit requests.
    *
    * @param array $build_list
@@ -237,7 +237,7 @@ public function build(array $build) {
    * @return array
    *   The updated renderable array.
    *
-   * @see drupal_render()
+   * @see \Drupal::service()
    */
   public function buildMultiple(array $build_list) {
     // Build the view modes and display objects.
diff --git a/core/lib/Drupal/Core/Entity/entity.api.php b/core/lib/Drupal/Core/Entity/entity.api.php
index 2b893fd..0bb6d2c 100644
--- a/core/lib/Drupal/Core/Entity/entity.api.php
+++ b/core/lib/Drupal/Core/Entity/entity.api.php
@@ -1359,7 +1359,7 @@ function hook_ENTITY_TYPE_revision_delete(Drupal\Core\Entity\EntityInterface $en
  * @param &$build
  *   A renderable array representing the entity content. The module may add
  *   elements to $build prior to rendering. The structure of $build is a
- *   renderable array as expected by drupal_render().
+ *   renderable array as expected by \Drupal::service().
  * @param \Drupal\Core\Entity\EntityInterface $entity
  *   The entity object.
  * @param \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display
@@ -1391,7 +1391,7 @@ function hook_entity_view(array &$build, \Drupal\Core\Entity\EntityInterface $en
  * @param &$build
  *   A renderable array representing the entity content. The module may add
  *   elements to $build prior to rendering. The structure of $build is a
- *   renderable array as expected by drupal_render().
+ *   renderable array as expected by \Drupal::service().
  * @param \Drupal\Core\Entity\EntityInterface $entity
  *   The entity object.
  * @param \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display
@@ -1430,7 +1430,7 @@ function hook_ENTITY_TYPE_view(array &$build, \Drupal\Core\Entity\EntityInterfac
  * the particular entity type template, if there is one (e.g., node.html.twig).
  *
  * See the @link themeable Default theme implementations topic @endlink and
- * drupal_render() for details.
+ * \Drupal::service() for details.
  *
  * @param array &$build
  *   A renderable array representing the entity content.
@@ -1468,7 +1468,7 @@ function hook_entity_view_alter(array &$build, Drupal\Core\Entity\EntityInterfac
  * the particular entity type template, if there is one (e.g., node.html.twig).
  *
  * See the @link themeable Default theme implementations topic @endlink and
- * drupal_render() for details.
+ * \Drupal::service() for details.
  *
  * @param array &$build
  *   A renderable array representing the entity content.
@@ -1554,7 +1554,7 @@ function hook_entity_view_mode_alter(&$view_mode, Drupal\Core\Entity\EntityInter
 }
 
 /**
- * Alter entity renderable values before cache checking in drupal_render().
+ * Alter entity renderable values before cache checking in \Drupal::service().
  *
  * Invoked for a specific entity type.
  *
@@ -1569,7 +1569,7 @@ function hook_entity_view_mode_alter(&$view_mode, Drupal\Core\Entity\EntityInter
  * @param string $view_mode
  *   The view_mode that is to be used to display the entity.
  *
- * @see drupal_render()
+ * @see \Drupal::service()
  * @see \Drupal\Core\Entity\EntityViewBuilder
  * @see hook_entity_build_defaults_alter()
  *
@@ -1580,7 +1580,7 @@ function hook_ENTITY_TYPE_build_defaults_alter(array &$build, \Drupal\Core\Entit
 }
 
 /**
- * Alter entity renderable values before cache checking in drupal_render().
+ * Alter entity renderable values before cache checking in \Drupal::service().
  *
  * The values in the #cache key of the renderable array are used to determine if
  * a cache entry exists for the entity's rendered output. Ideally only values
@@ -1593,7 +1593,7 @@ function hook_ENTITY_TYPE_build_defaults_alter(array &$build, \Drupal\Core\Entit
  * @param string $view_mode
  *   The view_mode that is to be used to display the entity.
  *
- * @see drupal_render()
+ * @see \Drupal::service()
  * @see \Drupal\Core\Entity\EntityViewBuilder
  * @see hook_ENTITY_TYPE_build_defaults_alter()
  *
diff --git a/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php
index 75ea5fd..db8c69d 100644
--- a/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php
@@ -17,7 +17,7 @@
 /**
  * Subscriber that wraps controllers, to handle early rendering.
  *
- * When controllers call drupal_render() (RendererInterface::render()) outside
+ * When controllers call \Drupal::service() (RendererInterface::render()) outside
  * of a render context, we call that "early rendering". Controllers should
  * return only render arrays, but we cannot prevent controllers from doing early
  * rendering. The problem with early rendering is that the bubbleable metadata
@@ -36,7 +36,7 @@
  * ::renderPlain() methods. In that case, no bubbleable metadata is lost.
  *
  * If the render context is not empty, then the controller did use
- * drupal_render(), and bubbleable metadata was collected. This bubbleable
+ * \Drupal::service(), and bubbleable metadata was collected. This bubbleable
  * metadata is then merged onto the render array.
  *
  * In other words: this just exists to ease the transition to Drupal 8: it
@@ -124,7 +124,7 @@ protected function wrapControllerExecutionInRenderContext($controller, array $ar
     });
 
     // If early rendering happened, i.e. if code in the controller called
-    // drupal_render() outside of a render context, then the bubbleable metadata
+    // \Drupal::service() outside of a render context, then the bubbleable metadata
     // for that is stored in the current render context.
     if (!$context->isEmpty()) {
       /** @var \Drupal\Core\Render\BubbleableMetadata $early_rendering_bubbleable_metadata */
diff --git a/core/lib/Drupal/Core/Form/FormBuilderInterface.php b/core/lib/Drupal/Core/Form/FormBuilderInterface.php
index ca79437..1ef8f07 100644
--- a/core/lib/Drupal/Core/Form/FormBuilderInterface.php
+++ b/core/lib/Drupal/Core/Form/FormBuilderInterface.php
@@ -244,7 +244,7 @@ public function prepareForm($form_id, &$form, FormStateInterface &$form_state);
    * This is one of the three primary functions that recursively iterates a form
    * array. This one does it for completing the form building process. The other
    * two are self::doValidateForm() (invoked via self::validateForm() and used
-   * to invoke validation logic for each element) and drupal_render() (for
+   * to invoke validation logic for each element) and \Drupal::service() (for
    * rendering each element). Each of these three pipelines provides ample
    * opportunity for modules to customize what happens. For example, during this
    * function's life cycle, the following functions get called for each element:
@@ -268,7 +268,7 @@ public function prepareForm($form_id, &$form, FormStateInterface &$form_state);
    *   called in postorder traversal, meaning they are called for the child
    *   elements first, then for the parent element.
    * There are similar properties containing callback functions invoked by
-   * self::doValidateForm() and drupal_render(), appropriate for those
+   * self::doValidateForm() and \Drupal::service(), appropriate for those
    * operations.
    *
    * Developers are strongly encouraged to integrate the functionality needed by
diff --git a/core/lib/Drupal/Core/Menu/MenuLinkTree.php b/core/lib/Drupal/Core/Menu/MenuLinkTree.php
index 8a6dce8..2bbc21a 100644
--- a/core/lib/Drupal/Core/Menu/MenuLinkTree.php
+++ b/core/lib/Drupal/Core/Menu/MenuLinkTree.php
@@ -170,7 +170,7 @@ public function build(array $tree) {
     $tree_cacheability->applyTo($build);
 
     if ($items) {
-      // Make sure drupal_render() does not re-order the links.
+      // Make sure \Drupal::service() does not re-order the links.
       $build['#sorted'] = TRUE;
       // Get the menu name from the last link.
       $item = end($items);
diff --git a/core/lib/Drupal/Core/Render/Element.php b/core/lib/Drupal/Core/Render/Element.php
index e394a39..342aa40 100644
--- a/core/lib/Drupal/Core/Render/Element.php
+++ b/core/lib/Drupal/Core/Render/Element.php
@@ -57,7 +57,7 @@ public static function child($key) {
    * Identifies the children of an element array, optionally sorted by weight.
    *
    * The children of a element array are those key/value pairs whose key does
-   * not start with a '#'. See drupal_render() for details.
+   * not start with a '#'. See \Drupal::service() for details.
    *
    * @param array $elements
    *   The element array whose children are to be identified. Passed by
diff --git a/core/lib/Drupal/Core/Render/Element/HtmlTag.php b/core/lib/Drupal/Core/Render/Element/HtmlTag.php
index 98cf636..cc01a54 100644
--- a/core/lib/Drupal/Core/Render/Element/HtmlTag.php
+++ b/core/lib/Drupal/Core/Render/Element/HtmlTag.php
@@ -171,7 +171,7 @@ public static function preRenderConditionalComments($element) {
     // for details.
 
     // Ensure what we are dealing with is safe.
-    // This would be done later anyway in drupal_render().
+    // This would be done later anyway in \Drupal::service().
     $prefix = isset($element['#prefix']) ? $element['#prefix'] : '';
     if ($prefix && !($prefix instanceof MarkupInterface)) {
       $prefix = Xss::filterAdmin($prefix);
diff --git a/core/lib/Drupal/Core/Render/Renderer.php b/core/lib/Drupal/Core/Render/Renderer.php
index 0024694..3fe7db5 100644
--- a/core/lib/Drupal/Core/Render/Renderer.php
+++ b/core/lib/Drupal/Core/Render/Renderer.php
@@ -552,7 +552,7 @@ protected function doRender(&$elements, $is_root_call = FALSE) {
       $this->replacePlaceholders($elements);
       // @todo remove as part of https://www.drupal.org/node/2511330.
       if ($context->count() !== 1) {
-        throw new \LogicException('A stray drupal_render() invocation with $is_root_call = TRUE is causing bubbling of attached assets to break.');
+        throw new \LogicException('A stray \Drupal::service() invocation with $is_root_call = TRUE is causing bubbling of attached assets to break.');
       }
     }
 
diff --git a/core/lib/Drupal/Core/Render/theme.api.php b/core/lib/Drupal/Core/Render/theme.api.php
index 754641c..9afb61c 100644
--- a/core/lib/Drupal/Core/Render/theme.api.php
+++ b/core/lib/Drupal/Core/Render/theme.api.php
@@ -17,9 +17,9 @@
  * hierarchical arrays that include the data to be rendered into HTML (or XML or
  * another output format), and options that affect the markup. Render arrays
  * are ultimately rendered into HTML or other output formats by recursive calls
- * to drupal_render(), traversing the depth of the render array hierarchy. At
+ * to \Drupal::service(), traversing the depth of the render array hierarchy. At
  * each level, the theme system is invoked to do the actual rendering. See the
- * documentation of drupal_render() and the
+ * documentation of \Drupal::service() and the
  * @link theme_render Theme system and Render API topic @endlink for more
  * information about render arrays and rendering.
  *
@@ -232,13 +232,13 @@
  * hierarchical associative array containing data to be rendered and properties
  * describing how the data should be rendered. A render array that is returned
  * by a function to specify markup to be sent to the web browser or other
- * services will eventually be rendered by a call to drupal_render(), which will
+ * services will eventually be rendered by a call to \Drupal::service(), which will
  * recurse through the render array hierarchy if appropriate, making calls into
  * the theme system to do the actual rendering. If a function or method actually
  * needs to return rendered output rather than a render array, the best practice
- * would be to create a render array, render it by calling drupal_render(), and
+ * would be to create a render array, render it by calling \Drupal::service(), and
  * return that result, rather than writing the markup directly. See the
- * documentation of drupal_render() for more details of the rendering process.
+ * documentation of \Drupal::service() for more details of the rendering process.
  *
  * Each level in the hierarchy of a render array (including the outermost array)
  * has one or more array elements. Array elements whose names start with '#' are
diff --git a/core/modules/aggregator/src/Controller/AggregatorController.php b/core/modules/aggregator/src/Controller/AggregatorController.php
index b459b19..6c94b5a 100644
--- a/core/modules/aggregator/src/Controller/AggregatorController.php
+++ b/core/modules/aggregator/src/Controller/AggregatorController.php
@@ -44,7 +44,7 @@ public static function create(ContainerInterface $container) {
    * Presents the aggregator feed creation form.
    *
    * @return array
-   *   A form array as expected by drupal_render().
+   *   A form array as expected by \Drupal::service().
    */
   public function feedAdd() {
     $feed = $this->entityManager()->getStorage('aggregator_feed')->create();
@@ -101,7 +101,7 @@ public function feedRefresh(FeedInterface $aggregator_feed) {
    * Displays the aggregator administration page.
    *
    * @return array
-   *   A render array as expected by drupal_render().
+   *   A render array as expected by \Drupal::service().
    */
   public function adminOverview() {
     $entity_manager = $this->entityManager();
diff --git a/core/modules/block/block.api.php b/core/modules/block/block.api.php
index 4c7faf5..a5b344a 100644
--- a/core/modules/block/block.api.php
+++ b/core/modules/block/block.api.php
@@ -72,7 +72,7 @@
  * If the module wishes to act on the rendered HTML of the block rather than
  * the structured content array, it may use this hook to add a #post_render
  * callback. Alternatively, it could also implement hook_preprocess_HOOK() for
- * block.html.twig. See drupal_render() documentation or the
+ * block.html.twig. See \Drupal::service() documentation or the
  * @link themeable Default theme implementations topic @endlink for details.
  *
  * In addition to hook_block_view_alter(), which is called for all blocks, there
diff --git a/core/modules/block/src/Controller/BlockListController.php b/core/modules/block/src/Controller/BlockListController.php
index 74ea9c1..f0d5e7c 100644
--- a/core/modules/block/src/Controller/BlockListController.php
+++ b/core/modules/block/src/Controller/BlockListController.php
@@ -48,7 +48,7 @@ public static function create(ContainerInterface $container) {
    *   The current request.
    *
    * @return array
-   *   A render array as expected by drupal_render().
+   *   A render array as expected by \Drupal::service().
    */
   public function listing($theme = NULL, Request $request = NULL) {
     $theme = $theme ?: $this->config('system.theme')->get('default');
diff --git a/core/modules/block_content/src/Controller/BlockContentController.php b/core/modules/block_content/src/Controller/BlockContentController.php
index 7c1f8aa..48f05a9 100644
--- a/core/modules/block_content/src/Controller/BlockContentController.php
+++ b/core/modules/block_content/src/Controller/BlockContentController.php
@@ -98,7 +98,7 @@ public function add(Request $request) {
    *   The current request object.
    *
    * @return array
-   *   A form array as expected by drupal_render().
+   *   A form array as expected by \Drupal::service().
    */
   public function addForm(BlockContentTypeInterface $block_content_type, Request $request) {
     $block = $this->blockContentStorage->create([
diff --git a/core/modules/book/src/BookManager.php b/core/modules/book/src/BookManager.php
index 3db359b..519c541 100644
--- a/core/modules/book/src/BookManager.php
+++ b/core/modules/book/src/BookManager.php
@@ -518,7 +518,7 @@ public function bookTreeOutput(array $tree) {
     $build = [];
 
     if ($items) {
-      // Make sure drupal_render() does not re-order the links.
+      // Make sure \Drupal::service() does not re-order the links.
       $build['#sorted'] = TRUE;
       // Get the book id from the last link.
       $item = end($items);
diff --git a/core/modules/book/src/BookManagerInterface.php b/core/modules/book/src/BookManagerInterface.php
index 324a5da..d6f1a5b 100644
--- a/core/modules/book/src/BookManagerInterface.php
+++ b/core/modules/book/src/BookManagerInterface.php
@@ -246,7 +246,7 @@ public function deleteFromBook($nid);
    *   A data structure representing the tree as returned from buildBookOutlineData.
    *
    * @return array
-   *   A structured array to be rendered by drupal_render().
+   *   A structured array to be rendered by \Drupal::service().
    *
    * @see \Drupal\Core\Menu\MenuLinkTree::build
    */
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index bb203bf..1912d01 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -268,7 +268,7 @@ function comment_node_view_alter(array &$build, EntityInterface $node, EntityVie
  *   content language of the current request.
  *
  * @return array
- *   An array as expected by drupal_render().
+ *   An array as expected by \Drupal::service().
  *
  * @deprecated in Drupal 8.x and will be removed before Drupal 9.0.
  *   Use \Drupal::entityManager()->getViewBuilder('comment')->view().
@@ -291,12 +291,12 @@ function comment_view(CommentInterface $comment, $view_mode = 'full', $langcode
  *   Defaults to NULL.
  *
  * @return array
- *   An array in the format expected by drupal_render().
+ *   An array in the format expected by \Drupal::service().
  *
  * @deprecated in Drupal 8.x and will be removed before Drupal 9.0.
  *   Use \Drupal::entityManager()->getViewBuilder('comment')->viewMultiple().
  *
- * @see drupal_render()
+ * @see \Drupal::service()
  */
 function comment_view_multiple($comments, $view_mode = 'full', $langcode = NULL) {
   return entity_view_multiple($comments, $view_mode, $langcode);
@@ -558,7 +558,7 @@ function comment_user_predelete($account) {
  *   The current state of the form.
  *
  * @return array
- *   An array as expected by drupal_render().
+ *   An array as expected by \Drupal::service().
  */
 function comment_preview(CommentInterface $comment, FormStateInterface $form_state) {
   $preview_build = [];
diff --git a/core/modules/config_translation/src/Controller/ConfigTranslationListController.php b/core/modules/config_translation/src/Controller/ConfigTranslationListController.php
index 7a39289..c7582f9 100644
--- a/core/modules/config_translation/src/Controller/ConfigTranslationListController.php
+++ b/core/modules/config_translation/src/Controller/ConfigTranslationListController.php
@@ -45,7 +45,7 @@ public static function create(ContainerInterface $container) {
    *   The name of the mapper.
    *
    * @return array
-   *   A render array as expected by drupal_render().
+   *   A render array as expected by \Drupal::service().
    *
    * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
    *   Throws an exception if a mapper plugin could not be instantiated from the
diff --git a/core/modules/contact/src/Controller/ContactController.php b/core/modules/contact/src/Controller/ContactController.php
index 3565534..f297930 100644
--- a/core/modules/contact/src/Controller/ContactController.php
+++ b/core/modules/contact/src/Controller/ContactController.php
@@ -47,7 +47,7 @@ public static function create(ContainerInterface $container) {
    *   The contact form to use.
    *
    * @return array
-   *   The form as render array as expected by drupal_render().
+   *   The form as render array as expected by \Drupal::service().
    *
    * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
    *   Exception is thrown when user tries to access non existing default
@@ -95,7 +95,7 @@ public function contactSitePage(ContactFormInterface $contact_form = NULL) {
    *   The account for which a personal contact form should be generated.
    *
    * @return array
-   *   The personal contact form as render array as expected by drupal_render().
+   *   The personal contact form as render array as expected by \Drupal::service().
    *
    * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
    *   Exception is thrown when user tries to access a contact form for a
diff --git a/core/modules/content_moderation/src/Controller/ModeratedContentController.php b/core/modules/content_moderation/src/Controller/ModeratedContentController.php
index cdd00dd..6bb2c34 100644
--- a/core/modules/content_moderation/src/Controller/ModeratedContentController.php
+++ b/core/modules/content_moderation/src/Controller/ModeratedContentController.php
@@ -14,7 +14,7 @@ class ModeratedContentController extends ControllerBase {
    * Provides the listing page for moderated nodes.
    *
    * @return array
-   *   A render array as expected by drupal_render().
+   *   A render array as expected by \Drupal::service().
    */
   public function nodeListing() {
     $entity_type = $this->entityTypeManager()->getDefinition('node');
diff --git a/core/modules/contextual/src/Element/ContextualLinks.php b/core/modules/contextual/src/Element/ContextualLinks.php
index e5b58fb..bfa3d83 100644
--- a/core/modules/contextual/src/Element/ContextualLinks.php
+++ b/core/modules/contextual/src/Element/ContextualLinks.php
@@ -86,7 +86,7 @@ public static function preRenderLinks(array $element) {
     // Allow modules to alter the renderable contextual links element.
     static::moduleHandler()->alter('contextual_links_view', $element, $items);
 
-    // If there are no links, tell drupal_render() to abort rendering.
+    // If there are no links, tell \Drupal::service() to abort rendering.
     if (empty($element['#links'])) {
       $element['#printed'] = TRUE;
     }
diff --git a/core/modules/dblog/src/Controller/DbLogController.php b/core/modules/dblog/src/Controller/DbLogController.php
index 4cfbece..f9f205f 100644
--- a/core/modules/dblog/src/Controller/DbLogController.php
+++ b/core/modules/dblog/src/Controller/DbLogController.php
@@ -113,7 +113,7 @@ public static function getLogLevelClassMap() {
    * Full-length messages can be viewed on the message details page.
    *
    * @return array
-   *   A render array as expected by drupal_render().
+   *   A render array as expected by \Drupal::service().
    *
    * @see Drupal\dblog\Form\DblogClearLogConfirmForm
    * @see Drupal\dblog\Controller\DbLogController::eventDetails()
@@ -237,7 +237,7 @@ public function overview() {
    *
    * @return array
    *   If the ID is located in the Database Logging table, a build array in the
-   *   format expected by drupal_render();
+   *   format expected by \Drupal::service();
    */
   public function eventDetails($event_id) {
     $build = [];
@@ -378,7 +378,7 @@ public function formatMessage($row) {
    *   Type of database log events to display (e.g., 'search').
    *
    * @return array
-   *   A build array in the format expected by drupal_render().
+   *   A build array in the format expected by \Drupal::service().
    */
   public function topLogMessages($type) {
     $header = [
diff --git a/core/modules/field_ui/src/Controller/FieldConfigListController.php b/core/modules/field_ui/src/Controller/FieldConfigListController.php
index 0a6911a..4f89502 100644
--- a/core/modules/field_ui/src/Controller/FieldConfigListController.php
+++ b/core/modules/field_ui/src/Controller/FieldConfigListController.php
@@ -21,7 +21,7 @@ class FieldConfigListController extends EntityListController {
    *   The current route match.
    *
    * @return array
-   *   A render array as expected by drupal_render().
+   *   A render array as expected by \Drupal::service().
    */
   public function listing($entity_type_id = NULL, $bundle = NULL, RouteMatchInterface $route_match = NULL) {
     return $this->entityManager()->getListBuilder('field_config')->render($entity_type_id, $bundle);
diff --git a/core/modules/field_ui/src/Element/FieldUiTable.php b/core/modules/field_ui/src/Element/FieldUiTable.php
index 84cafb0..a7e43a1 100644
--- a/core/modules/field_ui/src/Element/FieldUiTable.php
+++ b/core/modules/field_ui/src/Element/FieldUiTable.php
@@ -38,7 +38,7 @@ public function getInfo() {
    * @return array
    *   The $element with prepared variables ready for field-ui-table.html.twig.
    *
-   * @see drupal_render()
+   * @see \Drupal::service()
    * @see \Drupal\Core\Render\Element\Table::preRenderTable()
    */
   public static function tablePreRender($elements) {
diff --git a/core/modules/field_ui/src/Form/EntityDisplayFormBase.php b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php
index 06eed1f..ebf7bcf 100644
--- a/core/modules/field_ui/src/Form/EntityDisplayFormBase.php
+++ b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php
@@ -702,7 +702,7 @@ public function multistepAjax($form, FormStateInterface $form_state) {
    *
    * @return array
    *
-   * @see drupal_render()
+   * @see \Drupal::service()
    * @see \Drupal\Core\Render\Element\Table::preRenderTable()
    *
    * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
diff --git a/core/modules/help/src/Controller/HelpController.php b/core/modules/help/src/Controller/HelpController.php
index 74d46ec..a6794fa 100644
--- a/core/modules/help/src/Controller/HelpController.php
+++ b/core/modules/help/src/Controller/HelpController.php
@@ -107,7 +107,7 @@ public function helpMain() {
    *   A module name to display a help page for.
    *
    * @return array
-   *   A render array as expected by drupal_render().
+   *   A render array as expected by \Drupal::service().
    *
    * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
    */
diff --git a/core/modules/image/src/Tests/ImageDimensionsTest.php b/core/modules/image/src/Tests/ImageDimensionsTest.php
index 136b0f1..94d9dcd 100644
--- a/core/modules/image/src/Tests/ImageDimensionsTest.php
+++ b/core/modules/image/src/Tests/ImageDimensionsTest.php
@@ -280,9 +280,9 @@ public function testImageDimensions() {
   /**
    * Render an image style element.
    *
-   * drupal_render() alters the passed $variables array by adding a new key
+   * \Drupal::service() alters the passed $variables array by adding a new key
    * '#printed' => TRUE. This prevents next call to re-render the element. We
-   * wrap drupal_render() in a helper protected method and pass each time a
+   * wrap \Drupal::service() in a helper protected method and pass each time a
    * fresh array so that $variables won't get altered and the element is
    * re-rendered each time.
    */
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 208deb5..21cfd43 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -806,14 +806,14 @@ function node_get_recent($number = 10) {
  *   the global content language of the current request.
  *
  * @return array
- *   An array as expected by drupal_render().
+ *   An array as expected by \Drupal::service().
  */
 function node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL) {
   return entity_view($node, $view_mode, $langcode);
 }
 
 /**
- * Constructs a drupal_render() style array from an array of loaded nodes.
+ * Constructs a \Drupal::service() style array from an array of loaded nodes.
  *
  * @param $nodes
  *   An array of nodes as returned by Node::loadMultiple().
@@ -824,7 +824,7 @@ function node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL) {
  *   content language of the current request.
  *
  * @return array
- *   An array in the format expected by drupal_render().
+ *   An array in the format expected by \Drupal::service().
  */
 function node_view_multiple($nodes, $view_mode = 'teaser', $langcode = NULL) {
   return entity_view_multiple($nodes, $view_mode, $langcode);
diff --git a/core/modules/node/src/Controller/NodeController.php b/core/modules/node/src/Controller/NodeController.php
index e873f91..582f6fd 100644
--- a/core/modules/node/src/Controller/NodeController.php
+++ b/core/modules/node/src/Controller/NodeController.php
@@ -122,7 +122,7 @@ public function add(NodeTypeInterface $node_type) {
    *   The node revision ID.
    *
    * @return array
-   *   An array suitable for drupal_render().
+   *   An array suitable for \Drupal::service().
    */
   public function revisionShow($node_revision) {
     $node = $this->entityManager()->getStorage('node')->loadRevision($node_revision);
@@ -154,7 +154,7 @@ public function revisionPageTitle($node_revision) {
    *   A node object.
    *
    * @return array
-   *   An array as expected by drupal_render().
+   *   An array as expected by \Drupal::service().
    */
   public function revisionOverview(NodeInterface $node) {
     $account = $this->currentUser();
diff --git a/core/modules/path/src/Controller/PathController.php b/core/modules/path/src/Controller/PathController.php
index 51f88dd..e3c189b 100644
--- a/core/modules/path/src/Controller/PathController.php
+++ b/core/modules/path/src/Controller/PathController.php
@@ -59,7 +59,7 @@ public static function create(ContainerInterface $container) {
    *   The request object.
    *
    * @return array
-   *   A render array as expected by drupal_render().
+   *   A render array as expected by \Drupal::service().
    */
   public function adminOverview(Request $request) {
     $keys = $request->query->get('search');
diff --git a/core/modules/system/src/Tests/Common/RenderWebTest.php b/core/modules/system/src/Tests/Common/RenderWebTest.php
index ed0e086..94a2ffd 100644
--- a/core/modules/system/src/Tests/Common/RenderWebTest.php
+++ b/core/modules/system/src/Tests/Common/RenderWebTest.php
@@ -8,7 +8,7 @@
 use Drupal\simpletest\WebTestBase;
 
 /**
- * Performs integration tests on drupal_render().
+ * Performs integration tests on \Drupal::service().
  *
  * @group Common
  */
diff --git a/core/modules/system/src/Tests/Theme/ThemeTest.php b/core/modules/system/src/Tests/Theme/ThemeTest.php
index 64f330e..16f0fe1 100644
--- a/core/modules/system/src/Tests/Theme/ThemeTest.php
+++ b/core/modules/system/src/Tests/Theme/ThemeTest.php
@@ -237,7 +237,7 @@ public function testDrupalRenderChildren() {
         '#markup' => 'Foo',
       ],
     ];
-    $this->assertThemeOutput('theme_test_render_element_children', $element, 'Foo', 'drupal_render() avoids #theme recursion loop when rendering a render element.');
+    $this->assertThemeOutput('theme_test_render_element_children', $element, 'Foo', '\Drupal::service() avoids #theme recursion loop when rendering a render element.');
 
     $element = [
       '#theme_wrappers' => ['theme_test_render_element_children'],
@@ -245,7 +245,7 @@ public function testDrupalRenderChildren() {
         '#markup' => 'Foo',
       ],
     ];
-    $this->assertThemeOutput('theme_test_render_element_children', $element, 'Foo', 'drupal_render() avoids #theme_wrappers recursion loop when rendering a render element.');
+    $this->assertThemeOutput('theme_test_render_element_children', $element, 'Foo', '\Drupal::service() avoids #theme_wrappers recursion loop when rendering a render element.');
   }
 
   /**
diff --git a/core/modules/system/tests/modules/common_test/common_test.module b/core/modules/system/tests/modules/common_test/common_test.module
index 040e40a..72aba21 100644
--- a/core/modules/system/tests/modules/common_test/common_test.module
+++ b/core/modules/system/tests/modules/common_test/common_test.module
@@ -129,7 +129,7 @@ function common_test_theme() {
 }
 
 /**
- * Provides a theme function for drupal_render().
+ * Provides a theme function for \Drupal::service().
  */
 function theme_common_test_foo($variables) {
   return $variables['foo'] . $variables['bar'];
diff --git a/core/modules/system/tests/modules/test_page_test/src/Controller/Test.php b/core/modules/system/tests/modules/test_page_test/src/Controller/Test.php
index e754eaf..0c55e00 100644
--- a/core/modules/system/tests/modules/test_page_test/src/Controller/Test.php
+++ b/core/modules/system/tests/modules/test_page_test/src/Controller/Test.php
@@ -15,7 +15,7 @@ class Test {
    * Renders a page with a title.
    *
    * @return array
-   *   A render array as expected by drupal_render()
+   *   A render array as expected by \Drupal::service()
    */
   public function renderTitle() {
     $build = [];
@@ -29,7 +29,7 @@ public function renderTitle() {
    * Renders a page.
    *
    * @return array
-   *   A render array as expected by drupal_render().
+   *   A render array as expected by \Drupal::service().
    */
   public function staticTitle() {
     $build = [];
@@ -66,7 +66,7 @@ public function controllerWithCache() {
    * Returns a generic page render array for title tests.
    *
    * @return array
-   *   A render array as expected by drupal_render()
+   *   A render array as expected by \Drupal::service()
    */
   public function renderPage() {
     return [
@@ -95,7 +95,7 @@ public function error() {
    * Renders a page with encoded markup.
    *
    * @return array
-   *   A render array as expected by drupal_render()
+   *   A render array as expected by \Drupal::service()
    */
   public function renderEncodedMarkup() {
     return ['#plain_text' => 'Bad html <script>alert(123);</script>'];
@@ -105,7 +105,7 @@ public function renderEncodedMarkup() {
    * Renders a page with pipe character in link test.
    *
    * @return array
-   *   A render array as expected by drupal_render()
+   *   A render array as expected by \Drupal::service()
    */
   public function renderPipeInLink() {
     return ['#markup' => '<a href="http://example.com">foo|bar|baz</a>'];
diff --git a/core/modules/system/tests/modules/theme_test/theme_test.module b/core/modules/system/tests/modules/theme_test/theme_test.module
index cd8aba7..97b297f 100644
--- a/core/modules/system/tests/modules/theme_test/theme_test.module
+++ b/core/modules/system/tests/modules/theme_test/theme_test.module
@@ -145,10 +145,10 @@ function template_preprocess_theme_test_render_element(&$variables) {
 }
 
 /**
- * Theme function for testing rendering of child elements via drupal_render().
+ * Theme function for testing rendering of child elements via \Drupal::service().
  *
  * Theme hooks defining a 'render element' add an internal '#render_children'
- * property. When this property is found, drupal_render() avoids calling
+ * property. When this property is found, \Drupal::service() avoids calling
  * the 'theme.manager' service 'render' method on the top-level element to
  * prevent infinite recursion.
  *
diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module
index be8532a..057565e 100644
--- a/core/modules/taxonomy/taxonomy.module
+++ b/core/modules/taxonomy/taxonomy.module
@@ -213,14 +213,14 @@ function taxonomy_check_vocabulary_hierarchy(VocabularyInterface $vocabulary, $c
  *   content language of the current request.
  *
  * @return array
- *   A $page element suitable for use by drupal_render().
+ *   A $page element suitable for use by \Drupal::service().
  */
 function taxonomy_term_view(Term $term, $view_mode = 'full', $langcode = NULL) {
   return entity_view($term, $view_mode, $langcode);
 }
 
 /**
- * Constructs a drupal_render() style array from an array of loaded terms.
+ * Constructs a \Drupal::service() style array from an array of loaded terms.
  *
  * @param array $terms
  *   An array of taxonomy terms as returned by Term::loadMultiple().
@@ -231,7 +231,7 @@ function taxonomy_term_view(Term $term, $view_mode = 'full', $langcode = NULL) {
  *   content language of the current request.
  *
  * @return array
- *   An array in the format expected by drupal_render().
+ *   An array in the format expected by \Drupal::service().
  */
 function taxonomy_term_view_multiple(array $terms, $view_mode = 'full', $langcode = NULL) {
   return entity_view_multiple($terms, $view_mode, $langcode);
diff --git a/core/modules/toolbar/src/Element/Toolbar.php b/core/modules/toolbar/src/Element/Toolbar.php
index d92330b..3711789 100644
--- a/core/modules/toolbar/src/Element/Toolbar.php
+++ b/core/modules/toolbar/src/Element/Toolbar.php
@@ -50,7 +50,7 @@ public function getInfo() {
   }
 
   /**
-   * Builds the Toolbar as a structured array ready for drupal_render().
+   * Builds the Toolbar as a structured array ready for \Drupal::service().
    *
    * Since building the toolbar takes some time, it is done just prior to
    * rendering to ensure that it is built only if it will be displayed.
diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module
index c7feaee..cf059c9 100644
--- a/core/modules/toolbar/toolbar.module
+++ b/core/modules/toolbar/toolbar.module
@@ -217,7 +217,7 @@ function toolbar_toolbar() {
  * @return array
  *   The updated renderable array.
  *
- * @see drupal_render()
+ * @see \Drupal::service()
  */
 function toolbar_prerender_toolbar_administration_tray(array $element) {
   $menu_tree = \Drupal::service('toolbar.menu_tree');
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 2d7d24a..1bee7f9 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -901,14 +901,14 @@ function user_delete_multiple(array $uids) {
  *   content language of the current request.
  *
  * @return array
- *   An array as expected by drupal_render().
+ *   An array as expected by \Drupal::service().
  */
 function user_view($account, $view_mode = 'full', $langcode = NULL) {
   return entity_view($account, $view_mode, $langcode);
 }
 
 /**
- * Constructs a drupal_render() style array from an array of loaded users.
+ * Constructs a \Drupal::service() style array from an array of loaded users.
  *
  * @param \Drupal\user\UserInterface[] $accounts
  *   An array of user accounts as returned by User::loadMultiple().
@@ -919,7 +919,7 @@ function user_view($account, $view_mode = 'full', $langcode = NULL) {
  *   content language of the current request.
  *
  * @return array
- *   An array in the format expected by drupal_render().
+ *   An array in the format expected by \Drupal::service().
  */
 function user_view_multiple($accounts, $view_mode = 'full', $langcode = NULL) {
   return entity_view_multiple($accounts, $view_mode, $langcode);
diff --git a/core/modules/views/src/Plugin/views/field/FieldHandlerInterface.php b/core/modules/views/src/Plugin/views/field/FieldHandlerInterface.php
index 2562b95..ad1df17 100644
--- a/core/modules/views/src/Plugin/views/field/FieldHandlerInterface.php
+++ b/core/modules/views/src/Plugin/views/field/FieldHandlerInterface.php
@@ -255,7 +255,7 @@ public function renderText($alter);
   public function getRenderTokens($item);
 
   /**
-   * Passes values to drupal_render() using $this->themeFunctions() as #theme.
+   * Passes values to \Drupal::service() using $this->themeFunctions() as #theme.
    *
    * @param \Drupal\views\ResultRow $values
    *   Holds single row of a view's result set.
diff --git a/core/modules/views/views.module b/core/modules/views/views.module
index f484f18..c2a35a8 100644
--- a/core/modules/views/views.module
+++ b/core/modules/views/views.module
@@ -326,7 +326,7 @@ function views_theme_suggestions_container_alter(array &$suggestions, array $var
  *
  * @param $render_element
  *   The renderable array to which contextual links will be added. This array
- *   should be suitable for passing in to drupal_render() and will normally
+ *   should be suitable for passing in to \Drupal::service() and will normally
  *   contain a representation of the view display whose contextual links are
  *   being requested.
  * @param $location
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityViewBuilderTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityViewBuilderTest.php
index e1537bc..f939df8 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityViewBuilderTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityViewBuilderTest.php
@@ -40,7 +40,7 @@ public function testEntityViewBuilderCache() {
     $cache_contexts_manager = \Drupal::service("cache_contexts_manager");
     $cache = \Drupal::cache();
 
-    // Force a request via GET so we can get drupal_render() cache working.
+    // Force a request via GET so we can get \Drupal::service() cache working.
     $request = \Drupal::request();
     $request_method = $request->server->get('REQUEST_METHOD');
     $request->setMethod('GET');
@@ -93,7 +93,7 @@ public function testEntityViewBuilderCacheWithReferences() {
     $renderer = $this->container->get('renderer');
     $cache_contexts_manager = \Drupal::service("cache_contexts_manager");
 
-    // Force a request via GET so we can get drupal_render() cache working.
+    // Force a request via GET so we can get \Drupal::service() cache working.
     $request = \Drupal::request();
     $request_method = $request->server->get('REQUEST_METHOD');
     $request->setMethod('GET');
diff --git a/core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php b/core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php
index 906e74b..b0cb245 100644
--- a/core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Render/Element/RenderElementTypesTest.php
@@ -7,7 +7,7 @@
 use Drupal\KernelTests\KernelTestBase;
 
 /**
- * Tests the markup of core render element types passed to drupal_render().
+ * Tests the markup of core render element types passed to \Drupal::service().
  *
  * @group Common
  */
@@ -190,7 +190,7 @@ public function testMoreLink() {
     foreach ($elements as $element) {
       $xml = new \SimpleXMLElement(\Drupal::service('renderer')->renderRoot($element['value']));
       $result = $xml->xpath($element['expected']);
-      $this->assertTrue($result, '"' . $element['name'] . '" input rendered correctly by drupal_render().');
+      $this->assertTrue($result, '"' . $element['name'] . '" input rendered correctly by \Drupal::service().');
     }
   }
 
@@ -221,7 +221,7 @@ public function testSystemCompactLink() {
     foreach ($elements as $element) {
       $xml = new \SimpleXMLElement(\Drupal::service('renderer')->renderRoot($element['value']));
       $result = $xml->xpath($element['expected']);
-      $this->assertTrue($result, '"' . $element['name'] . '" is rendered correctly by drupal_render().');
+      $this->assertTrue($result, '"' . $element['name'] . '" is rendered correctly by \Drupal::service().');
     }
 
     // Set admin compact mode on for additional tests.
@@ -237,7 +237,7 @@ public function testSystemCompactLink() {
 
     $xml = new \SimpleXMLElement(\Drupal::service('renderer')->renderRoot($element['value']));
     $result = $xml->xpath($element['expected']);
-    $this->assertTrue($result, '"' . $element['name'] . '" is rendered correctly by drupal_render().');
+    $this->assertTrue($result, '"' . $element['name'] . '" is rendered correctly by \Drupal::service().');
   }
 
 }
diff --git a/core/tests/Drupal/KernelTests/Core/Render/RenderTest.php b/core/tests/Drupal/KernelTests/Core/Render/RenderTest.php
index 2acaefb..ac12069 100644
--- a/core/tests/Drupal/KernelTests/Core/Render/RenderTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Render/RenderTest.php
@@ -5,7 +5,7 @@
 use Drupal\KernelTests\KernelTestBase;
 
 /**
- * Performs functional tests on drupal_render().
+ * Performs functional tests on \Drupal::service().
  *
  * @group Common
  */
diff --git a/core/tests/Drupal/Tests/Core/Render/RendererTest.php b/core/tests/Drupal/Tests/Core/Render/RendererTest.php
index eda1f9f..574da24 100644
--- a/core/tests/Drupal/Tests/Core/Render/RendererTest.php
+++ b/core/tests/Drupal/Tests/Core/Render/RendererTest.php
@@ -452,7 +452,7 @@ public function testRenderSorting() {
     $this->assertTrue($elements['#sorted'], "'#sorted' => TRUE was added to the array");
 
     // Pass $elements through \Drupal\Core\Render\Element::children() and
-    // ensure it remains sorted in the correct order. drupal_render() will
+    // ensure it remains sorted in the correct order. \Drupal::service() will
     // return an empty string if used on the same array in the same request.
     $children = Element::children($elements);
     $this->assertTrue(array_shift($children) == 'first', 'Child found in the correct order.');
diff --git a/core/tests/Drupal/Tests/EntityViewTrait.php b/core/tests/Drupal/Tests/EntityViewTrait.php
index d8c9d92..9681c1f 100644
--- a/core/tests/Drupal/Tests/EntityViewTrait.php
+++ b/core/tests/Drupal/Tests/EntityViewTrait.php
@@ -15,7 +15,7 @@
    *
    * Entities postpone the composition of their renderable arrays to #pre_render
    * functions in order to maximize cache efficacy. This means that the full
-   * renderable array for an entity is constructed in drupal_render(). Some
+   * renderable array for an entity is constructed in \Drupal::service(). Some
    * tests require the complete renderable array for an entity outside of the
    * drupal_render process in order to verify the presence of specific values.
    * This method isolates the steps in the render process that produce an
@@ -32,7 +32,7 @@
    *   (optional) Whether to clear the cache for this entity.
    * @return array
    *
-   * @see drupal_render()
+   * @see \Drupal::service()
    */
   protected function buildEntityView(EntityInterface $entity, $view_mode = 'full', $langcode = NULL, $reset = FALSE) {
     $ensure_fully_built = function (&$elements) use (&$ensure_fully_built) {
