From e9990bc65f8e44fd2843478ac685bb79c0a50ed0 Mon Sep 17 00:00:00 2001 From: Andy Russell Date: Thu, 2 Jan 2020 22:24:21 -0500 Subject: clarify that `Drop` can be implemented for enums and unions too --- src/test/ui/error-codes/E0117.rs | 3 +-- src/test/ui/error-codes/E0117.stderr | 4 ++-- src/test/ui/error-codes/E0120.stderr | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'src/test/ui/error-codes') diff --git a/src/test/ui/error-codes/E0117.rs b/src/test/ui/error-codes/E0117.rs index 18dd809f3ff..dbbac514801 100644 --- a/src/test/ui/error-codes/E0117.rs +++ b/src/test/ui/error-codes/E0117.rs @@ -1,6 +1,5 @@ impl Drop for u32 {} //~ ERROR E0117 -//~| ERROR the Drop trait may only be implemented on structures -//~| implementing Drop requires a struct +//~| ERROR the `Drop` trait may only be implemented for structs, enums, and unions fn main() { } diff --git a/src/test/ui/error-codes/E0117.stderr b/src/test/ui/error-codes/E0117.stderr index f0cfc8a2533..b48a1d8e50d 100644 --- a/src/test/ui/error-codes/E0117.stderr +++ b/src/test/ui/error-codes/E0117.stderr @@ -1,8 +1,8 @@ -error[E0120]: the Drop trait may only be implemented on structures +error[E0120]: the `Drop` trait may only be implemented for structs, enums, and unions --> $DIR/E0117.rs:1:15 | LL | impl Drop for u32 {} - | ^^^ implementing Drop requires a struct + | ^^^ must be a struct, enum, or union error[E0117]: only traits defined in the current crate can be implemented for arbitrary types --> $DIR/E0117.rs:1:1 diff --git a/src/test/ui/error-codes/E0120.stderr b/src/test/ui/error-codes/E0120.stderr index 68ca7d800d5..6c306455e42 100644 --- a/src/test/ui/error-codes/E0120.stderr +++ b/src/test/ui/error-codes/E0120.stderr @@ -1,8 +1,8 @@ -error[E0120]: the Drop trait may only be implemented on structures +error[E0120]: the `Drop` trait may only be implemented for structs, enums, and unions --> $DIR/E0120.rs:3:15 | LL | impl Drop for dyn MyTrait { - | ^^^^^^^^^^^ implementing Drop requires a struct + | ^^^^^^^^^^^ must be a struct, enum, or union error: aborting due to previous error -- cgit 1.4.1-3-g733a5