From 3166e0857defd02d78f5afe1a64380a429967cc7 Mon Sep 17 00:00:00 2001 From: Mario Carneiro Date: Fri, 2 Apr 2021 09:33:34 -0700 Subject: [PATCH] Monomorphization doc fix Only public items are monomorphization roots. This can be confirmed by noting that this program compiles: ```rust fn foo() { if true { foo::>() } } fn bar() { foo::<()>() } ``` --- compiler/rustc_mir/src/monomorphize/collector.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_mir/src/monomorphize/collector.rs b/compiler/rustc_mir/src/monomorphize/collector.rs index fd5dbfb186e..cadfc85a858 100644 --- a/compiler/rustc_mir/src/monomorphize/collector.rs +++ b/compiler/rustc_mir/src/monomorphize/collector.rs @@ -59,9 +59,9 @@ //! //! ### Discovering roots //! -//! The roots of the mono item graph correspond to the non-generic +//! The roots of the mono item graph correspond to the public non-generic //! syntactic items in the source code. We find them by walking the HIR of the -//! crate, and whenever we hit upon a function, method, or static item, we +//! crate, and whenever we hit upon a public function, method, or static item, we //! create a mono item consisting of the items DefId and, since we only //! consider non-generic items, an empty type-substitution set. //!