2014-08-27 20:46:52 -05:00
|
|
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
|
|
|
// ignore-tidy-linelength
|
|
|
|
|
2015-02-12 09:29:52 -06:00
|
|
|
use std::marker::PhantomData;
|
|
|
|
|
|
|
|
struct Bar<'x, 'y, 'z> { bar: &'y i32, baz: i32, marker: PhantomData<(&'x(),&'y(),&'z())> }
|
2015-01-08 09:56:56 -06:00
|
|
|
fn bar1<'a>(x: &Bar) -> (&'a i32, &'a i32, &'a i32) {
|
2016-03-17 03:15:06 -05:00
|
|
|
//~^ HELP: consider using an explicit lifetime parameter as shown: fn bar1<'a>(x: &'a Bar) -> (&'a i32, &'a i32, &'a i32)
|
2014-08-27 20:46:52 -05:00
|
|
|
(x.bar, &x.baz, &x.baz)
|
2016-03-17 03:15:06 -05:00
|
|
|
//~^ ERROR E0312
|
|
|
|
//~| ERROR cannot infer
|
|
|
|
//~| ERROR cannot infer
|
2014-08-27 20:46:52 -05:00
|
|
|
}
|
|
|
|
|
2015-01-08 09:56:56 -06:00
|
|
|
fn bar2<'a, 'b, 'c>(x: &Bar<'a, 'b, 'c>) -> (&'a i32, &'a i32, &'a i32) {
|
2016-03-18 13:47:40 -05:00
|
|
|
//~^ HELP: consider using an explicit lifetime parameter as shown: fn bar2<'a, 'c>(x: &'a Bar<'a, 'a, 'c>) -> (&'a i32, &'a i32, &'a i32)
|
2014-08-27 20:46:52 -05:00
|
|
|
(x.bar, &x.baz, &x.baz)
|
2016-03-17 03:15:06 -05:00
|
|
|
//~^ ERROR E0312
|
|
|
|
//~| ERROR cannot infer
|
|
|
|
//~| ERROR cannot infer
|
2014-08-27 20:46:52 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|