rust-clippy/tests/ui/significant_drop_in_scrutinee.stderr

296 lines
8.7 KiB
Text
Raw Normal View History

error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:59:11
|
LL | match mutex.lock().unwrap().foo() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::significant-drop-in-scrutinee` implied by `-D warnings`
help: try moving the temporary above the match
|
LL ~ let value = mutex.lock().unwrap().foo();
LL ~ match value {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:132:11
|
LL | match s.lock_m().get_the_value() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try moving the temporary above the match
|
LL ~ let value = s.lock_m().get_the_value();
LL ~ match value {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:153:11
|
LL | match s.lock_m_m().get_the_value() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try moving the temporary above the match
|
LL ~ let value = s.lock_m_m().get_the_value();
LL ~ match value {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:201:11
|
LL | match counter.temp_increment().len() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try moving the temporary above the match
|
LL ~ let value = counter.temp_increment().len();
LL ~ match value {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:224:16
|
LL | match (mutex1.lock().unwrap().s.len(), true) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try moving the temporary above the match
|
LL ~ let value = mutex1.lock().unwrap().s.len();
LL ~ match (value, true) {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:233:22
|
LL | match (true, mutex1.lock().unwrap().s.len(), true) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try moving the temporary above the match
|
LL ~ let value = mutex1.lock().unwrap().s.len();
LL ~ match (true, value, true) {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:243:16
|
LL | match (mutex1.lock().unwrap().s.len(), true, mutex2.lock().unwrap().s.len()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
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()) {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:243:54
|
LL | match (mutex1.lock().unwrap().s.len(), true, mutex2.lock().unwrap().s.len()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
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) {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:254:15
|
LL | match mutex3.lock().unwrap().s.as_str() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:264:22
|
LL | match (true, mutex3.lock().unwrap().s.as_str()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:283:11
|
LL | match mutex.lock().unwrap().s.len() > 1 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try moving the temporary above the match
|
LL ~ let value = mutex.lock().unwrap().s.len() > 1;
LL ~ match value {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:290:11
|
LL | match 1 < mutex.lock().unwrap().s.len() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try moving the temporary above the match
|
LL ~ let value = 1 < mutex.lock().unwrap().s.len();
LL ~ match value {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:308:11
|
LL | match mutex1.lock().unwrap().s.len() < mutex2.lock().unwrap().s.len() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try moving the temporary above the match
|
LL ~ let value = mutex1.lock().unwrap().s.len() < mutex2.lock().unwrap().s.len();
LL ~ match value {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:319:11
|
LL | match mutex1.lock().unwrap().s.len() >= mutex2.lock().unwrap().s.len() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try moving the temporary above the match
|
LL ~ let value = mutex1.lock().unwrap().s.len() >= mutex2.lock().unwrap().s.len();
LL ~ match value {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:354:11
|
LL | match get_mutex_guard().s.len() > 1 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try moving the temporary above the match
|
LL ~ let value = get_mutex_guard().s.len() > 1;
LL ~ match value {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:371:11
|
LL | match match i {
| ___________^
LL | | 100 => mutex1.lock().unwrap(),
LL | | _ => mutex2.lock().unwrap(),
LL | | }
LL | | .s
LL | | .len()
LL | | > 1
| |___________^
|
help: try moving the temporary above the match
|
LL ~ let value = match i {
LL + 100 => mutex1.lock().unwrap(),
LL + _ => mutex2.lock().unwrap(),
LL + }
LL + .s
LL + .len()
...
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:397:11
|
LL | match if i > 1 {
| ___________^
LL | | mutex1.lock().unwrap()
LL | | } else {
LL | | mutex2.lock().unwrap()
... |
LL | | .len()
LL | | > 1
| |___________^
|
help: try moving the temporary above the match
|
LL ~ let value = if i > 1 {
LL + mutex1.lock().unwrap()
LL + } else {
LL + mutex2.lock().unwrap()
LL + }
LL + .s
...
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:451:11
|
LL | match s.lock().deref().deref() {
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try moving the temporary above the match and create a copy
|
LL ~ let value = *s.lock().deref().deref();
LL ~ match value {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:479:11
|
LL | match s.lock().deref().deref() {
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:498:11
|
LL | match mutex.lock().unwrap().i = i {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try moving the temporary above the match
|
LL ~ mutex.lock().unwrap().i = i;
LL ~ match () {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:504:11
|
LL | match i = mutex.lock().unwrap().i {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try moving the temporary above the match
|
LL ~ i = mutex.lock().unwrap().i;
LL ~ match () {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:510:11
|
LL | match mutex.lock().unwrap().i += 1 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try moving the temporary above the match
|
LL ~ mutex.lock().unwrap().i += 1;
LL ~ match () {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:516:11
|
LL | match i += mutex.lock().unwrap().i {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try moving the temporary above the match
|
LL ~ i += mutex.lock().unwrap().i;
LL ~ match () {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:579:11
|
LL | match rwlock.read().unwrap().to_number() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: temporary with significant drop in for loop
--> $DIR/significant_drop_in_scrutinee.rs:589:14
|
LL | for s in rwlock.read().unwrap().iter() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 25 previous errors