Skip to content

Commit 1f6a5a5

Browse files
committed
Clarify why the naive algorithm may not terminate
As suggested by arielb1 #65160 (review)
1 parent 79efdb4 commit 1f6a5a5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/librustc_mir/hair/pattern/_match.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@
114114
/// the formula above makes sense.
115115
///
116116
/// This algorithm however has a lot of practical issues. Most importantly, it may not terminate
117-
/// in the presence of recursive types, since we always unpack all constructors as much
118-
/// as possible. And it would be stupidly slow anyways for types with a lot of constructors,
119-
/// like `u64` of `&[bool]`. We therefore present a modified version after the example.
117+
/// for some types with infinitely many inhabitants, because when it encounters a wildcard it will
118+
/// try all the values of the type. And it would be stupidly slow anyways for types with a lot of
119+
/// constructors, like `u64` of `&[bool]`. We therefore present a modified version after the
120+
/// example.
120121
///
121122
///
122123
/// # Example run of the algorithm

0 commit comments

Comments
 (0)