|
| 1 | +error: calls to `std::mem::forget` with a reference instead of an owned value does nothing |
| 2 | + --> $DIR/forgetting_references-can-fixed.rs:11:5 |
| 3 | + | |
| 4 | +LL | forget(&SomeStruct); |
| 5 | + | ^^^^^^^-----------^ |
| 6 | + | | |
| 7 | + | argument has type `&SomeStruct` |
| 8 | + | |
| 9 | +note: the lint level is defined here |
| 10 | + --> $DIR/forgetting_references-can-fixed.rs:4:9 |
| 11 | + | |
| 12 | +LL | #![deny(forgetting_references)] |
| 13 | + | ^^^^^^^^^^^^^^^^^^^^^ |
| 14 | +help: use `let _ = ...` to ignore the expression or result |
| 15 | + | |
| 16 | +LL - forget(&SomeStruct); |
| 17 | +LL + let _ = &SomeStruct; |
| 18 | + | |
| 19 | + |
| 20 | +error: calls to `std::mem::forget` with a reference instead of an owned value does nothing |
| 21 | + --> $DIR/forgetting_references-can-fixed.rs:14:5 |
| 22 | + | |
| 23 | +LL | forget(&owned); |
| 24 | + | ^^^^^^^------^ |
| 25 | + | | |
| 26 | + | argument has type `&SomeStruct` |
| 27 | + | |
| 28 | +help: use `let _ = ...` to ignore the expression or result |
| 29 | + | |
| 30 | +LL - forget(&owned); |
| 31 | +LL + let _ = &owned; |
| 32 | + | |
| 33 | + |
| 34 | +error: calls to `std::mem::forget` with a reference instead of an owned value does nothing |
| 35 | + --> $DIR/forgetting_references-can-fixed.rs:15:5 |
| 36 | + | |
| 37 | +LL | forget(&&owned); |
| 38 | + | ^^^^^^^-------^ |
| 39 | + | | |
| 40 | + | argument has type `&&SomeStruct` |
| 41 | + | |
| 42 | +help: use `let _ = ...` to ignore the expression or result |
| 43 | + | |
| 44 | +LL - forget(&&owned); |
| 45 | +LL + let _ = &&owned; |
| 46 | + | |
| 47 | + |
| 48 | +error: calls to `std::mem::forget` with a reference instead of an owned value does nothing |
| 49 | + --> $DIR/forgetting_references-can-fixed.rs:16:5 |
| 50 | + | |
| 51 | +LL | forget(&mut owned); |
| 52 | + | ^^^^^^^----------^ |
| 53 | + | | |
| 54 | + | argument has type `&mut SomeStruct` |
| 55 | + | |
| 56 | +help: use `let _ = ...` to ignore the expression or result |
| 57 | + | |
| 58 | +LL - forget(&mut owned); |
| 59 | +LL + let _ = &mut owned; |
| 60 | + | |
| 61 | + |
| 62 | +error: calls to `std::mem::forget` with a reference instead of an owned value does nothing |
| 63 | + --> $DIR/forgetting_references-can-fixed.rs:20:5 |
| 64 | + | |
| 65 | +LL | forget(&*reference1); |
| 66 | + | ^^^^^^^------------^ |
| 67 | + | | |
| 68 | + | argument has type `&SomeStruct` |
| 69 | + | |
| 70 | +help: use `let _ = ...` to ignore the expression or result |
| 71 | + | |
| 72 | +LL - forget(&*reference1); |
| 73 | +LL + let _ = &*reference1; |
| 74 | + | |
| 75 | + |
| 76 | +error: calls to `std::mem::forget` with a reference instead of an owned value does nothing |
| 77 | + --> $DIR/forgetting_references-can-fixed.rs:23:5 |
| 78 | + | |
| 79 | +LL | forget(reference2); |
| 80 | + | ^^^^^^^----------^ |
| 81 | + | | |
| 82 | + | argument has type `&mut SomeStruct` |
| 83 | + | |
| 84 | +help: use `let _ = ...` to ignore the expression or result |
| 85 | + | |
| 86 | +LL - forget(reference2); |
| 87 | +LL + let _ = reference2; |
| 88 | + | |
| 89 | + |
| 90 | +error: calls to `std::mem::forget` with a reference instead of an owned value does nothing |
| 91 | + --> $DIR/forgetting_references-can-fixed.rs:26:5 |
| 92 | + | |
| 93 | +LL | forget(reference3); |
| 94 | + | ^^^^^^^----------^ |
| 95 | + | | |
| 96 | + | argument has type `&SomeStruct` |
| 97 | + | |
| 98 | +help: use `let _ = ...` to ignore the expression or result |
| 99 | + | |
| 100 | +LL - forget(reference3); |
| 101 | +LL + let _ = reference3; |
| 102 | + | |
| 103 | + |
| 104 | +error: calls to `std::mem::forget` with a reference instead of an owned value does nothing |
| 105 | + --> $DIR/forgetting_references-can-fixed.rs:31:5 |
| 106 | + | |
| 107 | +LL | forget(&val); |
| 108 | + | ^^^^^^^----^ |
| 109 | + | | |
| 110 | + | argument has type `&T` |
| 111 | + | |
| 112 | +help: use `let _ = ...` to ignore the expression or result |
| 113 | + | |
| 114 | +LL - forget(&val); |
| 115 | +LL + let _ = &val; |
| 116 | + | |
| 117 | + |
| 118 | +error: calls to `std::mem::forget` with a reference instead of an owned value does nothing |
| 119 | + --> $DIR/forgetting_references-can-fixed.rs:39:5 |
| 120 | + | |
| 121 | +LL | std::mem::forget(&SomeStruct); |
| 122 | + | ^^^^^^^^^^^^^^^^^-----------^ |
| 123 | + | | |
| 124 | + | argument has type `&SomeStruct` |
| 125 | + | |
| 126 | +help: use `let _ = ...` to ignore the expression or result |
| 127 | + | |
| 128 | +LL - std::mem::forget(&SomeStruct); |
| 129 | +LL + let _ = &SomeStruct; |
| 130 | + | |
| 131 | + |
| 132 | +error: aborting due to 9 previous errors |
| 133 | + |
0 commit comments