rust/tests/ui/significant_drop_in_scrutinee.stderr

284 lines
8.3 KiB
Plaintext
Raw Normal View History

error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:57: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:130: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:151: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:199: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:222: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:231: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:241: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:241: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:252:15
|
LL | match mutex3.lock().unwrap().s.as_str() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:262:22
|
LL | match (true, mutex3.lock().unwrap().s.as_str()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:281: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:288: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:306: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:317: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:352: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:369: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:395: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:449: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:477:11
|
LL | match s.lock().deref().deref() {
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:496: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:502: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:508: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:514: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: aborting due to 23 previous errors