]> git.proxmox.com Git - rustc.git/blame - src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.rs
New upstream version 1.62.1+dfsg1
[rustc.git] / src / test / ui / regions / regions-bounded-method-type-parameters-cross-crate.rs
CommitLineData
a7813a04 1// aux-build:rbmtp_cross_crate_lib.rs
04454e1e
FG
2// revisions: base nll
3// ignore-compare-mode-nll
4//[nll] compile-flags: -Z borrowck=mir
1a4d82fc
JJ
5
6// Check explicit region bounds on methods in the cross crate case.
7
a7813a04 8extern crate rbmtp_cross_crate_lib as lib;
1a4d82fc
JJ
9
10use lib::Inv;
11use lib::MaybeOwned;
12use lib::IntoMaybeOwned;
13
14fn call_into_maybe_owned<'x,F:IntoMaybeOwned<'x>>(f: F) {
15 // Exercise a code path I found to be buggy. We were not encoding
16 // the region parameters from the receiver correctly on trait
17 // methods.
18 f.into_maybe_owned();
19}
20
21fn call_bigger_region<'x, 'y>(a: Inv<'x>, b: Inv<'y>) {
22 // Here the value provided for 'y is 'y, and hence 'y:'x does not hold.
04454e1e
FG
23 a.bigger_region(b)
24 //[base]~^ ERROR lifetime mismatch [E0623]
25 //[nll]~^^ ERROR lifetime may not live long enough
1a4d82fc
JJ
26}
27
28fn main() { }