|
| 1 | +error[E0446]: private type `My` in public interface |
| 2 | + --> $DIR/box_vec.rs:42:1 |
| 3 | + | |
| 4 | +LL | struct My {} |
| 5 | + | - `My` declared as private |
| 6 | +... |
| 7 | +LL | pub fn test5(foo: Box<&My>) {} |
| 8 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type |
| 9 | + |
| 10 | +error[E0446]: private type `OneOrTwo` in public interface |
| 11 | + --> $DIR/box_vec.rs:44:1 |
| 12 | + | |
| 13 | +LL | enum OneOrTwo { |
| 14 | + | - `OneOrTwo` declared as private |
| 15 | +... |
| 16 | +LL | pub fn test6(foo: Box<&OneOrTwo>) {} |
| 17 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type |
| 18 | + |
| 19 | +error[E0446]: private type `OneOrTwo` in public interface |
| 20 | + --> $DIR/box_vec.rs:46:1 |
| 21 | + | |
| 22 | +LL | enum OneOrTwo { |
| 23 | + | - `OneOrTwo` declared as private |
| 24 | +... |
| 25 | +LL | pub fn test7(foo: Box<&&OneOrTwo>) {} |
| 26 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type |
| 27 | + |
| 28 | +error[E0446]: private type `SubT<&usize>` in public interface |
| 29 | + --> $DIR/box_vec.rs:50:1 |
| 30 | + | |
| 31 | +LL | struct SubT<T> { |
| 32 | + | - `SubT<&usize>` declared as private |
| 33 | +... |
| 34 | +LL | pub fn test9(foo: Box<SubT<&usize>>) {} |
| 35 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type |
| 36 | + |
1 | 37 | error: you seem to be trying to use `Box<Vec<T>>`. Consider using just `Vec<T>`
|
2 |
| - --> $DIR/box_vec.rs:14:18 |
| 38 | + --> $DIR/box_vec.rs:25:18 |
3 | 39 | |
|
4 | 40 | LL | pub fn test(foo: Box<Vec<bool>>) {
|
5 | 41 | | ^^^^^^^^^^^^^^
|
6 | 42 | |
|
7 | 43 | = note: `-D clippy::box-vec` implied by `-D warnings`
|
8 | 44 | = help: `Vec<T>` is already on the heap, `Box<Vec<T>>` makes an extra allocation.
|
9 | 45 |
|
10 |
| -error: aborting due to previous error |
| 46 | +error: usage of `Box<&T>` |
| 47 | + --> $DIR/box_vec.rs:38:22 |
| 48 | + | |
| 49 | +LL | pub fn test3<T>(foo: Box<&T>) {} |
| 50 | + | ^^^^^^^ |
| 51 | + | |
| 52 | + = note: `-D clippy::box-borrow` implied by `-D warnings` |
| 53 | + = help: try `&T` |
| 54 | + |
| 55 | +error: usage of `Box<&T>` |
| 56 | + --> $DIR/box_vec.rs:40:19 |
| 57 | + | |
| 58 | +LL | pub fn test4(foo: Box<&usize>) {} |
| 59 | + | ^^^^^^^^^^^ |
| 60 | + | |
| 61 | + = help: try `&usize` |
| 62 | + |
| 63 | +error: usage of `Box<&T>` |
| 64 | + --> $DIR/box_vec.rs:42:19 |
| 65 | + | |
| 66 | +LL | pub fn test5(foo: Box<&My>) {} |
| 67 | + | ^^^^^^^^ |
| 68 | + | |
| 69 | + = help: try `&My` |
| 70 | + |
| 71 | +error: usage of `Box<&T>` |
| 72 | + --> $DIR/box_vec.rs:44:19 |
| 73 | + | |
| 74 | +LL | pub fn test6(foo: Box<&OneOrTwo>) {} |
| 75 | + | ^^^^^^^^^^^^^^ |
| 76 | + | |
| 77 | + = help: try `&OneOrTwo` |
| 78 | + |
| 79 | +error: usage of `Box<&T>` |
| 80 | + --> $DIR/box_vec.rs:46:19 |
| 81 | + | |
| 82 | +LL | pub fn test7(foo: Box<&&OneOrTwo>) {} |
| 83 | + | ^^^^^^^^^^^^^^^ |
| 84 | + | |
| 85 | + = help: try `&&OneOrTwo` |
| 86 | + |
| 87 | +error: usage of `Box<&T>` |
| 88 | + --> $DIR/box_vec.rs:48:23 |
| 89 | + | |
| 90 | +LL | pub fn test8(foo: Box<Box<&usize>>) {} |
| 91 | + | ^^^^^^^^^^^ |
| 92 | + | |
| 93 | + = help: try `&usize` |
| 94 | + |
| 95 | +error: aborting due to 11 previous errors |
11 | 96 |
|
| 97 | +For more information about this error, try `rustc --explain E0446`. |
0 commit comments