]> git.lizzy.rs Git - rust.git/commitdiff
Suggest `#[repr(C)]` instead of `#[repr(C, packed, ...)]`
authorPotHix <pothix@pothix.com>
Fri, 8 Nov 2019 01:46:45 +0000 (22:46 -0300)
committerPotHix <pothix@pothix.com>
Fri, 8 Nov 2019 15:32:46 +0000 (12:32 -0300)
The code was previously suggesting `#[repr(C, packed, ...)]` for
incorrect uses of `repr` (e.g. `#[repr = "C"]`). This change suggests
the usage of `#[repr(C)]` instead.

r? @estebank

ref #61286

src/libsyntax/feature_gate/builtin_attrs.rs
src/test/ui/issues/issue-43988.stderr
src/test/ui/repr.stderr

index b32a887c6b2a2e456275b260fbec240f5588f2ac..157c755a1b116fec573d27faa3e9abed9199dacf 100644 (file)
@@ -231,7 +231,7 @@ macro_rules! experimental {
     ),
     ungated!(link_name, Whitelisted, template!(NameValueStr: "name")),
     ungated!(no_link, Normal, template!(Word)),
-    ungated!(repr, Normal, template!(List: "C, packed, ...")),
+    ungated!(repr, Normal, template!(List: "C")),
     ungated!(export_name, Whitelisted, template!(NameValueStr: "name")),
     ungated!(link_section, Whitelisted, template!(NameValueStr: "name")),
     ungated!(no_mangle, Whitelisted, template!(Word)),
index 339c1a3b8f617f9e7e69f5b6d45401ee40dc7739..37e56168c1d64db1fe1ad416a0f0c095f87373cc 100644 (file)
@@ -2,13 +2,13 @@ error: malformed `repr` attribute input
   --> $DIR/issue-43988.rs:24:5
    |
 LL |     #[repr]
-   |     ^^^^^^^ help: must be of the form: `#[repr(C, packed, ...)]`
+   |     ^^^^^^^ help: must be of the form: `#[repr(C)]`
 
 error: malformed `repr` attribute input
   --> $DIR/issue-43988.rs:35:14
    |
 LL |     let _z = #[repr] 1;
-   |              ^^^^^^^ help: must be of the form: `#[repr(C, packed, ...)]`
+   |              ^^^^^^^ help: must be of the form: `#[repr(C)]`
 
 error[E0518]: attribute should be applied to function or closure
   --> $DIR/issue-43988.rs:5:5
index e756510a437c844ab8ed6925683e4a6a8d5730e3..e0bec666381cf02cf4923b44f759d1f1236e5932 100644 (file)
@@ -2,19 +2,19 @@ error: malformed `repr` attribute input
   --> $DIR/repr.rs:1:1
    |
 LL | #[repr]
-   | ^^^^^^^ help: must be of the form: `#[repr(C, packed, ...)]`
+   | ^^^^^^^ help: must be of the form: `#[repr(C)]`
 
 error: malformed `repr` attribute input
   --> $DIR/repr.rs:4:1
    |
 LL | #[repr = "B"]
-   | ^^^^^^^^^^^^^ help: must be of the form: `#[repr(C, packed, ...)]`
+   | ^^^^^^^^^^^^^ help: must be of the form: `#[repr(C)]`
 
 error: malformed `repr` attribute input
   --> $DIR/repr.rs:7:1
    |
 LL | #[repr = "C"]
-   | ^^^^^^^^^^^^^ help: must be of the form: `#[repr(C, packed, ...)]`
+   | ^^^^^^^^^^^^^ help: must be of the form: `#[repr(C)]`
 
 error: aborting due to 3 previous errors