Skip to content

Commit 28c5fe7

Browse files
committed
Add a regression test
1 parent 0d6dcd0 commit 28c5fe7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#![feature(type_alias_impl_trait)]
2+
3+
// edition: 2021
4+
// check-pass
5+
6+
type MyIter = impl Iterator<Item = i32>;
7+
8+
struct Foo {
9+
iter: MyIter,
10+
}
11+
12+
// ensure that `self` is seen as `Foo` and thus
13+
// counts as a defining use for `MyIter` due to the
14+
// struct field.
15+
impl Foo {
16+
fn set_iter(&mut self) {
17+
self.iter = [1, 2, 3].into_iter();
18+
}
19+
}
20+
21+
fn main() {}

0 commit comments

Comments
 (0)