2018-09-04 12:05:53 +02:00
|
|
|
// run-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(unused_imports)]
|
2014-09-07 01:31:41 -04:00
|
|
|
// This test verifies that casting from the same lifetime on a value
|
|
|
|
// to the same lifetime on a trait succeeds. See issue #10766.
|
|
|
|
|
2015-03-22 13:13:15 -07:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2014-09-07 01:31:41 -04:00
|
|
|
#![allow(dead_code)]
|
2015-02-12 10:29:52 -05:00
|
|
|
|
|
|
|
use std::marker;
|
|
|
|
|
2014-09-07 01:31:41 -04:00
|
|
|
fn main() {
|
2015-02-18 15:58:07 -08:00
|
|
|
trait T { fn foo(&self) {} }
|
2014-09-07 01:31:41 -04:00
|
|
|
|
2019-05-28 14:47:21 -04:00
|
|
|
fn f<'a, V: T>(v: &'a V) -> &'a dyn T {
|
|
|
|
v as &'a dyn T
|
2014-09-07 01:31:41 -04:00
|
|
|
}
|
|
|
|
}
|