Skip to content

Commit 9ea2b65

Browse files
tesujiAlexendoo
andcommitted
add test to check for popping wrong items
co-authored-by: Alex Macleod <[email protected]>
1 parent bcfd0d1 commit 9ea2b65

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

tests/ui/use_self.fixed

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,3 +691,24 @@ mod issue_13092 {
691691
}
692692
}
693693
}
694+
695+
mod crash_check_13128 {
696+
struct A;
697+
698+
impl A {
699+
fn a() {
700+
struct B;
701+
702+
// pushes a NoCheck
703+
impl Iterator for &B {
704+
// Pops the NoCheck
705+
type Item = A;
706+
707+
// Lints A -> Self
708+
fn next(&mut self) -> Option<A> {
709+
Some(A)
710+
}
711+
}
712+
}
713+
}
714+
}

tests/ui/use_self.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,3 +691,24 @@ mod issue_13092 {
691691
}
692692
}
693693
}
694+
695+
mod crash_check_13128 {
696+
struct A;
697+
698+
impl A {
699+
fn a() {
700+
struct B;
701+
702+
// pushes a NoCheck
703+
impl Iterator for &B {
704+
// Pops the NoCheck
705+
type Item = A;
706+
707+
// Lints A -> Self
708+
fn next(&mut self) -> Option<A> {
709+
Some(A)
710+
}
711+
}
712+
}
713+
}
714+
}

0 commit comments

Comments
 (0)