]> git.proxmox.com Git - rustc.git/blame - src/test/run-pass/object-lifetime-default-default-to-static.rs
New upstream version 1.33.0+dfsg1
[rustc.git] / src / test / run-pass / object-lifetime-default-default-to-static.rs
CommitLineData
85aaf69f
SL
1// Test that `Box<Test>` is equivalent to `Box<Test+'static>`, both in
2// fields and fn arguments.
223e47cc 3
c34b1796
AL
4// pretty-expanded FIXME #23616
5
85aaf69f
SL
6#![allow(dead_code)]
7
8trait Test {
9 fn foo(&self) { }
10}
223e47cc 11
85aaf69f
SL
12struct SomeStruct {
13 t: Box<Test>,
14 u: Box<Test+'static>,
15}
223e47cc 16
85aaf69f
SL
17fn a(t: Box<Test>, mut ss: SomeStruct) {
18 ss.t = t;
19}
20
21fn b(t: Box<Test+'static>, mut ss: SomeStruct) {
22 ss.t = t;
23}
24
25fn c(t: Box<Test>, mut ss: SomeStruct) {
26 ss.u = t;
27}
28
29fn d(t: Box<Test+'static>, mut ss: SomeStruct) {
30 ss.u = t;
31}
32
33fn main() {
223e47cc 34}