2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-05-24 02:06:33 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:59:11
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match mutex.lock().unwrap().foo() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | true => {
|
|
|
|
LL | mutex.lock().unwrap().bar();
|
2022-06-27 23:52:22 -05:00
|
|
|
| --------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
= note: `-D clippy::significant-drop-in-scrutinee` implied by `-D warnings`
|
2022-06-10 02:14:28 -05:00
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
|
|
|
LL ~ let value = mutex.lock().unwrap().foo();
|
|
|
|
LL ~ match value {
|
|
|
|
|
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:145:11
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match s.lock_m().get_the_value() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | println!("{}", s.lock_m().get_the_value());
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | }
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
|
|
|
LL ~ let value = s.lock_m().get_the_value();
|
|
|
|
LL ~ match value {
|
|
|
|
|
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:166:11
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match s.lock_m_m().get_the_value() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | println!("{}", s.lock_m().get_the_value());
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | }
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
|
|
|
LL ~ let value = s.lock_m_m().get_the_value();
|
|
|
|
LL ~ match value {
|
|
|
|
|
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:214:11
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match counter.temp_increment().len() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
|
|
|
LL ~ let value = counter.temp_increment().len();
|
|
|
|
LL ~ match value {
|
|
|
|
|
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:237:16
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match (mutex1.lock().unwrap().s.len(), true) {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | mutex1.lock().unwrap().s.len();
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
|
|
|
LL ~ let value = mutex1.lock().unwrap().s.len();
|
|
|
|
LL ~ match (value, true) {
|
|
|
|
|
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:246:22
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match (true, mutex1.lock().unwrap().s.len(), true) {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | mutex1.lock().unwrap().s.len();
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
|
|
|
LL ~ let value = mutex1.lock().unwrap().s.len();
|
|
|
|
LL ~ match (true, value, true) {
|
|
|
|
|
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:256:16
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match (mutex1.lock().unwrap().s.len(), true, mutex2.lock().unwrap().s.len()) {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | mutex1.lock().unwrap().s.len();
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | mutex2.lock().unwrap().s.len();
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
|
|
|
LL ~ let value = mutex1.lock().unwrap().s.len();
|
|
|
|
LL ~ match (value, true, mutex2.lock().unwrap().s.len()) {
|
|
|
|
|
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:256:54
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match (mutex1.lock().unwrap().s.len(), true, mutex2.lock().unwrap().s.len()) {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | mutex1.lock().unwrap().s.len();
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | mutex2.lock().unwrap().s.len();
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
|
|
|
LL ~ let value = mutex2.lock().unwrap().s.len();
|
|
|
|
LL ~ match (mutex1.lock().unwrap().s.len(), true, value) {
|
|
|
|
|
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:267:15
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match mutex3.lock().unwrap().s.as_str() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | mutex1.lock().unwrap().s.len();
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | mutex2.lock().unwrap().s.len();
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:277:22
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match (true, mutex3.lock().unwrap().s.as_str()) {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | mutex1.lock().unwrap().s.len();
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | mutex2.lock().unwrap().s.len();
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:296:11
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match mutex.lock().unwrap().s.len() > 1 {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | true => {
|
|
|
|
LL | mutex.lock().unwrap().s.len();
|
2022-06-27 23:52:22 -05:00
|
|
|
| --------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
|
|
|
LL ~ let value = mutex.lock().unwrap().s.len() > 1;
|
|
|
|
LL ~ match value {
|
|
|
|
|
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:303:11
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match 1 < mutex.lock().unwrap().s.len() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | true => {
|
|
|
|
LL | mutex.lock().unwrap().s.len();
|
2022-06-27 23:52:22 -05:00
|
|
|
| --------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
|
|
|
LL ~ let value = 1 < mutex.lock().unwrap().s.len();
|
|
|
|
LL ~ match value {
|
|
|
|
|
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:321:11
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match mutex1.lock().unwrap().s.len() < mutex2.lock().unwrap().s.len() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | mutex1.lock().unwrap().s.len(),
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | mutex2.lock().unwrap().s.len()
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
|
|
|
LL ~ let value = mutex1.lock().unwrap().s.len() < mutex2.lock().unwrap().s.len();
|
|
|
|
LL ~ match value {
|
|
|
|
|
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:332:11
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match mutex1.lock().unwrap().s.len() >= mutex2.lock().unwrap().s.len() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | mutex1.lock().unwrap().s.len(),
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | mutex2.lock().unwrap().s.len()
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
|
|
|
LL ~ let value = mutex1.lock().unwrap().s.len() >= mutex2.lock().unwrap().s.len();
|
|
|
|
LL ~ match value {
|
|
|
|
|
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:367:11
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match get_mutex_guard().s.len() > 1 {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | true => {
|
|
|
|
LL | mutex1.lock().unwrap().s.len();
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
|
|
|
LL ~ let value = get_mutex_guard().s.len() > 1;
|
|
|
|
LL ~ match value {
|
|
|
|
|
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:384:11
|
2022-05-20 13:37:38 -05:00
|
|
|
|
|
|
|
|
LL | match match i {
|
|
|
|
| ___________^
|
|
|
|
LL | | 100 => mutex1.lock().unwrap(),
|
|
|
|
LL | | _ => mutex2.lock().unwrap(),
|
|
|
|
LL | | }
|
|
|
|
LL | | .s
|
|
|
|
LL | | .len()
|
|
|
|
LL | | > 1
|
|
|
|
| |___________^
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | mutex1.lock().unwrap().s.len();
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
2022-05-20 13:37:38 -05:00
|
|
|
LL ~ let value = match i {
|
|
|
|
LL + 100 => mutex1.lock().unwrap(),
|
|
|
|
LL + _ => mutex2.lock().unwrap(),
|
|
|
|
LL + }
|
|
|
|
LL + .s
|
|
|
|
LL + .len()
|
|
|
|
...
|
2022-02-18 00:02:22 -06:00
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:410:11
|
2022-05-20 13:37:38 -05:00
|
|
|
|
|
|
|
|
LL | match if i > 1 {
|
|
|
|
| ___________^
|
|
|
|
LL | | mutex1.lock().unwrap()
|
|
|
|
LL | | } else {
|
|
|
|
LL | | mutex2.lock().unwrap()
|
|
|
|
... |
|
|
|
|
LL | | .len()
|
|
|
|
LL | | > 1
|
|
|
|
| |___________^
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | mutex1.lock().unwrap().s.len();
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
2022-05-20 13:37:38 -05:00
|
|
|
LL ~ let value = if i > 1 {
|
|
|
|
LL + mutex1.lock().unwrap()
|
|
|
|
LL + } else {
|
|
|
|
LL + mutex2.lock().unwrap()
|
|
|
|
LL + }
|
|
|
|
LL + .s
|
|
|
|
...
|
2022-02-18 00:02:22 -06:00
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:464:11
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match s.lock().deref().deref() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | 0 | 1 => println!("Value was less than 2"),
|
|
|
|
LL | _ => println!("Value is {}", s.lock().deref()),
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
2022-06-10 02:14:28 -05:00
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match and create a copy
|
|
|
|
|
|
|
|
|
LL ~ let value = *s.lock().deref().deref();
|
|
|
|
LL ~ match value {
|
|
|
|
|
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:492:11
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match s.lock().deref().deref() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | matcher => println!("Value is {}", s.lock().deref()),
|
2022-06-27 23:52:22 -05:00
|
|
|
| ---------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | _ => println!("Value was not a match"),
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:511:11
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match mutex.lock().unwrap().i = i {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | _ => {
|
|
|
|
LL | println!("{}", mutex.lock().unwrap().i);
|
2022-06-27 23:52:22 -05:00
|
|
|
| --------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | },
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
|
|
|
LL ~ mutex.lock().unwrap().i = i;
|
|
|
|
LL ~ match () {
|
|
|
|
|
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:517:11
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match i = mutex.lock().unwrap().i {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | _ => {
|
|
|
|
LL | println!("{}", mutex.lock().unwrap().i);
|
2022-06-27 23:52:22 -05:00
|
|
|
| --------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | },
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
|
|
|
LL ~ i = mutex.lock().unwrap().i;
|
|
|
|
LL ~ match () {
|
|
|
|
|
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:523:11
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match mutex.lock().unwrap().i += 1 {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | _ => {
|
|
|
|
LL | println!("{}", mutex.lock().unwrap().i);
|
2022-06-27 23:52:22 -05:00
|
|
|
| --------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | },
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
|
|
|
LL ~ mutex.lock().unwrap().i += 1;
|
|
|
|
LL ~ match () {
|
|
|
|
|
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:529:11
|
2022-02-18 00:02:22 -06:00
|
|
|
|
|
|
|
|
LL | match i += mutex.lock().unwrap().i {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | _ => {
|
|
|
|
LL | println!("{}", mutex.lock().unwrap().i);
|
2022-06-27 23:52:22 -05:00
|
|
|
| --------------------- another value with significant `Drop` created here
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | },
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-02-18 00:02:22 -06:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
|
|
|
LL ~ i += mutex.lock().unwrap().i;
|
|
|
|
LL ~ match () {
|
|
|
|
|
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:592:11
|
2022-05-24 02:06:33 -05:00
|
|
|
|
|
|
|
|
LL | match rwlock.read().unwrap().to_number() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
...
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-22 23:34:49 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-05-24 02:06:33 -05:00
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `for` loop condition will live until the end of the `for` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:602:14
|
2022-05-24 02:06:33 -05:00
|
|
|
|
|
|
|
|
LL | for s in rwlock.read().unwrap().iter() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-06-10 02:14:28 -05:00
|
|
|
LL | println!("{}", s);
|
|
|
|
LL | }
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-22 23:34:49 -05:00
|
|
|
|
|
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-06-10 02:14:28 -05:00
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
|
2022-06-27 23:52:22 -05:00
|
|
|
--> $DIR/significant_drop_in_scrutinee.rs:617:11
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
|
|
|
LL | match mutex.lock().unwrap().foo() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
...
|
|
|
|
LL | };
|
2022-06-27 23:52:22 -05:00
|
|
|
| - temporary lives until here
|
2022-06-10 02:14:28 -05:00
|
|
|
|
|
2022-06-22 23:34:49 -05:00
|
|
|
= note: this might lead to deadlocks or other unexpected behavior
|
2022-06-10 02:14:28 -05:00
|
|
|
help: try moving the temporary above the match
|
|
|
|
|
|
|
|
|
LL ~ let value = mutex.lock().unwrap().foo();
|
|
|
|
LL ~ match value {
|
|
|
|
|
|
2022-05-24 02:06:33 -05:00
|
|
|
|
2022-06-10 02:14:28 -05:00
|
|
|
error: aborting due to 26 previous errors
|
2022-02-18 00:02:22 -06:00
|
|
|
|