]> git.lizzy.rs Git - rust.git/blob - src/test/ui/project-cache-issue-37154.rs
Auto merge of #75936 - sdroege:chunks-exact-construction-bounds-check, r=nagisa
[rust.git] / src / test / ui / project-cache-issue-37154.rs
1 // run-pass
2
3 #![allow(dead_code)]
4 // Regression test for #37154: the problem here was that the cache
5 // results in a false error because it was caching placeholder results
6 // even after those placeholder regions had been popped.
7
8 trait Foo {
9     fn method(&self) {}
10 }
11
12 struct Wrapper<T>(T);
13
14 impl<T> Foo for Wrapper<T> where for<'a> &'a T: IntoIterator<Item=&'a ()> {}
15
16 fn f(x: Wrapper<Vec<()>>) {
17     x.method(); // This works.
18     x.method(); // error: no method named `method`
19 }
20
21 fn main() { }