Skip to content

Commit

Permalink
add test to check for popping wrong items
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Sep 5, 2024
1 parent c8d001f commit dc46bff
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/ui/use_self.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,3 +691,21 @@ mod issue_13092 {
}
}
}

mod crash_check_13128 {
struct A;

impl A {
fn a() {
struct B;

impl Iterator for &B { // pushes a NoCheck
type Item = A; // Pops the NoCheck

fn next(&mut self) -> Option<A> { // Lints A -> Self
Some(A)
}
}
}
}
}

0 comments on commit dc46bff

Please sign in to comment.