mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-15 01:55:03 +00:00
148 lines
5.5 KiB
Plaintext
148 lines
5.5 KiB
Plaintext
error: usage of `Box<Rc<T>>`
|
|
--> $DIR/redundant_allocation.rs:25:30
|
|
|
|
|
LL | pub fn box_test6<T>(foo: Box<Rc<T>>) {}
|
|
| ^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::redundant-allocation` implied by `-D warnings`
|
|
= note: `Rc<T>` is already on the heap, `Box<Rc<T>>` makes an extra allocation
|
|
= help: consider using just `Box<T>` or `Rc<T>`
|
|
|
|
error: usage of `Box<Arc<T>>`
|
|
--> $DIR/redundant_allocation.rs:27:30
|
|
|
|
|
LL | pub fn box_test7<T>(foo: Box<Arc<T>>) {}
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= note: `Arc<T>` is already on the heap, `Box<Arc<T>>` makes an extra allocation
|
|
= help: consider using just `Box<T>` or `Arc<T>`
|
|
|
|
error: usage of `Box<Rc<SubT<usize>>>`
|
|
--> $DIR/redundant_allocation.rs:29:27
|
|
|
|
|
LL | pub fn box_test8() -> Box<Rc<SubT<usize>>> {
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `Rc<SubT<usize>>` is already on the heap, `Box<Rc<SubT<usize>>>` makes an extra allocation
|
|
= help: consider using just `Box<SubT<usize>>` or `Rc<SubT<usize>>`
|
|
|
|
error: usage of `Box<Arc<T>>`
|
|
--> $DIR/redundant_allocation.rs:33:30
|
|
|
|
|
LL | pub fn box_test9<T>(foo: Box<Arc<T>>) -> Box<Arc<SubT<T>>> {
|
|
| ^^^^^^^^^^^
|
|
|
|
|
= note: `Arc<T>` is already on the heap, `Box<Arc<T>>` makes an extra allocation
|
|
= help: consider using just `Box<T>` or `Arc<T>`
|
|
|
|
error: usage of `Box<Arc<SubT<T>>>`
|
|
--> $DIR/redundant_allocation.rs:33:46
|
|
|
|
|
LL | pub fn box_test9<T>(foo: Box<Arc<T>>) -> Box<Arc<SubT<T>>> {
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `Arc<SubT<T>>` is already on the heap, `Box<Arc<SubT<T>>>` makes an extra allocation
|
|
= help: consider using just `Box<SubT<T>>` or `Arc<SubT<T>>`
|
|
|
|
error: usage of `Rc<Box<bool>>`
|
|
--> $DIR/redundant_allocation.rs:46:24
|
|
|
|
|
LL | pub fn rc_test5(a: Rc<Box<bool>>) {}
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= note: `Box<bool>` is already on the heap, `Rc<Box<bool>>` makes an extra allocation
|
|
= help: consider using just `Rc<bool>` or `Box<bool>`
|
|
|
|
error: usage of `Rc<Arc<bool>>`
|
|
--> $DIR/redundant_allocation.rs:48:24
|
|
|
|
|
LL | pub fn rc_test7(a: Rc<Arc<bool>>) {}
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= note: `Arc<bool>` is already on the heap, `Rc<Arc<bool>>` makes an extra allocation
|
|
= help: consider using just `Rc<bool>` or `Arc<bool>`
|
|
|
|
error: usage of `Rc<Box<SubT<usize>>>`
|
|
--> $DIR/redundant_allocation.rs:50:26
|
|
|
|
|
LL | pub fn rc_test8() -> Rc<Box<SubT<usize>>> {
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `Box<SubT<usize>>` is already on the heap, `Rc<Box<SubT<usize>>>` makes an extra allocation
|
|
= help: consider using just `Rc<SubT<usize>>` or `Box<SubT<usize>>`
|
|
|
|
error: usage of `Rc<Arc<T>>`
|
|
--> $DIR/redundant_allocation.rs:54:29
|
|
|
|
|
LL | pub fn rc_test9<T>(foo: Rc<Arc<T>>) -> Rc<Arc<SubT<T>>> {
|
|
| ^^^^^^^^^^
|
|
|
|
|
= note: `Arc<T>` is already on the heap, `Rc<Arc<T>>` makes an extra allocation
|
|
= help: consider using just `Rc<T>` or `Arc<T>`
|
|
|
|
error: usage of `Rc<Arc<SubT<T>>>`
|
|
--> $DIR/redundant_allocation.rs:54:44
|
|
|
|
|
LL | pub fn rc_test9<T>(foo: Rc<Arc<T>>) -> Rc<Arc<SubT<T>>> {
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `Arc<SubT<T>>` is already on the heap, `Rc<Arc<SubT<T>>>` makes an extra allocation
|
|
= help: consider using just `Rc<SubT<T>>` or `Arc<SubT<T>>`
|
|
|
|
error: usage of `Arc<Box<bool>>`
|
|
--> $DIR/redundant_allocation.rs:67:25
|
|
|
|
|
LL | pub fn arc_test5(a: Arc<Box<bool>>) {}
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= note: `Box<bool>` is already on the heap, `Arc<Box<bool>>` makes an extra allocation
|
|
= help: consider using just `Arc<bool>` or `Box<bool>`
|
|
|
|
error: usage of `Arc<Rc<bool>>`
|
|
--> $DIR/redundant_allocation.rs:69:25
|
|
|
|
|
LL | pub fn arc_test6(a: Arc<Rc<bool>>) {}
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= note: `Rc<bool>` is already on the heap, `Arc<Rc<bool>>` makes an extra allocation
|
|
= help: consider using just `Arc<bool>` or `Rc<bool>`
|
|
|
|
error: usage of `Arc<Box<SubT<usize>>>`
|
|
--> $DIR/redundant_allocation.rs:71:27
|
|
|
|
|
LL | pub fn arc_test8() -> Arc<Box<SubT<usize>>> {
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `Box<SubT<usize>>` is already on the heap, `Arc<Box<SubT<usize>>>` makes an extra allocation
|
|
= help: consider using just `Arc<SubT<usize>>` or `Box<SubT<usize>>`
|
|
|
|
error: usage of `Arc<Rc<T>>`
|
|
--> $DIR/redundant_allocation.rs:75:30
|
|
|
|
|
LL | pub fn arc_test9<T>(foo: Arc<Rc<T>>) -> Arc<Rc<SubT<T>>> {
|
|
| ^^^^^^^^^^
|
|
|
|
|
= note: `Rc<T>` is already on the heap, `Arc<Rc<T>>` makes an extra allocation
|
|
= help: consider using just `Arc<T>` or `Rc<T>`
|
|
|
|
error: usage of `Arc<Rc<SubT<T>>>`
|
|
--> $DIR/redundant_allocation.rs:75:45
|
|
|
|
|
LL | pub fn arc_test9<T>(foo: Arc<Rc<T>>) -> Arc<Rc<SubT<T>>> {
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `Rc<SubT<T>>` is already on the heap, `Arc<Rc<SubT<T>>>` makes an extra allocation
|
|
= help: consider using just `Arc<SubT<T>>` or `Rc<SubT<T>>`
|
|
|
|
error: usage of `Rc<Box<Box<dyn T>>>`
|
|
--> $DIR/redundant_allocation.rs:97:27
|
|
|
|
|
LL | pub fn test_rc_box(_: Rc<Box<Box<dyn T>>>) {}
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `Box<Box<dyn T>>` is already on the heap, `Rc<Box<Box<dyn T>>>` makes an extra allocation
|
|
= help: consider using just `Rc<Box<dyn T>>` or `Box<Box<dyn T>>`
|
|
|
|
error: aborting due to 16 previous errors
|
|
|