Skip to content

Commit 86975ee

Browse files
1.3: 更新迭代器推导中的警告, 更加明确
1 parent 89ed56d commit 86975ee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lazy_evaluation.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ impl quote::ToTokens for IteratorRef {
7878
Expr::Path(_) => {
7979
info_container.paths.push(iterable);
8080
}
81-
_ => panic!("unreachable"),
81+
_ => panic!(
82+
"Only range (e.g. 1..10 or 2..=x where x is a number) and single identifier \
83+
(without any method calls) are supported for iterable comprehension"
84+
),
8285
}
8386

8487
let conditions = match if_clause {

0 commit comments

Comments
 (0)