1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // pretty-expanded FIXME #23616
15 // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
17 trait Foo { fn dummy(&self) { }
}
19 fn foo(_
: [&Foo
; 2]) {}
20 fn foos(_
: &[&Foo
]) {}
21 fn foog
<T
>(_
: &[T
], _
: &[T
]) {}
23 fn bar(_
: [Box
<Foo
>; 2]) {}
24 fn bars(_
: &[Box
<Foo
+'
static>]) {}
27 let x
: [&Foo
; 2] = [&1, &2];
32 let x
: [&Foo
; 2] = [r
; 2];
36 let x
: &[&Foo
] = &[&1, &2];
40 let x
: &[&Foo
] = &[&1, &2];
44 let x
: [Box
<Foo
>; 2] = [Box
::new(1), Box
::new(2)];
46 bar([Box
::new(1), Box
::new(2)]);
48 let x
: &[Box
<Foo
+'
static>] = &[Box
::new(1), Box
::new(2)];
50 bars(&[Box
::new(1), Box
::new(2)]);
52 let x
: &[Box
<Foo
+'
static>] = &[Box
::new(1), Box
::new(2)];
53 foog(x
, &[Box
::new(1)]);
65 let x
: [&Foo
; 2] = [&1, &2];
77 let r
: [&Foo
; 2] = [r
; 2];
81 let x
: [&Foo
; 2] = [&1, &2];
87 t
: &'a
[Box
<Foo
+'
static>]
90 t
: &[Box
::new(1), Box
::new(2)]
92 let x
: [Box
<Foo
>; 2] = [Box
::new(1), Box
::new(2)];