From dc39bf8efc06bda8f510d1d64ce3302acc7ac0a3 Mon Sep 17 00:00:00 2001 From: Jamilya Shurukhova Date: Thu, 16 Mar 2023 10:18:31 +0100 Subject: [PATCH 1/4] E0206 - added `union` to description --- compiler/rustc_error_codes/src/error_codes/E0206.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_error_codes/src/error_codes/E0206.md b/compiler/rustc_error_codes/src/error_codes/E0206.md index 4405a2149ce..a0a6c0ffdce 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0206.md +++ b/compiler/rustc_error_codes/src/error_codes/E0206.md @@ -1,5 +1,5 @@ The `Copy` trait was implemented on a type which is neither a struct nor an -enum. +enum nor a union. Erroneous code example: @@ -10,6 +10,6 @@ struct Bar; impl Copy for &'static mut Bar { } // error! ``` -You can only implement `Copy` for a struct or an enum. +You can only implement `Copy` for a struct, a union, or an enum. The previous example will fail because `&'static mut Bar` is not a struct or enum. From 1f12c3e397dd36c8ad7ea376f7e5a2aaaa3b7a26 Mon Sep 17 00:00:00 2001 From: Jamilya Shurukhova Date: Thu, 16 Mar 2023 10:26:34 +0100 Subject: [PATCH 2/4] E0206 - removed space --- compiler/rustc_error_codes/src/error_codes/E0206.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_error_codes/src/error_codes/E0206.md b/compiler/rustc_error_codes/src/error_codes/E0206.md index a0a6c0ffdce..b3e5d6e28d8 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0206.md +++ b/compiler/rustc_error_codes/src/error_codes/E0206.md @@ -1,5 +1,4 @@ -The `Copy` trait was implemented on a type which is neither a struct nor an -enum nor a union. +The `Copy` trait was implemented on a type which is neither a struct nor an enum nor a union. Erroneous code example: From 05dc132adb94c0583423ea0cbe25c67af4fdb1dd Mon Sep 17 00:00:00 2001 From: Jamilya Shurukhova Date: Fri, 17 Mar 2023 14:54:39 +0100 Subject: [PATCH 3/4] E0206 - code review changes --- compiler/rustc_error_codes/src/error_codes/E0206.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_error_codes/src/error_codes/E0206.md b/compiler/rustc_error_codes/src/error_codes/E0206.md index b3e5d6e28d8..8658b5a858a 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0206.md +++ b/compiler/rustc_error_codes/src/error_codes/E0206.md @@ -1,4 +1,5 @@ -The `Copy` trait was implemented on a type which is neither a struct nor an enum nor a union. +The `Copy` trait was implemented on a type which is neither a struct, an +enum, nor a union. Erroneous code example: @@ -9,6 +10,6 @@ struct Bar; impl Copy for &'static mut Bar { } // error! ``` -You can only implement `Copy` for a struct, a union, or an enum. +You can only implement `Copy` for a struct, an enum, or a union. The previous example will fail because `&'static mut Bar` -is not a struct or enum. +is not a struct, an enum, or a union. From c4bb47ac36aa3975160ba8fb72978202e436a2f9 Mon Sep 17 00:00:00 2001 From: Jamilya Shurukhova Date: Fri, 17 Mar 2023 15:50:37 +0100 Subject: [PATCH 4/4] Update compiler/rustc_error_codes/src/error_codes/E0206.md Co-authored-by: Waffle Maybe --- compiler/rustc_error_codes/src/error_codes/E0206.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_error_codes/src/error_codes/E0206.md b/compiler/rustc_error_codes/src/error_codes/E0206.md index 8658b5a858a..9e85234bdbb 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0206.md +++ b/compiler/rustc_error_codes/src/error_codes/E0206.md @@ -1,4 +1,4 @@ -The `Copy` trait was implemented on a type which is neither a struct, an +The `Copy` trait was implemented on a type which is neither a struct, an enum, nor a union. Erroneous code example: