]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
1 | // Copyright 2014 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 | ||
a7813a04 | 11 | // aux-build:rbmtp_cross_crate_lib.rs |
1a4d82fc JJ |
12 | |
13 | // Check explicit region bounds on methods in the cross crate case. | |
14 | ||
a7813a04 | 15 | extern crate rbmtp_cross_crate_lib as lib; |
1a4d82fc JJ |
16 | |
17 | use lib::Inv; | |
18 | use lib::MaybeOwned; | |
19 | use lib::IntoMaybeOwned; | |
20 | ||
21 | fn call_into_maybe_owned<'x,F:IntoMaybeOwned<'x>>(f: F) { | |
22 | // Exercise a code path I found to be buggy. We were not encoding | |
23 | // the region parameters from the receiver correctly on trait | |
24 | // methods. | |
25 | f.into_maybe_owned(); | |
26 | } | |
27 | ||
28 | fn call_bigger_region<'x, 'y>(a: Inv<'x>, b: Inv<'y>) { | |
29 | // Here the value provided for 'y is 'y, and hence 'y:'x does not hold. | |
abe05a73 | 30 | a.bigger_region(b) //~ ERROR 30:7: 30:20: lifetime mismatch [E0623] |
1a4d82fc JJ |
31 | } |
32 | ||
33 | fn main() { } |