]> git.proxmox.com Git - rustc.git/blame - src/test/compile-fail/regions-bounded-method-type-parameters-cross-crate.rs
New upstream version 1.23.0+dfsg1
[rustc.git] / src / test / compile-fail / regions-bounded-method-type-parameters-cross-crate.rs
CommitLineData
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 15extern crate rbmtp_cross_crate_lib as lib;
1a4d82fc
JJ
16
17use lib::Inv;
18use lib::MaybeOwned;
19use lib::IntoMaybeOwned;
20
21fn 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
28fn 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
33fn main() { }