rust/tests/ui/rc_clone_in_vec_init/rc.stderr

31 lines
1000 B
Plaintext
Raw Normal View History

2022-05-08 14:20:25 -05:00
error: calling `Rc::new` in `vec![elem; len]`
--> $DIR/rc.rs:8:13
|
LL | let v = vec![Rc::new("x".to_string()); 2];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::rc-clone-in-vec-init` implied by `-D warnings`
= note: each element will point to the same `Rc` instance
= help: if this is intentional, consider extracting the `Rc` initialization to a variable
= help: or if not, initialize each element individually
error: calling `Rc::new` in `vec![elem; len]`
--> $DIR/rc.rs:12:13
|
LL | let v = vec![
| _____________^
LL | | std::rc::Rc::new(Mutex::new({
LL | | let x = 1;
LL | | dbg!(x);
... |
LL | | 2
LL | | ];
| |_____^
|
= note: each element will point to the same `Rc` instance
= help: if this is intentional, consider extracting the `Rc` initialization to a variable
= help: or if not, initialize each element individually
error: aborting due to 2 previous errors