1 // run-pass
2 // Test that `Box<Test>` is equivalent to `Box<Test+'static>`, both in
3 // fields and fn arguments.
4 
5 // pretty-expanded FIXME #23616
6 
7 #![allow(dead_code)]
8 
9 trait Test {
foo(&self)10     fn foo(&self) { }
11 }
12 
13 struct SomeStruct {
14     t: Box<dyn Test>,
15     u: Box<dyn Test+'static>,
16 }
17 
a(t: Box<dyn Test>, mut ss: SomeStruct)18 fn a(t: Box<dyn Test>, mut ss: SomeStruct) {
19     ss.t = t;
20 }
21 
b(t: Box<dyn Test+'static>, mut ss: SomeStruct)22 fn b(t: Box<dyn Test+'static>, mut ss: SomeStruct) {
23     ss.t = t;
24 }
25 
c(t: Box<dyn Test>, mut ss: SomeStruct)26 fn c(t: Box<dyn Test>, mut ss: SomeStruct) {
27     ss.u = t;
28 }
29 
d(t: Box<dyn Test+'static>, mut ss: SomeStruct)30 fn d(t: Box<dyn Test+'static>, mut ss: SomeStruct) {
31     ss.u = t;
32 }
33 
main()34 fn main() {
35 }
36