]> git.proxmox.com Git - rustc.git/blame - src/test/compile-fail/regions-normalize-in-where-clause-list.rs
New upstream version 1.24.1+dfsg1
[rustc.git] / src / test / compile-fail / regions-normalize-in-where-clause-list.rs
CommitLineData
ff7c6d11
XL
1// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
10
11// Test that we are able to normalize in the list of where-clauses,
12// even if `'a: 'b` is required.
13
14trait Project<'a, 'b> {
15 type Item;
16}
17
18impl<'a, 'b> Project<'a, 'b> for ()
19 where 'a: 'b
20{
21 type Item = ();
22}
23
24// No error here, we have 'a: 'b. We used to report an error here
25// though, see https://github.com/rust-lang/rust/issues/45937.
26fn foo<'a: 'b, 'b>()
27 where <() as Project<'a, 'b>>::Item : Eq
28{
29}
30
31// Here we get an error: we need `'a: 'b`.
32fn bar<'a, 'b>() //~ ERROR cannot infer
33 where <() as Project<'a, 'b>>::Item : Eq
34{
35}
36
37fn main() { }