diff --git a/src/librustc_error_codes/error_codes.rs b/src/librustc_error_codes/error_codes.rs index 11d1209923fb2..73207dc241e07 100644 --- a/src/librustc_error_codes/error_codes.rs +++ b/src/librustc_error_codes/error_codes.rs @@ -380,6 +380,7 @@ E0689: include_str!("./error_codes/E0689.md"), E0690: include_str!("./error_codes/E0690.md"), E0691: include_str!("./error_codes/E0691.md"), E0692: include_str!("./error_codes/E0692.md"), +E0693: include_str!("./error_codes/E0693.md"), E0695: include_str!("./error_codes/E0695.md"), E0697: include_str!("./error_codes/E0697.md"), E0698: include_str!("./error_codes/E0698.md"), @@ -594,7 +595,6 @@ E0748: include_str!("./error_codes/E0748.md"), E0667, // `impl Trait` in projections E0687, // in-band lifetimes cannot be used in `fn`/`Fn` syntax E0688, // in-band lifetimes cannot be mixed with explicit lifetime binders - E0693, // incorrect `repr(align)` attribute format // E0694, // an unknown tool name found in scoped attributes E0696, // `continue` pointing to a labeled block // E0702, // replaced with a generic attribute input check diff --git a/src/librustc_error_codes/error_codes/E0693.md b/src/librustc_error_codes/error_codes/E0693.md new file mode 100644 index 0000000000000..43e9d17979e68 --- /dev/null +++ b/src/librustc_error_codes/error_codes/E0693.md @@ -0,0 +1,19 @@ +`align` representation hint was incorrectly declared. + +Erroneous code examples: + +```compile_fail,E0693 +#[repr(align=8)] // error! +struct Align8(i8); + +#[repr(align="8")] // error! +struct Align8(i8); +``` + +This is a syntax error at the level of attribute declarations. The proper +syntax for `align` representation hint is the following: + +``` +#[repr(align(8))] // ok! +struct Align8(i8); +``` diff --git a/src/test/ui/repr/repr-align-assign.stderr b/src/test/ui/repr/repr-align-assign.stderr index 192312d165bc8..b878ae0d17337 100644 --- a/src/test/ui/repr/repr-align-assign.stderr +++ b/src/test/ui/repr/repr-align-assign.stderr @@ -24,3 +24,4 @@ LL | #[repr(align="8")] error: aborting due to 4 previous errors +For more information about this error, try `rustc --explain E0693`.