rust/tests/ui/significant_drop_in_scrutinee.stderr
Preston From 41c7e4d382 Lint for significant drops who may have surprising lifetimes #1
author Preston From <prestonfrom@gmail.com> 1645164142 -0600
committer Preston From <prestonfrom@gmail.com> 1650005351 -0600
2022-05-06 21:48:17 -06:00

262 lines
8.2 KiB
Plaintext

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:263:22
|
LL | match (true, mutex3.lock().unwrap().s.as_str()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:282: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:289: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:305: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:312: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:343: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:360:11
|
LL | match match i { 100 => mutex1.lock().unwrap(), _ => mutex2.lock().unwrap() }.s.len() > 1 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try moving the temporary above the match
|
LL ~ let value = match i { 100 => mutex1.lock().unwrap(), _ => mutex2.lock().unwrap() }.s.len() > 1;
LL ~ match value {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:379:11
|
LL | match if i > 1 { mutex1.lock().unwrap() } else { mutex2.lock().unwrap() }.s.len() > 1 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try moving the temporary above the match
|
LL ~ let value = if i > 1 { mutex1.lock().unwrap() } else { mutex2.lock().unwrap() }.s.len() > 1;
LL ~ match value {
|
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:421: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:447:11
|
LL | match s.lock().deref().deref() {
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: temporary with significant drop in match scrutinee
--> $DIR/significant_drop_in_scrutinee.rs:467: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:473: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:479: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:485: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