|
| 1 | +error: used a type with a destructor in a zero-length repeat expression |
| 2 | + --> $DIR/lint-zero-repeat-with-drop.rs:14:13 |
| 3 | + | |
| 4 | +LL | let _ = [not_copy(); 0]; |
| 5 | + | ^^^^^^^^^^^^^^^ help: consider using an empty array expression: `[]` |
| 6 | + | |
| 7 | +note: the lint level is defined here |
| 8 | + --> $DIR/lint-zero-repeat-with-drop.rs:3:9 |
| 9 | + | |
| 10 | +LL | #![deny(zero_repeat_with_drop)] |
| 11 | + | ^^^^^^^^^^^^^^^^^^^^^ |
| 12 | + = note: the value used here has type `T`, which may have a destructor |
| 13 | + = note: a length of zero is used, which will cause the value to be dropped in a strange location |
| 14 | + |
| 15 | +error: used a type with a destructor in a zero-length repeat expression |
| 16 | + --> $DIR/lint-zero-repeat-with-drop.rs:15:13 |
| 17 | + | |
| 18 | +LL | let _ = [not_copy(); 1 - 1]; |
| 19 | + | ^^^^^^^^^^^^^^^^^^^ help: consider using an empty array expression: `[]` |
| 20 | + | |
| 21 | + = note: the value used here has type `T`, which may have a destructor |
| 22 | + = note: a length of zero is used, which will cause the value to be dropped in a strange location |
| 23 | + |
| 24 | +error: used a type with a destructor in a zero-length repeat expression |
| 25 | + --> $DIR/lint-zero-repeat-with-drop.rs:16:13 |
| 26 | + | |
| 27 | +LL | let _ = [not_copy(); ZERO]; |
| 28 | + | ^^^^^^^^^^^^^^^^^^ help: consider using an empty array expression: `[]` |
| 29 | + | |
| 30 | + = note: the value used here has type `T`, which may have a destructor |
| 31 | + = note: a length of zero is used, which will cause the value to be dropped in a strange location |
| 32 | + |
| 33 | +error: used a type with a destructor in a zero-length repeat expression |
| 34 | + --> $DIR/lint-zero-repeat-with-drop.rs:17:13 |
| 35 | + | |
| 36 | +LL | let _ = [Some(not_copy()); 0]; |
| 37 | + | ^^^^^^^^^^^^^^^^^^^^^ help: consider using an empty array expression: `[]` |
| 38 | + | |
| 39 | + = note: the value used here has type `std::option::Option<T>`, which may have a destructor |
| 40 | + = note: a length of zero is used, which will cause the value to be dropped in a strange location |
| 41 | + |
| 42 | +error: used a type with a destructor in a zero-length repeat expression |
| 43 | + --> $DIR/lint-zero-repeat-with-drop.rs:18:13 |
| 44 | + | |
| 45 | +LL | let _ = [None::<T>; 0]; |
| 46 | + | ^^^^^^^^^^^^^^ help: consider using an empty array expression: `[]` |
| 47 | + | |
| 48 | + = note: the value used here has type `std::option::Option<T>`, which may have a destructor |
| 49 | + = note: a length of zero is used, which will cause the value to be dropped in a strange location |
| 50 | + |
| 51 | +error: used a type with a destructor in a zero-length repeat expression |
| 52 | + --> $DIR/lint-zero-repeat-with-drop.rs:19:13 |
| 53 | + | |
| 54 | +LL | let _ = [make_val(not_copy()); 0]; |
| 55 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an empty array expression: `[]` |
| 56 | + | |
| 57 | + = note: the value used here has type `T`, which may have a destructor |
| 58 | + = note: a length of zero is used, which will cause the value to be dropped in a strange location |
| 59 | + |
| 60 | +error: used a type with a destructor in a zero-length repeat expression |
| 61 | + --> $DIR/lint-zero-repeat-with-drop.rs:20:13 |
| 62 | + | |
| 63 | +LL | let _ = [String::new(); 0]; |
| 64 | + | ^^^^^^^^^^^^^^^^^^ help: consider using an empty array expression: `[]` |
| 65 | + | |
| 66 | + = note: the value used here has type `std::string::String`, which may have a destructor |
| 67 | + = note: a length of zero is used, which will cause the value to be dropped in a strange location |
| 68 | + |
| 69 | +error: used a type with a destructor in a zero-length repeat expression |
| 70 | + --> $DIR/lint-zero-repeat-with-drop.rs:21:13 |
| 71 | + | |
| 72 | +LL | let _ = [WithDropGlue(String::new()); 0]; |
| 73 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an empty array expression: `[]` |
| 74 | + | |
| 75 | + = note: the value used here has type `WithDropGlue`, which may have a destructor |
| 76 | + = note: a length of zero is used, which will cause the value to be dropped in a strange location |
| 77 | + |
| 78 | +error: aborting due to 8 previous errors |
| 79 | + |
0 commit comments