]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.rs
Auto merge of #60093 - GuillaumeGomez:fix-attrs-pos, r=Manishearth
[rust.git] / src / test / ui / regions / regions-bounded-method-type-parameters-cross-crate.rs
1 // aux-build:rbmtp_cross_crate_lib.rs
2
3 // Check explicit region bounds on methods in the cross crate case.
4
5 extern crate rbmtp_cross_crate_lib as lib;
6
7 use lib::Inv;
8 use lib::MaybeOwned;
9 use lib::IntoMaybeOwned;
10
11 fn call_into_maybe_owned<'x,F:IntoMaybeOwned<'x>>(f: F) {
12     // Exercise a code path I found to be buggy. We were not encoding
13     // the region parameters from the receiver correctly on trait
14     // methods.
15     f.into_maybe_owned();
16 }
17
18 fn call_bigger_region<'x, 'y>(a: Inv<'x>, b: Inv<'y>) {
19     // Here the value provided for 'y is 'y, and hence 'y:'x does not hold.
20     a.bigger_region(b) //~ ERROR lifetime mismatch [E0623]
21 }
22
23 fn main() { }