2018-09-04 10:05:53 +00:00
|
|
|
//@ run-pass
|
2018-09-25 21:51:35 +00:00
|
|
|
#![allow(unused_imports)]
|
2014-09-07 05:31:41 +00: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 20:13:15 +00:00
|
|
|
//@ pretty-expanded FIXME #23616
|
|
|
|
|
2014-09-07 05:31:41 +00:00
|
|
|
#![allow(dead_code)]
|
2015-02-12 15:29:52 +00:00
|
|
|
|
|
|
|
use std::marker;
|
|
|
|
|
2014-09-07 05:31:41 +00:00
|
|
|
fn main() {
|
2015-02-18 23:58:07 +00:00
|
|
|
trait T { fn foo(&self) {} }
|
2014-09-07 05:31:41 +00:00
|
|
|
|
2019-05-28 18:47:21 +00:00
|
|
|
fn f<'a, V: T>(v: &'a V) -> &'a dyn T {
|
|
|
|
v as &'a dyn T
|
2014-09-07 05:31:41 +00:00
|
|
|
}
|
|
|
|
}
|