Skip to content

Commit 3166e08

Browse files
authored
Monomorphization doc fix
Only public items are monomorphization roots. This can be confirmed by noting that this program compiles: ```rust fn foo<T>() { if true { foo::<Option<T>>() } } fn bar() { foo::<()>() } ```
1 parent a207871 commit 3166e08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_mir/src/monomorphize/collector.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959
//!
6060
//! ### Discovering roots
6161
//!
62-
//! The roots of the mono item graph correspond to the non-generic
62+
//! The roots of the mono item graph correspond to the public non-generic
6363
//! syntactic items in the source code. We find them by walking the HIR of the
64-
//! crate, and whenever we hit upon a function, method, or static item, we
64+
//! crate, and whenever we hit upon a public function, method, or static item, we
6565
//! create a mono item consisting of the items DefId and, since we only
6666
//! consider non-generic items, an empty type-substitution set.
6767
//!

0 commit comments

Comments
 (0)