diff options
| author | Lucas Kent <rubickent@gmail.com> | 2021-11-14 22:04:25 +1100 |
|---|---|---|
| committer | Lucas Kent <rubickent@gmail.com> | 2021-11-15 00:04:34 +1100 |
| commit | f980f813e189b8568eab93311fcc4effa2cffec3 (patch) | |
| tree | ebecde56c5acc017031849f9af4f41026e6f784e /src/test/ui | |
| parent | f820d9d4e5af7d298ffdc3145b48e206b65e8e28 (diff) | |
| download | rust-f980f813e189b8568eab93311fcc4effa2cffec3.tar.gz rust-f980f813e189b8568eab93311fcc4effa2cffec3.zip | |
Improve ManuallyDrop suggestion
Diffstat (limited to 'src/test/ui')
5 files changed, 30 insertions, 40 deletions
diff --git a/src/test/ui/feature-gates/feature-gate-untagged_unions.stderr b/src/test/ui/feature-gates/feature-gate-untagged_unions.stderr index ed973871b3f..a9ccb835587 100644 --- a/src/test/ui/feature-gates/feature-gate-untagged_unions.stderr +++ b/src/test/ui/feature-gates/feature-gate-untagged_unions.stderr @@ -13,11 +13,10 @@ error[E0740]: unions may not contain fields that need dropping LL | a: String, | ^^^^^^^^^ | -note: `std::mem::ManuallyDrop` can be used to wrap the type - --> $DIR/feature-gate-untagged_unions.rs:16:5 +help: wrap the type with `std::mem::ManuallyDrop` and ensure it is manually dropped | -LL | a: String, - | ^^^^^^^^^ +LL | a: std::mem::ManuallyDrop<String>, + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0740]: unions may not contain fields that need dropping --> $DIR/feature-gate-untagged_unions.rs:24:5 @@ -25,11 +24,10 @@ error[E0740]: unions may not contain fields that need dropping LL | a: T, | ^^^^ | -note: `std::mem::ManuallyDrop` can be used to wrap the type - --> $DIR/feature-gate-untagged_unions.rs:24:5 +help: wrap the type with `std::mem::ManuallyDrop` and ensure it is manually dropped | -LL | a: T, - | ^^^^ +LL | a: std::mem::ManuallyDrop<T>, + | ~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 3 previous errors diff --git a/src/test/ui/union/issue-41073.stderr b/src/test/ui/union/issue-41073.stderr index 2e9598b2271..04b4286cc4b 100644 --- a/src/test/ui/union/issue-41073.stderr +++ b/src/test/ui/union/issue-41073.stderr @@ -4,11 +4,10 @@ error[E0740]: unions may not contain fields that need dropping LL | a: A, | ^^^^ | -note: `std::mem::ManuallyDrop` can be used to wrap the type - --> $DIR/issue-41073.rs:4:5 +help: wrap the type with `std::mem::ManuallyDrop` and ensure it is manually dropped | -LL | a: A, - | ^^^^ +LL | a: std::mem::ManuallyDrop<A>, + | ~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to previous error diff --git a/src/test/ui/union/union-custom-drop.stderr b/src/test/ui/union/union-custom-drop.stderr index ee2333f905f..0c59048f7fe 100644 --- a/src/test/ui/union/union-custom-drop.stderr +++ b/src/test/ui/union/union-custom-drop.stderr @@ -4,11 +4,10 @@ error[E0740]: unions may not contain fields that need dropping LL | bar: Bar, | ^^^^^^^^ | -note: `std::mem::ManuallyDrop` can be used to wrap the type - --> $DIR/union-custom-drop.rs:7:5 +help: wrap the type with `std::mem::ManuallyDrop` and ensure it is manually dropped | -LL | bar: Bar, - | ^^^^^^^^ +LL | bar: std::mem::ManuallyDrop<Bar>, + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to previous error diff --git a/src/test/ui/union/union-with-drop-fields.mirunsafeck.stderr b/src/test/ui/union/union-with-drop-fields.mirunsafeck.stderr index 2062fb7473f..8f3d30cd7ee 100644 --- a/src/test/ui/union/union-with-drop-fields.mirunsafeck.stderr +++ b/src/test/ui/union/union-with-drop-fields.mirunsafeck.stderr @@ -4,11 +4,10 @@ error[E0740]: unions may not contain fields that need dropping LL | a: String, | ^^^^^^^^^ | -note: `std::mem::ManuallyDrop` can be used to wrap the type - --> $DIR/union-with-drop-fields.rs:11:5 +help: wrap the type with `std::mem::ManuallyDrop` and ensure it is manually dropped | -LL | a: String, - | ^^^^^^^^^ +LL | a: std::mem::ManuallyDrop<String>, + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0740]: unions may not contain fields that need dropping --> $DIR/union-with-drop-fields.rs:19:5 @@ -16,11 +15,10 @@ error[E0740]: unions may not contain fields that need dropping LL | a: S, | ^^^^ | -note: `std::mem::ManuallyDrop` can be used to wrap the type - --> $DIR/union-with-drop-fields.rs:19:5 +help: wrap the type with `std::mem::ManuallyDrop` and ensure it is manually dropped | -LL | a: S, - | ^^^^ +LL | a: std::mem::ManuallyDrop<S>, + | ~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0740]: unions may not contain fields that need dropping --> $DIR/union-with-drop-fields.rs:24:5 @@ -28,11 +26,10 @@ error[E0740]: unions may not contain fields that need dropping LL | a: T, | ^^^^ | -note: `std::mem::ManuallyDrop` can be used to wrap the type - --> $DIR/union-with-drop-fields.rs:24:5 +help: wrap the type with `std::mem::ManuallyDrop` and ensure it is manually dropped | -LL | a: T, - | ^^^^ +LL | a: std::mem::ManuallyDrop<T>, + | ~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 3 previous errors diff --git a/src/test/ui/union/union-with-drop-fields.thirunsafeck.stderr b/src/test/ui/union/union-with-drop-fields.thirunsafeck.stderr index 2062fb7473f..8f3d30cd7ee 100644 --- a/src/test/ui/union/union-with-drop-fields.thirunsafeck.stderr +++ b/src/test/ui/union/union-with-drop-fields.thirunsafeck.stderr @@ -4,11 +4,10 @@ error[E0740]: unions may not contain fields that need dropping LL | a: String, | ^^^^^^^^^ | -note: `std::mem::ManuallyDrop` can be used to wrap the type - --> $DIR/union-with-drop-fields.rs:11:5 +help: wrap the type with `std::mem::ManuallyDrop` and ensure it is manually dropped | -LL | a: String, - | ^^^^^^^^^ +LL | a: std::mem::ManuallyDrop<String>, + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0740]: unions may not contain fields that need dropping --> $DIR/union-with-drop-fields.rs:19:5 @@ -16,11 +15,10 @@ error[E0740]: unions may not contain fields that need dropping LL | a: S, | ^^^^ | -note: `std::mem::ManuallyDrop` can be used to wrap the type - --> $DIR/union-with-drop-fields.rs:19:5 +help: wrap the type with `std::mem::ManuallyDrop` and ensure it is manually dropped | -LL | a: S, - | ^^^^ +LL | a: std::mem::ManuallyDrop<S>, + | ~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0740]: unions may not contain fields that need dropping --> $DIR/union-with-drop-fields.rs:24:5 @@ -28,11 +26,10 @@ error[E0740]: unions may not contain fields that need dropping LL | a: T, | ^^^^ | -note: `std::mem::ManuallyDrop` can be used to wrap the type - --> $DIR/union-with-drop-fields.rs:24:5 +help: wrap the type with `std::mem::ManuallyDrop` and ensure it is manually dropped | -LL | a: T, - | ^^^^ +LL | a: std::mem::ManuallyDrop<T>, + | ~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 3 previous errors |
