1 // check-pass
2 #![allow(dead_code)]
3 // This test ensures that each pointer type `P<X>` is covariant in `X`.
4 
5 use std::rc::Rc;
6 use std::sync::Arc;
7 
a<'r>(x: Box<&'static str>) -> Box<&'r str>8 fn a<'r>(x: Box<&'static str>) -> Box<&'r str> {
9     x
10 }
11 
b<'r, 'w>(x: &'w &'static str) -> &'w &'r str12 fn b<'r, 'w>(x: &'w &'static str) -> &'w &'r str {
13     x
14 }
15 
c<'r>(x: Arc<&'static str>) -> Arc<&'r str>16 fn c<'r>(x: Arc<&'static str>) -> Arc<&'r str> {
17     x
18 }
19 
d<'r>(x: Rc<&'static str>) -> Rc<&'r str>20 fn d<'r>(x: Rc<&'static str>) -> Rc<&'r str> {
21     x
22 }
23 
main()24 fn main() {}
25