Added check for type unification with the iter
This commit is contained in:
parent
b31625cdc7
commit
7439ecb07c
3 changed files with 15 additions and 3 deletions
|
|
@ -38,6 +38,10 @@ fn array() {
|
|||
for i in Option::map_or(smth.as_ref(), [].iter(), |s| s.iter()) {
|
||||
println!("{i}");
|
||||
}
|
||||
|
||||
// Same as above, but when there are no predicates that mention the collection iter type.
|
||||
let mut iter = [34, 228, 35].iter();
|
||||
let _ = std::mem::replace(&mut iter, [].iter());
|
||||
}
|
||||
|
||||
macro_rules! in_macros {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,10 @@ fn array() {
|
|||
for i in Option::map_or(smth.as_ref(), [].iter(), |s| s.iter()) {
|
||||
println!("{i}");
|
||||
}
|
||||
|
||||
// Same as above, but when there are no predicates that mention the collection iter type.
|
||||
let mut iter = [34, 228, 35].iter();
|
||||
let _ = std::mem::replace(&mut iter, [].iter());
|
||||
}
|
||||
|
||||
macro_rules! in_macros {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue