From 4bd6ebcc31bc68925742d2cb21095b5c76e7976c Mon Sep 17 00:00:00 2001 From: Ayush Kumar Mishra Date: Sat, 14 Mar 2020 16:01:03 +0530 Subject: Add long error explanation for E0634 #61137 --- src/librustc_error_codes/error_codes/E0634.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/librustc_error_codes/error_codes/E0634.md (limited to 'src/librustc_error_codes/error_codes') diff --git a/src/librustc_error_codes/error_codes/E0634.md b/src/librustc_error_codes/error_codes/E0634.md new file mode 100644 index 00000000000..5057aa6094e --- /dev/null +++ b/src/librustc_error_codes/error_codes/E0634.md @@ -0,0 +1,20 @@ +A type has conflicting `packed` representation hint. + +Erroneous code examples: + +```compile_fail,E0634 +#[repr(packed, packed(2))] // error! +struct Company(i32); + +#[repr(packed(2))] // error! +#[repr(packed)] +struct Company(i32); +``` + +You cannot use conflicting `packed` hint on a same type. If you want to pack a +type to a given size, you should provide a size to packed: + +``` +#[repr(packed)] // ok! +struct Company(i32); +``` -- cgit 1.4.1-3-g733a5