]> git.proxmox.com Git - rustc.git/blame - src/test/ui/regions/regions-normalize-in-where-clause-list.rs
New upstream version 1.64.0+dfsg1
[rustc.git] / src / test / ui / regions / regions-normalize-in-where-clause-list.rs
CommitLineData
ff7c6d11
XL
1// Test that we are able to normalize in the list of where-clauses,
2// even if `'a: 'b` is required.
3
4trait Project<'a, 'b> {
5 type Item;
6}
7
8impl<'a, 'b> Project<'a, 'b> for ()
29967ef6
XL
9where
10 'a: 'b,
ff7c6d11
XL
11{
12 type Item = ();
13}
14
15// No error here, we have 'a: 'b. We used to report an error here
16// though, see https://github.com/rust-lang/rust/issues/45937.
17fn foo<'a: 'b, 'b>()
29967ef6
XL
18where
19 <() as Project<'a, 'b>>::Item: Eq,
ff7c6d11
XL
20{
21}
22
23// Here we get an error: we need `'a: 'b`.
29967ef6
XL
24fn bar<'a, 'b>()
25//~^ ERROR cannot infer
29967ef6
XL
26where
27 <() as Project<'a, 'b>>::Item: Eq,
ff7c6d11
XL
28{
29}
30
29967ef6 31fn main() {}