]> git.proxmox.com Git - rustc.git/blame - src/test/ui/hrtb/hrtb-conflate-regions.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / hrtb / hrtb-conflate-regions.rs
CommitLineData
1a4d82fc
JJ
1// Test that an impl with only one bound region `'a` cannot be used to
2// satisfy a constraint where there are two bound regions.
3
4trait Foo<X> {
5 fn foo(&self, x: X) { }
6}
7
8fn want_foo2<T>()
9 where T : for<'a,'b> Foo<(&'a isize, &'b isize)>
10{
11}
12
13fn want_foo1<T>()
14 where T : for<'z> Foo<(&'z isize, &'z isize)>
15{
16}
17
1a4d82fc
JJ
18// Expressed as a where clause
19
20struct SomeStruct;
21
22impl<'a> Foo<(&'a isize, &'a isize)> for SomeStruct
23{
24}
25
26fn a() { want_foo1::<SomeStruct>(); } // OK -- foo wants just one region
923072b8
FG
27fn b() { want_foo2::<SomeStruct>(); }
28//~^ ERROR implementation of
29//~| ERROR implementation of
1a4d82fc
JJ
30
31fn main() { }