| author | bors <bors@rust-lang.org> 2026-05-30 17:09:19 UTC |
| committer | bors <bors@rust-lang.org> 2026-05-30 17:09:19 UTC |
| log | f8a08b688cbe60acc386ed1fbd1b7cbaaf5576b1 |
| tree | 66a4b62d07b8f928687102f29de606648b3b5557 |
| parent | c58275e0369d09fc3959b8ba87dcbcbe73797465 |
| parent | 62cc8069e99a83c3202d7c3106c1fcc091d21407 |
Rollup of 8 pull requests
Successful merges:
- rust-lang/rust#156863 (Make hint::cold_path #[cold] so that it works even if the MIR inliner can't inline it)
- rust-lang/rust#156875 (Correct and document semantics of `yield` terminator)
- rust-lang/rust#157115 ([rustdoc] Fix foreign items macro expansion)
- rust-lang/rust#157150 (Revert "drop derive helpers during ast lowering" )
- rust-lang/rust#156887 (Rename `-Zdebuginfo-for-profiling` switch)
- rust-lang/rust#157039 (rustdoc: correctly propagate cfgs for glob reexports)
- rust-lang/rust#157125 (Rewrite the `#[repr]` attribute parser)
- rust-lang/rust#157154 (Revert workaround used to select the gcc codegen in the coretests CI)65 files changed, 753 insertions(+), 650 deletions(-)
compiler/rustc_attr_parsing/src/attributes/prelude.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ pub(super) use rustc_hir::attrs::AttributeKind; |
| 6 | 6 | #[doc(hidden)] |
| 7 | 7 | pub(super) use rustc_hir::{MethodKind, Target}; |
| 8 | 8 | #[doc(hidden)] |
| 9 | pub(super) use rustc_span::{DUMMY_SP, Ident, Span, Symbol, sym}; | |
| 9 | pub(super) use rustc_span::{Ident, Span, Symbol, sym}; | |
| 10 | 10 | #[doc(hidden)] |
| 11 | 11 | pub(super) use thin_vec::ThinVec; |
| 12 | 12 |
compiler/rustc_attr_parsing/src/attributes/repr.rs+80-171| ... | ... | @@ -1,18 +1,20 @@ |
| 1 | 1 | use rustc_abi::{Align, Size}; |
| 2 | 2 | use rustc_ast::{IntTy, LitIntType, LitKind, UintTy}; |
| 3 | use rustc_hir::attrs::{IntType, ReprAttr}; | |
| 3 | use rustc_hir::attrs::IntType::{SignedInt, UnsignedInt}; | |
| 4 | use rustc_hir::attrs::ReprAttr; | |
| 4 | 5 | |
| 5 | 6 | use super::prelude::*; |
| 6 | use crate::session_diagnostics::{self, IncorrectReprFormatGenericCause}; | |
| 7 | use crate::session_diagnostics; | |
| 7 | 8 | |
| 8 | 9 | /// Parse #[repr(...)] forms. |
| 9 | 10 | /// |
| 10 | /// Valid repr contents: any of the primitive integral type names (see | |
| 11 | /// `int_type_of_word`, below) to specify enum discriminant type; `C`, to use | |
| 12 | /// the same discriminant size that the corresponding C enum would or C | |
| 13 | /// structure layout, `packed` to remove padding, and `transparent` to delegate representation | |
| 14 | /// concerns to the only non-ZST field. | |
| 15 | // FIXME(jdonszelmann): is a vec the right representation here even? isn't it just a struct? | |
| 11 | /// Valid repr contents: | |
| 12 | /// * any of the primitive integral type names to specify enum discriminant type | |
| 13 | /// * `Rust`, to use the default `Rust` layout of the type | |
| 14 | /// * `C`, to use the same layout for the type that C would use | |
| 15 | /// * `align(...)`, to change the alignment requirements of the type | |
| 16 | /// * `packed`, to remove padding | |
| 17 | /// * `transparent`, to delegate representation concerns to the only non-ZST field. | |
| 16 | 18 | pub(crate) struct ReprParser; |
| 17 | 19 | |
| 18 | 20 | impl CombineAttributeParser for ReprParser { |
| ... | ... | @@ -20,7 +22,6 @@ impl CombineAttributeParser for ReprParser { |
| 20 | 22 | const PATH: &[Symbol] = &[sym::repr]; |
| 21 | 23 | const CONVERT: ConvertFn<Self::Item> = |
| 22 | 24 | |items, first_span| AttributeKind::Repr { reprs: items, first_span }; |
| 23 | // FIXME(jdonszelmann): never used | |
| 24 | 25 | const TEMPLATE: AttributeTemplate = template!( |
| 25 | 26 | List: &["C", "Rust", "transparent", "align(...)", "packed(...)", "<integer type>"], |
| 26 | 27 | "https://doc.rust-lang.org/reference/type-layout.html#representations" |
| ... | ... | @@ -30,29 +31,24 @@ impl CombineAttributeParser for ReprParser { |
| 30 | 31 | cx: &mut AcceptContext<'_, '_>, |
| 31 | 32 | args: &ArgParser, |
| 32 | 33 | ) -> impl IntoIterator<Item = Self::Item> { |
| 33 | let mut reprs = Vec::new(); | |
| 34 | ||
| 35 | 34 | let Some(list) = cx.expect_list(args, cx.attr_span) else { |
| 36 | return reprs; | |
| 35 | return vec![]; | |
| 37 | 36 | }; |
| 38 | 37 | |
| 39 | 38 | if list.is_empty() { |
| 40 | 39 | let attr_span = cx.attr_span; |
| 41 | 40 | cx.adcx().warn_empty_attribute(attr_span); |
| 42 | return reprs; | |
| 41 | return vec![]; | |
| 43 | 42 | } |
| 44 | 43 | |
| 44 | let mut reprs = Vec::new(); | |
| 45 | 45 | for param in list.mixed() { |
| 46 | if let Some(_) = param.as_lit() { | |
| 47 | cx.emit_err(session_diagnostics::ReprIdent { span: cx.attr_span }); | |
| 46 | let Some(item) = param.meta_item() else { | |
| 47 | cx.adcx().expected_identifier(param.span()); | |
| 48 | 48 | continue; |
| 49 | } | |
| 50 | ||
| 51 | reprs.extend( | |
| 52 | param.meta_item().and_then(|mi| parse_repr(cx, &mi)).map(|r| (r, param.span())), | |
| 53 | ); | |
| 49 | }; | |
| 50 | reprs.extend(parse_repr(cx, &item).map(|r| (r, param.span()))); | |
| 54 | 51 | } |
| 55 | ||
| 56 | 52 | reprs |
| 57 | 53 | } |
| 58 | 54 | |
| ... | ... | @@ -61,122 +57,69 @@ impl CombineAttributeParser for ReprParser { |
| 61 | 57 | const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(ALL_TARGETS); |
| 62 | 58 | } |
| 63 | 59 | |
| 64 | macro_rules! int_pat { | |
| 65 | () => { | |
| 66 | sym::i8 | |
| 67 | | sym::u8 | |
| 68 | | sym::i16 | |
| 69 | | sym::u16 | |
| 70 | | sym::i32 | |
| 71 | | sym::u32 | |
| 72 | | sym::i64 | |
| 73 | | sym::u64 | |
| 74 | | sym::i128 | |
| 75 | | sym::u128 | |
| 76 | | sym::isize | |
| 77 | | sym::usize | |
| 78 | }; | |
| 79 | } | |
| 80 | ||
| 81 | fn int_type_of_word(s: Symbol) -> Option<IntType> { | |
| 82 | use IntType::*; | |
| 83 | ||
| 84 | match s { | |
| 85 | sym::i8 => Some(SignedInt(IntTy::I8)), | |
| 86 | sym::u8 => Some(UnsignedInt(UintTy::U8)), | |
| 87 | sym::i16 => Some(SignedInt(IntTy::I16)), | |
| 88 | sym::u16 => Some(UnsignedInt(UintTy::U16)), | |
| 89 | sym::i32 => Some(SignedInt(IntTy::I32)), | |
| 90 | sym::u32 => Some(UnsignedInt(UintTy::U32)), | |
| 91 | sym::i64 => Some(SignedInt(IntTy::I64)), | |
| 92 | sym::u64 => Some(UnsignedInt(UintTy::U64)), | |
| 93 | sym::i128 => Some(SignedInt(IntTy::I128)), | |
| 94 | sym::u128 => Some(UnsignedInt(UintTy::U128)), | |
| 95 | sym::isize => Some(SignedInt(IntTy::Isize)), | |
| 96 | sym::usize => Some(UnsignedInt(UintTy::Usize)), | |
| 97 | _ => None, | |
| 98 | } | |
| 99 | } | |
| 100 | ||
| 101 | fn parse_repr(cx: &AcceptContext<'_, '_>, param: &MetaItemParser) -> Option<ReprAttr> { | |
| 60 | fn parse_repr(cx: &mut AcceptContext<'_, '_>, param: &MetaItemParser) -> Option<ReprAttr> { | |
| 102 | 61 | use ReprAttr::*; |
| 103 | 62 | |
| 104 | // FIXME(jdonszelmann): invert the parsing here to match on the word first and then the | |
| 105 | // structure. | |
| 106 | let (name, ident_span) = if let Some(ident) = param.path().word() { | |
| 107 | (Some(ident.name), ident.span) | |
| 108 | } else { | |
| 109 | (None, DUMMY_SP) | |
| 110 | }; | |
| 111 | ||
| 112 | let args = param.args(); | |
| 113 | ||
| 114 | match (name, args) { | |
| 115 | (Some(sym::align), ArgParser::NoArgs) => { | |
| 116 | cx.emit_err(session_diagnostics::InvalidReprAlignNeedArg { span: ident_span }); | |
| 117 | None | |
| 118 | } | |
| 119 | (Some(sym::align), ArgParser::List(l)) => { | |
| 120 | parse_repr_align(cx, l, param.span(), AlignKind::Align) | |
| 121 | } | |
| 122 | ||
| 123 | (Some(sym::packed), ArgParser::NoArgs) => Some(ReprPacked(Align::ONE)), | |
| 124 | (Some(sym::packed), ArgParser::List(l)) => { | |
| 125 | parse_repr_align(cx, l, param.span(), AlignKind::Packed) | |
| 126 | } | |
| 127 | ||
| 128 | (Some(name @ sym::align | name @ sym::packed), ArgParser::NameValue(l)) => { | |
| 129 | cx.emit_err(session_diagnostics::IncorrectReprFormatGeneric { | |
| 130 | span: param.span(), | |
| 131 | // FIXME(jdonszelmann) can just be a string in the diag type | |
| 132 | repr_arg: name, | |
| 133 | cause: IncorrectReprFormatGenericCause::from_lit_kind( | |
| 134 | param.span(), | |
| 135 | &l.value_as_lit().kind, | |
| 136 | name, | |
| 137 | ), | |
| 138 | }); | |
| 139 | None | |
| 140 | } | |
| 141 | ||
| 142 | (Some(sym::Rust), ArgParser::NoArgs) => Some(ReprRust), | |
| 143 | (Some(sym::C), ArgParser::NoArgs) => Some(ReprC), | |
| 144 | (Some(sym::simd), ArgParser::NoArgs) => Some(ReprSimd), | |
| 145 | (Some(sym::transparent), ArgParser::NoArgs) => Some(ReprTransparent), | |
| 146 | (Some(name @ int_pat!()), ArgParser::NoArgs) => { | |
| 147 | // int_pat!() should make sure it always parses | |
| 148 | Some(ReprInt(int_type_of_word(name).unwrap())) | |
| 149 | } | |
| 63 | macro_rules! no_args { | |
| 64 | ($constructor: expr) => {{ | |
| 65 | cx.expect_no_args(param.args())?; | |
| 66 | Some($constructor) | |
| 67 | }}; | |
| 68 | } | |
| 150 | 69 | |
| 151 | ( | |
| 152 | Some( | |
| 153 | name @ sym::Rust | |
| 154 | | name @ sym::C | |
| 155 | | name @ sym::simd | |
| 156 | | name @ sym::transparent | |
| 157 | | name @ int_pat!(), | |
| 158 | ), | |
| 159 | ArgParser::NameValue(_), | |
| 160 | ) => { | |
| 161 | cx.emit_err(session_diagnostics::InvalidReprHintNoValue { span: param.span(), name }); | |
| 162 | None | |
| 163 | } | |
| 164 | ( | |
| 165 | Some( | |
| 166 | name @ sym::Rust | |
| 167 | | name @ sym::C | |
| 168 | | name @ sym::simd | |
| 169 | | name @ sym::transparent | |
| 170 | | name @ int_pat!(), | |
| 171 | ), | |
| 172 | ArgParser::List(_), | |
| 173 | ) => { | |
| 174 | cx.emit_err(session_diagnostics::InvalidReprHintNoParen { span: param.span(), name }); | |
| 175 | None | |
| 70 | match param.path().word_sym() { | |
| 71 | Some(sym::align) => { | |
| 72 | let l = cx.expect_list(param.args(), param.span())?; | |
| 73 | parse_repr_align(cx, l, AlignKind::Align) | |
| 176 | 74 | } |
| 177 | ||
| 75 | Some(sym::packed) => match param.args() { | |
| 76 | ArgParser::NoArgs => Some(ReprPacked(Align::ONE)), | |
| 77 | ArgParser::List(l) => parse_repr_align(cx, l, AlignKind::Packed), | |
| 78 | ArgParser::NameValue(_) => { | |
| 79 | cx.adcx().expected_list_or_no_args(param.span()); | |
| 80 | None | |
| 81 | } | |
| 82 | }, | |
| 83 | Some(sym::Rust) => no_args!(ReprRust), | |
| 84 | Some(sym::C) => no_args!(ReprC), | |
| 85 | Some(sym::simd) => no_args!(ReprSimd), | |
| 86 | Some(sym::transparent) => no_args!(ReprTransparent), | |
| 87 | Some(sym::i8) => no_args!(ReprInt(SignedInt(IntTy::I8))), | |
| 88 | Some(sym::u8) => no_args!(ReprInt(UnsignedInt(UintTy::U8))), | |
| 89 | Some(sym::i16) => no_args!(ReprInt(SignedInt(IntTy::I16))), | |
| 90 | Some(sym::u16) => no_args!(ReprInt(UnsignedInt(UintTy::U16))), | |
| 91 | Some(sym::i32) => no_args!(ReprInt(SignedInt(IntTy::I32))), | |
| 92 | Some(sym::u32) => no_args!(ReprInt(UnsignedInt(UintTy::U32))), | |
| 93 | Some(sym::i64) => no_args!(ReprInt(SignedInt(IntTy::I64))), | |
| 94 | Some(sym::u64) => no_args!(ReprInt(UnsignedInt(UintTy::U64))), | |
| 95 | Some(sym::i128) => no_args!(ReprInt(SignedInt(IntTy::I128))), | |
| 96 | Some(sym::u128) => no_args!(ReprInt(UnsignedInt(UintTy::U128))), | |
| 97 | Some(sym::isize) => no_args!(ReprInt(SignedInt(IntTy::Isize))), | |
| 98 | Some(sym::usize) => no_args!(ReprInt(UnsignedInt(UintTy::Usize))), | |
| 178 | 99 | _ => { |
| 179 | cx.emit_err(session_diagnostics::UnrecognizedReprHint { span: param.span() }); | |
| 100 | cx.adcx().expected_specific_argument( | |
| 101 | param.span(), | |
| 102 | &[ | |
| 103 | sym::align, | |
| 104 | sym::packed, | |
| 105 | sym::Rust, | |
| 106 | sym::C, | |
| 107 | sym::simd, | |
| 108 | sym::transparent, | |
| 109 | sym::i8, | |
| 110 | sym::u8, | |
| 111 | sym::i16, | |
| 112 | sym::u16, | |
| 113 | sym::i32, | |
| 114 | sym::u32, | |
| 115 | sym::i64, | |
| 116 | sym::u64, | |
| 117 | sym::i128, | |
| 118 | sym::u128, | |
| 119 | sym::isize, | |
| 120 | sym::usize, | |
| 121 | ], | |
| 122 | ); | |
| 180 | 123 | None |
| 181 | 124 | } |
| 182 | 125 | } |
| ... | ... | @@ -188,44 +131,17 @@ enum AlignKind { |
| 188 | 131 | } |
| 189 | 132 | |
| 190 | 133 | fn parse_repr_align( |
| 191 | cx: &AcceptContext<'_, '_>, | |
| 134 | cx: &mut AcceptContext<'_, '_>, | |
| 192 | 135 | list: &MetaItemListParser, |
| 193 | param_span: Span, | |
| 194 | 136 | align_kind: AlignKind, |
| 195 | 137 | ) -> Option<ReprAttr> { |
| 196 | use AlignKind::*; | |
| 197 | ||
| 198 | 138 | let Some(align) = list.as_single() else { |
| 199 | match align_kind { | |
| 200 | Packed => { | |
| 201 | cx.emit_err(session_diagnostics::IncorrectReprFormatPackedOneOrZeroArg { | |
| 202 | span: param_span, | |
| 203 | }); | |
| 204 | } | |
| 205 | Align => { | |
| 206 | cx.emit_err(session_diagnostics::IncorrectReprFormatAlignOneArg { | |
| 207 | span: param_span, | |
| 208 | }); | |
| 209 | } | |
| 210 | } | |
| 211 | ||
| 139 | cx.adcx().expected_single_argument(list.span, list.len()); | |
| 212 | 140 | return None; |
| 213 | 141 | }; |
| 214 | 142 | |
| 215 | 143 | let Some(lit) = align.as_lit() else { |
| 216 | match align_kind { | |
| 217 | Packed => { | |
| 218 | cx.emit_err(session_diagnostics::IncorrectReprFormatPackedExpectInteger { | |
| 219 | span: align.span(), | |
| 220 | }); | |
| 221 | } | |
| 222 | Align => { | |
| 223 | cx.emit_err(session_diagnostics::IncorrectReprFormatExpectInteger { | |
| 224 | span: align.span(), | |
| 225 | }); | |
| 226 | } | |
| 227 | } | |
| 228 | ||
| 144 | cx.adcx().expected_integer_literal(align.span()); | |
| 229 | 145 | return None; |
| 230 | 146 | }; |
| 231 | 147 | |
| ... | ... | @@ -235,12 +151,8 @@ fn parse_repr_align( |
| 235 | 151 | AlignKind::Align => ReprAttr::ReprAlign(literal), |
| 236 | 152 | }), |
| 237 | 153 | Err(message) => { |
| 238 | cx.emit_err(session_diagnostics::InvalidReprGeneric { | |
| 154 | cx.emit_err(session_diagnostics::InvalidAlignmentValue { | |
| 239 | 155 | span: lit.span, |
| 240 | repr_arg: match align_kind { | |
| 241 | Packed => "packed".to_string(), | |
| 242 | Align => "align".to_string(), | |
| 243 | }, | |
| 244 | 156 | error_part: message, |
| 245 | 157 | }); |
| 246 | 158 | None |
| ... | ... | @@ -294,10 +206,7 @@ impl RustcAlignParser { |
| 294 | 206 | }; |
| 295 | 207 | |
| 296 | 208 | let Some(lit) = align.as_lit() else { |
| 297 | cx.emit_err(session_diagnostics::IncorrectReprFormatExpectInteger { | |
| 298 | span: align.span(), | |
| 299 | }); | |
| 300 | ||
| 209 | cx.adcx().expected_integer_literal(align.span()); | |
| 301 | 210 | return; |
| 302 | 211 | }; |
| 303 | 212 |
compiler/rustc_attr_parsing/src/interface.rs+3-20| ... | ... | @@ -285,11 +285,6 @@ impl<'sess> AttributeParser<'sess> { |
| 285 | 285 | mut emit_lint: impl FnMut(LintId, MultiSpan, EmitAttribute), |
| 286 | 286 | ) -> Vec<Attribute> { |
| 287 | 287 | let mut attributes = Vec::new(); |
| 288 | // We store the attributes we intend to discard at the end of this function in order to | |
| 289 | // check they are applied to the right target and error out if necessary. In practice, we | |
| 290 | // end up dropping only derive attributes and derive helpers, both being fully processed | |
| 291 | // at macro expansion. | |
| 292 | let mut dropped_attributes = Vec::new(); | |
| 293 | 288 | let mut attr_paths: Vec<RefPathParser<'_>> = Vec::new(); |
| 294 | 289 | let mut early_parsed_state = EarlyParsedState::default(); |
| 295 | 290 | |
| ... | ... | @@ -437,20 +432,8 @@ impl<'sess> AttributeParser<'sess> { |
| 437 | 432 | self.check_invalid_crate_level_attr_item(&attr, n.item.span()); |
| 438 | 433 | } |
| 439 | 434 | |
| 440 | let attr = Attribute::Unparsed(Box::new(attr)); | |
| 441 | ||
| 442 | if self.tools.is_some_and(|tools| { | |
| 443 | tools.iter().any(|tool| tool.name == parts[0]) | |
| 444 | // FIXME: this can be removed once #152369 has been merged. | |
| 445 | // https://github.com/rust-lang/rust/pull/152369 | |
| 446 | || [sym::allow, sym::deny, sym::expect, sym::forbid, sym::warn] | |
| 447 | .contains(&parts[0]) | |
| 448 | }) { | |
| 449 | attributes.push(attr); | |
| 450 | } else { | |
| 451 | dropped_attributes.push(attr); | |
| 452 | } | |
| 453 | } | |
| 435 | attributes.push(Attribute::Unparsed(Box::new(attr))); | |
| 436 | }; | |
| 454 | 437 | } |
| 455 | 438 | } |
| 456 | 439 | } |
| ... | ... | @@ -466,7 +449,7 @@ impl<'sess> AttributeParser<'sess> { |
| 466 | 449 | } |
| 467 | 450 | |
| 468 | 451 | if !matches!(self.should_emit, ShouldEmit::Nothing) && target == Target::WherePredicate { |
| 469 | self.check_invalid_where_predicate_attrs(attributes.iter().chain(&dropped_attributes)); | |
| 452 | self.check_invalid_where_predicate_attrs(attributes.iter()); | |
| 470 | 453 | } |
| 471 | 454 | |
| 472 | 455 | attributes |
compiler/rustc_attr_parsing/src/session_diagnostics.rs+1-141| ... | ... | @@ -1,6 +1,5 @@ |
| 1 | 1 | use std::num::IntErrorKind; |
| 2 | 2 | |
| 3 | use rustc_ast as ast; | |
| 4 | 3 | use rustc_errors::codes::*; |
| 5 | 4 | use rustc_errors::{ |
| 6 | 5 | Applicability, Diag, DiagArgValue, DiagCtxtHandle, Diagnostic, EmissionGuarantee, Level, |
| ... | ... | @@ -183,126 +182,6 @@ pub(crate) struct MissingIssue { |
| 183 | 182 | pub span: Span, |
| 184 | 183 | } |
| 185 | 184 | |
| 186 | // FIXME: Why is this the same error code as `InvalidReprHintNoParen` and `InvalidReprHintNoValue`? | |
| 187 | // It is more similar to `IncorrectReprFormatGeneric`. | |
| 188 | #[derive(Diagnostic)] | |
| 189 | #[diag("incorrect `repr(packed)` attribute format: `packed` takes exactly one parenthesized argument, or no parentheses at all", code = E0552)] | |
| 190 | pub(crate) struct IncorrectReprFormatPackedOneOrZeroArg { | |
| 191 | #[primary_span] | |
| 192 | pub span: Span, | |
| 193 | } | |
| 194 | #[derive(Diagnostic)] | |
| 195 | #[diag("incorrect `repr(packed)` attribute format: `packed` expects a literal integer as argument", code = E0552)] | |
| 196 | pub(crate) struct IncorrectReprFormatPackedExpectInteger { | |
| 197 | #[primary_span] | |
| 198 | pub span: Span, | |
| 199 | } | |
| 200 | ||
| 201 | #[derive(Diagnostic)] | |
| 202 | #[diag("invalid representation hint: `{$name}` does not take a parenthesized argument list", code = E0552)] | |
| 203 | pub(crate) struct InvalidReprHintNoParen { | |
| 204 | #[primary_span] | |
| 205 | pub span: Span, | |
| 206 | ||
| 207 | pub name: Symbol, | |
| 208 | } | |
| 209 | ||
| 210 | #[derive(Diagnostic)] | |
| 211 | #[diag("invalid representation hint: `{$name}` does not take a value", code = E0552)] | |
| 212 | pub(crate) struct InvalidReprHintNoValue { | |
| 213 | #[primary_span] | |
| 214 | pub span: Span, | |
| 215 | ||
| 216 | pub name: Symbol, | |
| 217 | } | |
| 218 | ||
| 219 | #[derive(Diagnostic)] | |
| 220 | #[diag("invalid `repr(align)` attribute: `align` needs an argument", code = E0589)] | |
| 221 | pub(crate) struct InvalidReprAlignNeedArg { | |
| 222 | #[primary_span] | |
| 223 | #[suggestion( | |
| 224 | "supply an argument here", | |
| 225 | code = "align(...)", | |
| 226 | applicability = "has-placeholders" | |
| 227 | )] | |
| 228 | pub span: Span, | |
| 229 | } | |
| 230 | ||
| 231 | #[derive(Diagnostic)] | |
| 232 | #[diag("invalid `repr({$repr_arg})` attribute: {$error_part}", code = E0589)] | |
| 233 | pub(crate) struct InvalidReprGeneric { | |
| 234 | #[primary_span] | |
| 235 | pub span: Span, | |
| 236 | ||
| 237 | pub repr_arg: String, | |
| 238 | pub error_part: String, | |
| 239 | } | |
| 240 | ||
| 241 | #[derive(Diagnostic)] | |
| 242 | #[diag("incorrect `repr(align)` attribute format: `align` takes exactly one argument in parentheses", code = E0693)] | |
| 243 | pub(crate) struct IncorrectReprFormatAlignOneArg { | |
| 244 | #[primary_span] | |
| 245 | pub span: Span, | |
| 246 | } | |
| 247 | ||
| 248 | #[derive(Diagnostic)] | |
| 249 | #[diag("incorrect `repr(align)` attribute format: `align` expects a literal integer as argument", code = E0693)] | |
| 250 | pub(crate) struct IncorrectReprFormatExpectInteger { | |
| 251 | #[primary_span] | |
| 252 | pub span: Span, | |
| 253 | } | |
| 254 | ||
| 255 | #[derive(Diagnostic)] | |
| 256 | #[diag("incorrect `repr({$repr_arg})` attribute format", code = E0693)] | |
| 257 | pub(crate) struct IncorrectReprFormatGeneric { | |
| 258 | #[primary_span] | |
| 259 | pub span: Span, | |
| 260 | ||
| 261 | pub repr_arg: Symbol, | |
| 262 | ||
| 263 | #[subdiagnostic] | |
| 264 | pub cause: Option<IncorrectReprFormatGenericCause>, | |
| 265 | } | |
| 266 | ||
| 267 | #[derive(Subdiagnostic)] | |
| 268 | pub(crate) enum IncorrectReprFormatGenericCause { | |
| 269 | #[suggestion( | |
| 270 | "use parentheses instead", | |
| 271 | code = "{name}({value})", | |
| 272 | applicability = "machine-applicable" | |
| 273 | )] | |
| 274 | Int { | |
| 275 | #[primary_span] | |
| 276 | span: Span, | |
| 277 | name: Symbol, | |
| 278 | value: u128, | |
| 279 | }, | |
| 280 | ||
| 281 | #[suggestion( | |
| 282 | "use parentheses instead", | |
| 283 | code = "{name}({value})", | |
| 284 | applicability = "machine-applicable" | |
| 285 | )] | |
| 286 | Symbol { | |
| 287 | #[primary_span] | |
| 288 | span: Span, | |
| 289 | name: Symbol, | |
| 290 | value: Symbol, | |
| 291 | }, | |
| 292 | } | |
| 293 | ||
| 294 | impl IncorrectReprFormatGenericCause { | |
| 295 | pub(crate) fn from_lit_kind(span: Span, kind: &ast::LitKind, name: Symbol) -> Option<Self> { | |
| 296 | match *kind { | |
| 297 | ast::LitKind::Int(value, ast::LitIntType::Unsuffixed) => { | |
| 298 | Some(Self::Int { span, name, value: value.get() }) | |
| 299 | } | |
| 300 | ast::LitKind::Str(value, _) => Some(Self::Symbol { span, name, value }), | |
| 301 | _ => None, | |
| 302 | } | |
| 303 | } | |
| 304 | } | |
| 305 | ||
| 306 | 185 | #[derive(Diagnostic)] |
| 307 | 186 | #[diag("`rustc_promotable` attribute must be paired with either a `rustc_const_unstable` or a `rustc_const_stable` attribute", code = E0717)] |
| 308 | 187 | pub(crate) struct RustcPromotablePairing { |
| ... | ... | @@ -484,26 +363,6 @@ pub(crate) struct InvalidAlignmentValue { |
| 484 | 363 | pub error_part: String, |
| 485 | 364 | } |
| 486 | 365 | |
| 487 | #[derive(Diagnostic)] | |
| 488 | #[diag("meta item in `repr` must be an identifier", code = E0565)] | |
| 489 | pub(crate) struct ReprIdent { | |
| 490 | #[primary_span] | |
| 491 | pub span: Span, | |
| 492 | } | |
| 493 | ||
| 494 | #[derive(Diagnostic)] | |
| 495 | #[diag("unrecognized representation hint", code = E0552)] | |
| 496 | #[help( | |
| 497 | "valid reprs are `Rust` (default), `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`" | |
| 498 | )] | |
| 499 | #[note( | |
| 500 | "for more information, visit <https://doc.rust-lang.org/reference/type-layout.html?highlight=repr#representations>" | |
| 501 | )] | |
| 502 | pub(crate) struct UnrecognizedReprHint { | |
| 503 | #[primary_span] | |
| 504 | pub span: Span, | |
| 505 | } | |
| 506 | ||
| 507 | 366 | #[derive(Diagnostic)] |
| 508 | 367 | #[diag("item annotated with `#[unstable_feature_bound]` should not be stable")] |
| 509 | 368 | #[help( |
| ... | ... | @@ -849,6 +708,7 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for AttributeParseError<'_> { |
| 849 | 708 | } |
| 850 | 709 | AttributeParseErrorReason::ExpectedIdentifier => { |
| 851 | 710 | diag.span_label(self.span, "expected a valid identifier here"); |
| 711 | diag.code(E0565); | |
| 852 | 712 | } |
| 853 | 713 | } |
| 854 | 714 |
compiler/rustc_codegen_ssa/src/back/write.rs+1-1| ... | ... | @@ -180,7 +180,7 @@ impl ModuleConfig { |
| 180 | 180 | ), |
| 181 | 181 | pgo_use: if_regular!(sess.opts.cg.profile_use.clone(), None), |
| 182 | 182 | pgo_sample_use: if_regular!(sess.opts.unstable_opts.profile_sample_use.clone(), None), |
| 183 | debug_info_for_profiling: sess.opts.unstable_opts.debug_info_for_profiling, | |
| 183 | debug_info_for_profiling: sess.opts.unstable_opts.debuginfo_for_profiling, | |
| 184 | 184 | instrument_coverage: if_regular!(sess.instrument_coverage(), false), |
| 185 | 185 | |
| 186 | 186 | sanitizer: if_regular!(sess.sanitizers(), SanitizerSet::empty()), |
compiler/rustc_error_codes/src/error_codes/E0552.md+4-1| ... | ... | @@ -1,8 +1,11 @@ |
| 1 | #### Note: this error code is no longer emitted by the compiler. | |
| 2 | This error code was replaced by `E0539`. | |
| 3 | ||
| 1 | 4 | A unrecognized representation attribute was used. |
| 2 | 5 | |
| 3 | 6 | Erroneous code example: |
| 4 | 7 | |
| 5 | ```compile_fail,E0552 | |
| 8 | ```compile_fail | |
| 6 | 9 | #[repr(D)] // error: unrecognized representation hint |
| 7 | 10 | struct MyStruct { |
| 8 | 11 | my_field: usize |
compiler/rustc_error_codes/src/error_codes/E0693.md+4-1| ... | ... | @@ -1,8 +1,11 @@ |
| 1 | #### Note: this error code is no longer emitted by the compiler. | |
| 2 | This error code was replaced by `E0539`. | |
| 3 | ||
| 1 | 4 | `align` representation hint was incorrectly declared. |
| 2 | 5 | |
| 3 | 6 | Erroneous code examples: |
| 4 | 7 | |
| 5 | ```compile_fail,E0693 | |
| 8 | ```compile_fail | |
| 6 | 9 | #[repr(align=8)] // error! |
| 7 | 10 | struct Align8(i8); |
| 8 | 11 |
compiler/rustc_interface/src/tests.rs+1-1| ... | ... | @@ -782,8 +782,8 @@ fn test_unstable_options_tracking_hash() { |
| 782 | 782 | ); |
| 783 | 783 | tracked!(crate_attr, vec!["abc".to_string()]); |
| 784 | 784 | tracked!(cross_crate_inline_threshold, InliningThreshold::Always); |
| 785 | tracked!(debug_info_for_profiling, true); | |
| 786 | 785 | tracked!(debug_info_type_line_numbers, true); |
| 786 | tracked!(debuginfo_for_profiling, true); | |
| 787 | 787 | tracked!(default_visibility, Some(rustc_target::spec::SymbolVisibility::Hidden)); |
| 788 | 788 | tracked!(dep_info_omit_d_target, true); |
| 789 | 789 | tracked!(direct_access_external_data, Some(true)); |
compiler/rustc_middle/src/mir/syntax.rs+12-7| ... | ... | @@ -872,11 +872,18 @@ pub enum TerminatorKind<'tcx> { |
| 872 | 872 | /// Marks a suspend point. |
| 873 | 873 | /// |
| 874 | 874 | /// Like `Return` terminators in coroutine bodies, this computes `value` and then a |
| 875 | /// `CoroutineState::Yielded(value)` as if by `Aggregate` rvalue. That value is then assigned to | |
| 876 | /// the return place of the function calling this one, and execution continues in the calling | |
| 877 | /// function. When next invoked with the same first argument, execution of this function | |
| 878 | /// continues at the `resume` basic block, with the second argument written to the `resume_arg` | |
| 879 | /// place. If the coroutine is dropped before then, the `drop` basic block is invoked. | |
| 875 | /// `CoroutineState::Yielded(value)` as if by `Aggregate` rvalue. That value is then assigned | |
| 876 | /// to the return place provided by the caller function, and execution continues in this caller | |
| 877 | /// function. | |
| 878 | /// | |
| 879 | /// When the coroutine is resumed/polled, execution of this function continues at the `resume` | |
| 880 | /// basic block, the `resume_arg` place is evaluated and the second argument to `resume/poll` | |
| 881 | /// is written to it. | |
| 882 | /// | |
| 883 | /// If the coroutine is dropped before then, execution of this function continues at the `drop` | |
| 884 | /// basic block and the `resume_arg` place expression is evaluated. For async drop, the second | |
| 885 | /// argument to the destructor `resume/poll` method is written to `resume_arg`. For synchronous | |
| 886 | /// drops, uninitialized bytes are written to `resume_arg`. | |
| 880 | 887 | /// |
| 881 | 888 | /// Note that coroutines can be (unstably) cloned under certain conditions, which means that |
| 882 | 889 | /// this terminator can **return multiple times**! MIR optimizations that reorder code into |
| ... | ... | @@ -884,8 +891,6 @@ pub enum TerminatorKind<'tcx> { |
| 884 | 891 | /// See <https://github.com/rust-lang/rust/issues/95360>. |
| 885 | 892 | /// |
| 886 | 893 | /// Not permitted in bodies that are not coroutine bodies, or after coroutine lowering. |
| 887 | /// | |
| 888 | /// **Needs clarification**: What about the evaluation order of the `resume_arg` and `value`? | |
| 889 | 894 | Yield { |
| 890 | 895 | /// The value to return. |
| 891 | 896 | value: Operand<'tcx>, |
compiler/rustc_middle/src/mir/terminator.rs+13-19| ... | ... | @@ -674,7 +674,7 @@ impl<'tcx> TerminatorKind<'tcx> { |
| 674 | 674 | } |
| 675 | 675 | } |
| 676 | 676 | |
| 677 | #[derive(Copy, Clone, Debug)] | |
| 677 | #[derive(Debug)] | |
| 678 | 678 | pub enum TerminatorEdges<'mir, 'tcx> { |
| 679 | 679 | /// For terminators that have no successor, like `return`. |
| 680 | 680 | None, |
| ... | ... | @@ -686,7 +686,7 @@ pub enum TerminatorEdges<'mir, 'tcx> { |
| 686 | 686 | Double(BasicBlock, BasicBlock), |
| 687 | 687 | /// Special action for `Yield`, `Call` and `InlineAsm` terminators. |
| 688 | 688 | AssignOnReturn { |
| 689 | return_: &'mir [BasicBlock], | |
| 689 | return_: Box<[BasicBlock]>, | |
| 690 | 690 | /// The cleanup block, if it exists. |
| 691 | 691 | cleanup: Option<BasicBlock>, |
| 692 | 692 | place: CallReturnPlaces<'mir, 'tcx>, |
| ... | ... | @@ -755,27 +755,21 @@ impl<'tcx> TerminatorKind<'tcx> { |
| 755 | 755 | TerminatorEdges::Double(real_target, imaginary_target) |
| 756 | 756 | } |
| 757 | 757 | |
| 758 | Yield { resume: ref target, drop, resume_arg, value: _ } => { | |
| 758 | Yield { resume: target, drop, resume_arg, value: _ } => { | |
| 759 | 759 | TerminatorEdges::AssignOnReturn { |
| 760 | return_: slice::from_ref(target), | |
| 761 | cleanup: drop, | |
| 760 | return_: [target].into_iter().chain(drop.into_iter()).collect(), | |
| 761 | cleanup: None, | |
| 762 | 762 | place: CallReturnPlaces::Yield(resume_arg), |
| 763 | 763 | } |
| 764 | 764 | } |
| 765 | 765 | |
| 766 | Call { | |
| 767 | unwind, | |
| 768 | destination, | |
| 769 | ref target, | |
| 770 | func: _, | |
| 771 | args: _, | |
| 772 | fn_span: _, | |
| 773 | call_source: _, | |
| 774 | } => TerminatorEdges::AssignOnReturn { | |
| 775 | return_: target.as_ref().map(slice::from_ref).unwrap_or_default(), | |
| 776 | cleanup: unwind.cleanup_block(), | |
| 777 | place: CallReturnPlaces::Call(destination), | |
| 778 | }, | |
| 766 | Call { unwind, destination, target, func: _, args: _, fn_span: _, call_source: _ } => { | |
| 767 | TerminatorEdges::AssignOnReturn { | |
| 768 | return_: target.into_iter().collect(), | |
| 769 | cleanup: unwind.cleanup_block(), | |
| 770 | place: CallReturnPlaces::Call(destination), | |
| 771 | } | |
| 772 | } | |
| 779 | 773 | |
| 780 | 774 | InlineAsm { |
| 781 | 775 | asm_macro: _, |
| ... | ... | @@ -786,7 +780,7 @@ impl<'tcx> TerminatorKind<'tcx> { |
| 786 | 780 | ref targets, |
| 787 | 781 | unwind, |
| 788 | 782 | } => TerminatorEdges::AssignOnReturn { |
| 789 | return_: targets, | |
| 783 | return_: targets.to_owned(), | |
| 790 | 784 | cleanup: unwind.cleanup_block(), |
| 791 | 785 | place: CallReturnPlaces::InlineAsm(operands), |
| 792 | 786 | }, |
compiler/rustc_mir_dataflow/src/framework/direction.rs+5-3| ... | ... | @@ -101,11 +101,13 @@ impl Direction for Backward { |
| 101 | 101 | propagate(pred, &tmp); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | mir::TerminatorKind::Yield { resume, resume_arg, .. } if resume == block => { | |
| 104 | mir::TerminatorKind::Yield { resume, drop, resume_arg, .. } | |
| 105 | if resume == block || drop == Some(block) => | |
| 106 | { | |
| 105 | 107 | let mut tmp = exit_state.clone(); |
| 106 | 108 | analysis.apply_call_return_effect( |
| 107 | 109 | &mut tmp, |
| 108 | resume, | |
| 110 | block, | |
| 109 | 111 | CallReturnPlaces::Yield(resume_arg), |
| 110 | 112 | ); |
| 111 | 113 | propagate(pred, &tmp); |
| ... | ... | @@ -275,7 +277,7 @@ impl Direction for Forward { |
| 275 | 277 | |
| 276 | 278 | if !return_.is_empty() { |
| 277 | 279 | analysis.apply_call_return_effect(exit_state, block, place); |
| 278 | for &target in return_ { | |
| 280 | for target in return_ { | |
| 279 | 281 | propagate(target, exit_state); |
| 280 | 282 | } |
| 281 | 283 | } |
compiler/rustc_mir_transform/src/coroutine.rs+14-4| ... | ... | @@ -1302,13 +1302,21 @@ fn create_coroutine_resume_function<'tcx>( |
| 1302 | 1302 | enum Operation { |
| 1303 | 1303 | Resume, |
| 1304 | 1304 | Drop, |
| 1305 | AsyncDrop, | |
| 1305 | 1306 | } |
| 1306 | 1307 | |
| 1307 | 1308 | impl Operation { |
| 1308 | 1309 | fn target_block(self, point: &SuspensionPoint<'_>) -> Option<BasicBlock> { |
| 1309 | 1310 | match self { |
| 1310 | 1311 | Operation::Resume => Some(point.resume), |
| 1311 | Operation::Drop => point.drop, | |
| 1312 | Operation::Drop | Operation::AsyncDrop => point.drop, | |
| 1313 | } | |
| 1314 | } | |
| 1315 | ||
| 1316 | fn resume_place<'tcx>(self, point: &SuspensionPoint<'tcx>) -> Option<Place<'tcx>> { | |
| 1317 | match self { | |
| 1318 | Operation::Resume | Operation::AsyncDrop => Some(point.resume_arg), | |
| 1319 | Operation::Drop => None, | |
| 1312 | 1320 | } |
| 1313 | 1321 | } |
| 1314 | 1322 | } |
| ... | ... | @@ -1339,12 +1347,14 @@ fn create_cases<'tcx>( |
| 1339 | 1347 | } |
| 1340 | 1348 | } |
| 1341 | 1349 | |
| 1342 | if operation == Operation::Resume && point.resume_arg != CTX_ARG.into() { | |
| 1343 | // Move the resume argument to the destination place of the `Yield` terminator | |
| 1350 | // Move the resume argument to the destination place of the `Yield` terminator | |
| 1351 | if let Some(resume_arg) = operation.resume_place(point) | |
| 1352 | && resume_arg != CTX_ARG.into() | |
| 1353 | { | |
| 1344 | 1354 | statements.push(Statement::new( |
| 1345 | 1355 | source_info, |
| 1346 | 1356 | StatementKind::Assign(Box::new(( |
| 1347 | point.resume_arg, | |
| 1357 | resume_arg, | |
| 1348 | 1358 | Rvalue::Use(Operand::Move(CTX_ARG.into()), WithRetag::Yes), |
| 1349 | 1359 | ))), |
| 1350 | 1360 | )); |
compiler/rustc_mir_transform/src/coroutine/drop.rs+1-1| ... | ... | @@ -646,7 +646,7 @@ pub(super) fn create_coroutine_drop_shim_async<'tcx>( |
| 646 | 646 | |
| 647 | 647 | let source_info = SourceInfo::outermost(body.span); |
| 648 | 648 | |
| 649 | let mut cases = create_cases(&mut body, transform, Operation::Drop); | |
| 649 | let mut cases = create_cases(&mut body, transform, Operation::AsyncDrop); | |
| 650 | 650 | |
| 651 | 651 | cases.insert(0, (CoroutineArgs::UNRESUMED, drop_clean)); |
| 652 | 652 |
compiler/rustc_session/src/options.rs+2-2| ... | ... | @@ -2252,12 +2252,12 @@ options! { |
| 2252 | 2252 | "inject the given attribute in the crate"), |
| 2253 | 2253 | cross_crate_inline_threshold: InliningThreshold = (InliningThreshold::Sometimes(100), parse_inlining_threshold, [TRACKED], |
| 2254 | 2254 | "threshold to allow cross crate inlining of functions"), |
| 2255 | debug_info_for_profiling: bool = (false, parse_bool, [TRACKED], | |
| 2256 | "emit discriminators and other data necessary for AutoFDO"), | |
| 2257 | 2255 | debug_info_type_line_numbers: bool = (false, parse_bool, [TRACKED], |
| 2258 | 2256 | "emit type and line information for additional data types (default: no)"), |
| 2259 | 2257 | debuginfo_compression: DebugInfoCompression = (DebugInfoCompression::None, parse_debuginfo_compression, [TRACKED], |
| 2260 | 2258 | "compress debug info sections (none, zlib, zstd, default: none)"), |
| 2259 | debuginfo_for_profiling: bool = (false, parse_bool, [TRACKED], | |
| 2260 | "emit discriminators and other data necessary for AutoFDO"), | |
| 2261 | 2261 | deduplicate_diagnostics: bool = (true, parse_bool, [UNTRACKED], |
| 2262 | 2262 | "deduplicate identical diagnostics (default: yes)"), |
| 2263 | 2263 | default_visibility: Option<SymbolVisibility> = (None, parse_opt_symbol_visibility, [TRACKED], |
library/core/src/hint.rs+3| ... | ... | @@ -778,6 +778,9 @@ pub const fn unlikely(b: bool) -> bool { |
| 778 | 778 | #[stable(feature = "cold_path", since = "1.95.0")] |
| 779 | 779 | #[rustc_const_stable(feature = "cold_path", since = "1.95.0")] |
| 780 | 780 | #[inline(always)] |
| 781 | // Even if for some reason the cold_path intrinsic is not visible to codegen, the coldness will | |
| 782 | // ensure that branches this is in are still known to be cold. | |
| 783 | #[cold] | |
| 781 | 784 | pub const fn cold_path() { |
| 782 | 785 | crate::intrinsics::cold_path() |
| 783 | 786 | } |
src/ci/docker/host-x86_64/x86_64-gnu-gcc-core-tests/Dockerfile+1-2| ... | ... | @@ -43,5 +43,4 @@ ENV RUST_CONFIGURE_ARGS="--build=x86_64-unknown-linux-gnu \ |
| 43 | 43 | --set llvm.libzstd=true" |
| 44 | 44 | ENV SCRIPT="python3 ../x.py \ |
| 45 | 45 | --stage 1 \ |
| 46 | test library/coretests \ | |
| 47 | --set rust.codegen-backends=[\\\"gcc\\\"]" | |
| 46 | test library/coretests" |
src/doc/unstable-book/src/compiler-flags/debug_info_for_profiling.md deleted-35| ... | ... | @@ -1,35 +0,0 @@ |
| 1 | # `debug-info-for-profiling` | |
| 2 | ||
| 3 | --- | |
| 4 | ||
| 5 | ## Introduction | |
| 6 | ||
| 7 | Automatic Feedback Directed Optimization (AFDO) is a method for using sampling | |
| 8 | based profiles to guide optimizations. This is contrasted with other methods of | |
| 9 | FDO or profile-guided optimization (PGO) which use instrumented profiling. | |
| 10 | ||
| 11 | Unlike PGO (controlled by the `rustc` flags `-Cprofile-generate` and | |
| 12 | `-Cprofile-use`), a binary being profiled does not perform significantly worse, | |
| 13 | and thus it's possible to profile binaries used in real workflows and not | |
| 14 | necessary to construct artificial workflows. | |
| 15 | ||
| 16 | ## Use | |
| 17 | ||
| 18 | In order to use AFDO, the target platform must be Linux running on an `x86_64` | |
| 19 | architecture with the performance profiler `perf` available. In addition, the | |
| 20 | external tool `create_llvm_prof` from [this repository] must be used. | |
| 21 | ||
| 22 | Given a Rust file `main.rs`, we can produce an optimized binary as follows: | |
| 23 | ||
| 24 | ```shell | |
| 25 | rustc -O -Zdebug-info-for-profiling main.rs -o main | |
| 26 | perf record -b ./main | |
| 27 | create_llvm_prof --binary=main --out=code.prof | |
| 28 | rustc -O -Zprofile-sample-use=code.prof main.rs -o main2 | |
| 29 | ``` | |
| 30 | ||
| 31 | The `perf` command produces a profile `perf.data`, which is then used by the | |
| 32 | `create_llvm_prof` command to create `code.prof`. This final profile is then | |
| 33 | used by `rustc` to guide optimizations in producing the binary `main2`. | |
| 34 | ||
| 35 | [this repository]: https://github.com/google/autofdo |
src/doc/unstable-book/src/compiler-flags/debuginfo_for_profiling.md created+35| ... | ... | @@ -0,0 +1,35 @@ |
| 1 | # `debuginfo-for-profiling` | |
| 2 | ||
| 3 | --- | |
| 4 | ||
| 5 | ## Introduction | |
| 6 | ||
| 7 | Automatic Feedback Directed Optimization (AFDO) is a method for using sampling | |
| 8 | based profiles to guide optimizations. This is contrasted with other methods of | |
| 9 | FDO or profile-guided optimization (PGO) which use instrumented profiling. | |
| 10 | ||
| 11 | Unlike PGO (controlled by the `rustc` flags `-Cprofile-generate` and | |
| 12 | `-Cprofile-use`), a binary being profiled does not perform significantly worse, | |
| 13 | and thus it's possible to profile binaries used in real workflows and not | |
| 14 | necessary to construct artificial workflows. | |
| 15 | ||
| 16 | ## Use | |
| 17 | ||
| 18 | In order to use AFDO, the target platform must be Linux running on an `x86_64` | |
| 19 | architecture with the performance profiler `perf` available. In addition, the | |
| 20 | external tool `create_llvm_prof` from [this repository] must be used. | |
| 21 | ||
| 22 | Given a Rust file `main.rs`, we can produce an optimized binary as follows: | |
| 23 | ||
| 24 | ```shell | |
| 25 | rustc -O -Zdebuginfo-for-profiling main.rs -o main | |
| 26 | perf record -b ./main | |
| 27 | create_llvm_prof --binary=main --out=code.prof | |
| 28 | rustc -O -Zprofile-sample-use=code.prof main.rs -o main2 | |
| 29 | ``` | |
| 30 | ||
| 31 | The `perf` command produces a profile `perf.data`, which is then used by the | |
| 32 | `create_llvm_prof` command to create `code.prof`. This final profile is then | |
| 33 | used by `rustc` to guide optimizations in producing the binary `main2`. | |
| 34 | ||
| 35 | [this repository]: https://github.com/google/autofdo |
src/doc/unstable-book/src/compiler-flags/profile_sample_use.md+2-2| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | |
| 5 | 5 | `-Zprofile-sample-use=code.prof` directs `rustc` to use the profile |
| 6 | 6 | `code.prof` as a source for Automatic Feedback Directed Optimization (AFDO). |
| 7 | See the documentation of [`-Zdebug-info-for-profiling`] for more information | |
| 7 | See the documentation of [`-Zdebuginfo-for-profiling`] for more information | |
| 8 | 8 | on using AFDO. |
| 9 | 9 | |
| 10 | [`-Zdebug-info-for-profiling`]: debug_info_for_profiling.html | |
| 10 | [`-Zdebuginfo-for-profiling`]: debuginfo_for_profiling.html |
src/librustdoc/clean/mod.rs+1-1| ... | ... | @@ -243,8 +243,8 @@ fn generate_item_with_correct_attrs( |
| 243 | 243 | ) || (is_glob_import(tcx, import_id) |
| 244 | 244 | && (cx.document_hidden() || !tcx.is_doc_hidden(def_id))) |
| 245 | 245 | || macro_reexport_is_inline(tcx, import_id, def_id); |
| 246 | attrs.extend(get_all_import_attributes(cx, import_id, def_id, is_inline)); | |
| 247 | 246 | is_inline = is_inline || import_is_inline; |
| 247 | attrs.extend(get_all_import_attributes(cx, import_id, def_id, is_inline)); | |
| 248 | 248 | } |
| 249 | 249 | let keep_target_cfg = is_inline || matches!(kind, ItemKind::TypeAliasItem(..)); |
| 250 | 250 | add_without_unwanted_attributes(&mut attrs, target_attrs, keep_target_cfg, None); |
src/librustdoc/html/macro_expansion.rs+11-1| ... | ... | @@ -2,7 +2,7 @@ use rustc_ast::visit::{ |
| 2 | 2 | AssocCtxt, Visitor, walk_assoc_item, walk_crate, walk_expr, walk_item, walk_pat, walk_stmt, |
| 3 | 3 | walk_ty, |
| 4 | 4 | }; |
| 5 | use rustc_ast::{AssocItem, Crate, Expr, Item, Pat, Stmt, Ty}; | |
| 5 | use rustc_ast::{AssocItem, Crate, Expr, ForeignItem, Item, Pat, Stmt, Ty}; | |
| 6 | 6 | use rustc_data_structures::fx::FxHashMap; |
| 7 | 7 | use rustc_span::source_map::SourceMap; |
| 8 | 8 | use rustc_span::{BytePos, Span}; |
| ... | ... | @@ -174,4 +174,14 @@ impl<'ast> Visitor<'ast> for ExpandedCodeVisitor<'ast> { |
| 174 | 174 | walk_assoc_item(self, item, ctxt); |
| 175 | 175 | } |
| 176 | 176 | } |
| 177 | ||
| 178 | fn visit_foreign_item(&mut self, item: &'ast ForeignItem) -> Self::Result { | |
| 179 | if item.span.from_expansion() { | |
| 180 | self.handle_new_span(item.span, || { | |
| 181 | rustc_ast_pretty::pprust::foreign_item_to_string(item) | |
| 182 | }); | |
| 183 | } else { | |
| 184 | walk_item(self, item); | |
| 185 | } | |
| 186 | } | |
| 177 | 187 | } |
tests/assembly-llvm/debuginfo-for-profiling.rs created+56| ... | ... | @@ -0,0 +1,56 @@ |
| 1 | // Verify that additional discriminators are emitted for profiling with `-Zdebuginfo-for-profiling`: | |
| 2 | // - 0 discriminators are emitted without the flag in the test below | |
| 3 | // - at least 1 discriminator is emitted with the flag in the test below. | |
| 4 | // Actual count depends on the target | |
| 5 | // | |
| 6 | // | |
| 7 | //@ add-minicore | |
| 8 | //@ revisions: DEFAULT-X86 DEFAULT-AARCH64 DEBUGINFO-X86 DEBUGINFO-AARCH64 | |
| 9 | //@ assembly-output: emit-asm | |
| 10 | //@ compile-flags: -Copt-level=2 -Cdebuginfo=line-tables-only | |
| 11 | //@ [DEFAULT-X86] compile-flags: --target=x86_64-unknown-linux-gnu | |
| 12 | //@ [DEFAULT-X86] needs-llvm-components: x86 | |
| 13 | //@ [DEFAULT-AARCH64] compile-flags: --target=aarch64-unknown-linux-gnu | |
| 14 | //@ [DEFAULT-AARCH64] needs-llvm-components: aarch64 | |
| 15 | //@ [DEBUGINFO-X86] compile-flags: -Zdebuginfo-for-profiling --target=x86_64-unknown-linux-gnu | |
| 16 | //@ [DEBUGINFO-X86] needs-llvm-components: x86 | |
| 17 | //@ [DEBUGINFO-AARCH64] compile-flags: -Zdebuginfo-for-profiling --target=aarch64-unknown-linux-gnu | |
| 18 | //@ [DEBUGINFO-AARCH64] needs-llvm-components: aarch64 | |
| 19 | // DEFAULT-X86-NOT: discriminator | |
| 20 | // DEFAULT-AARCH64-NOT: discriminator | |
| 21 | // DEBUGINFO-X86-COUNT-1: discriminator | |
| 22 | // DEBUGINFO-AARCH64-COUNT-1: discriminator | |
| 23 | ||
| 24 | #![feature(no_core)] | |
| 25 | #![no_std] | |
| 26 | #![no_core] | |
| 27 | #![crate_type = "lib"] | |
| 28 | ||
| 29 | extern crate minicore; | |
| 30 | use minicore::*; | |
| 31 | ||
| 32 | extern "C" { | |
| 33 | fn add(_x: i32, _y: i32) -> i32; | |
| 34 | fn mul(_x: i32, _y: i32) -> i32; | |
| 35 | fn compute(_x: i32) -> i32; | |
| 36 | fn cond() -> bool; | |
| 37 | } | |
| 38 | ||
| 39 | #[no_mangle] | |
| 40 | pub fn f(limit: i32) -> i32 { | |
| 41 | unsafe { | |
| 42 | let mut sum = 0; | |
| 43 | let mut i = 1; | |
| 44 | ||
| 45 | while cond() { | |
| 46 | if cond() { | |
| 47 | sum = add(sum, compute(i)); | |
| 48 | } else { | |
| 49 | sum = add(sum, mul(compute(i), 2)); | |
| 50 | } | |
| 51 | i = add(i, 1); | |
| 52 | } | |
| 53 | ||
| 54 | sum | |
| 55 | } | |
| 56 | } |
tests/codegen-llvm/debuginfo-for-profiling.rs created+45| ... | ... | @@ -0,0 +1,45 @@ |
| 1 | // Verify that additional discriminators are emitted for profiling with `-Zdebuginfo-for-profiling`: | |
| 2 | // - 0 discriminators are emitted without the flag in the test below | |
| 3 | // - at least 1 discriminator is emitted with the flag in the test below | |
| 4 | // | |
| 5 | // | |
| 6 | //@ add-minicore | |
| 7 | //@ revisions: DEFAULT DEBUGINFO | |
| 8 | //@ compile-flags: -Copt-level=2 -Cdebuginfo=line-tables-only | |
| 9 | //@ [DEBUGINFO] compile-flags: -Zdebuginfo-for-profiling | |
| 10 | // DEFAULT-NOT: discriminator | |
| 11 | // DEBUGINFO-COUNT-1: discriminator | |
| 12 | ||
| 13 | #![feature(no_core)] | |
| 14 | #![no_std] | |
| 15 | #![no_core] | |
| 16 | #![crate_type = "lib"] | |
| 17 | ||
| 18 | extern crate minicore; | |
| 19 | use minicore::*; | |
| 20 | ||
| 21 | extern "C" { | |
| 22 | fn add(_x: i32, _y: i32) -> i32; | |
| 23 | fn mul(_x: i32, _y: i32) -> i32; | |
| 24 | fn compute(_x: i32) -> i32; | |
| 25 | fn cond() -> bool; | |
| 26 | } | |
| 27 | ||
| 28 | #[no_mangle] | |
| 29 | pub fn f(limit: i32) -> i32 { | |
| 30 | unsafe { | |
| 31 | let mut sum = 0; | |
| 32 | let mut i = 1; | |
| 33 | ||
| 34 | while cond() { | |
| 35 | if cond() { | |
| 36 | sum = add(sum, compute(i)); | |
| 37 | } else { | |
| 38 | sum = add(sum, mul(compute(i), 2)); | |
| 39 | } | |
| 40 | i = add(i, 1); | |
| 41 | } | |
| 42 | ||
| 43 | sum | |
| 44 | } | |
| 45 | } |
tests/codegen-llvm/hint/cold_path-target_feature.rs created+56| ... | ... | @@ -0,0 +1,56 @@ |
| 1 | //@ compile-flags: -Copt-level=3 | |
| 2 | //@ only-x86_64 | |
| 3 | #![crate_type = "lib"] | |
| 4 | ||
| 5 | // This test checks that hint::cold_path still works in #[target_feature] functions. | |
| 6 | ||
| 7 | use std::hint::cold_path; | |
| 8 | ||
| 9 | #[inline(never)] | |
| 10 | #[no_mangle] | |
| 11 | pub fn path_a() { | |
| 12 | println!("path a"); | |
| 13 | } | |
| 14 | ||
| 15 | #[inline(never)] | |
| 16 | #[no_mangle] | |
| 17 | pub fn path_b() { | |
| 18 | println!("path b"); | |
| 19 | } | |
| 20 | ||
| 21 | #[no_mangle] | |
| 22 | pub fn test1(x: bool) { | |
| 23 | if x { | |
| 24 | path_a(); | |
| 25 | } else { | |
| 26 | cold_path(); | |
| 27 | path_b(); | |
| 28 | } | |
| 29 | ||
| 30 | // CHECK-LABEL: @test1( | |
| 31 | // CHECK: br i1 %x, label %bb1, label %bb2, !prof ![[NUM:[0-9]+]] | |
| 32 | // CHECK: bb2: | |
| 33 | // CHECK: path_b | |
| 34 | // CHECK: bb1: | |
| 35 | // CHECK: path_a | |
| 36 | } | |
| 37 | ||
| 38 | #[no_mangle] | |
| 39 | #[target_feature(enable = "sse2")] | |
| 40 | pub fn with_target_feature(x: bool) { | |
| 41 | if x { | |
| 42 | path_a(); | |
| 43 | } else { | |
| 44 | cold_path(); | |
| 45 | path_b(); | |
| 46 | } | |
| 47 | ||
| 48 | // CHECK-LABEL: @with_target_feature( | |
| 49 | // CHECK: br i1 %x, label %bb1, label %bb2, !prof ![[NUM]] | |
| 50 | // CHECK: bb2: | |
| 51 | // CHECK: path_b | |
| 52 | // CHECK: bb1: | |
| 53 | // CHECK: path_a | |
| 54 | } | |
| 55 | ||
| 56 | // CHECK: ![[NUM]] = !{!"branch_weights", {{(!"expected", )?}}i32 2000, i32 1} |
tests/mir-opt/coroutine/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-abort.mir+2| ... | ... | @@ -86,10 +86,12 @@ fn a::{closure#0}(_1: Pin<&mut {async fn body of a<T>()}>, _2: &mut Context<'_>) |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | bb12: { |
| 89 | _9 = move _2; | |
| 89 | 90 | goto -> bb4; |
| 90 | 91 | } |
| 91 | 92 | |
| 92 | 93 | bb13: { |
| 94 | _13 = move _2; | |
| 93 | 95 | goto -> bb4; |
| 94 | 96 | } |
| 95 | 97 |
tests/mir-opt/coroutine/async_drop_live_dead.a-{closure#0}.coroutine_drop_async.0.panic-unwind.mir+2| ... | ... | @@ -105,10 +105,12 @@ fn a::{closure#0}(_1: Pin<&mut {async fn body of a<T>()}>, _2: &mut Context<'_>) |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | bb16: { |
| 108 | _9 = move _2; | |
| 108 | 109 | goto -> bb7; |
| 109 | 110 | } |
| 110 | 111 | |
| 111 | 112 | bb17: { |
| 113 | _13 = move _2; | |
| 112 | 114 | goto -> bb7; |
| 113 | 115 | } |
| 114 | 116 |
tests/rustdoc-html/macro-expansion/c-var-args.rs created+19| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | // Ensure that C var args (`va_list`) work. | |
| 2 | // Regression test for <https://github.com/rust-lang/rust/issues/156486>. | |
| 3 | ||
| 4 | //@ compile-flags: -Zunstable-options --generate-macro-expansion | |
| 5 | ||
| 6 | #![crate_name = "foo"] | |
| 7 | ||
| 8 | //@ has 'src/foo/c-var-args.rs.html' | |
| 9 | ||
| 10 | macro_rules! print { | |
| 11 | () => { | |
| 12 | fn printf(...); | |
| 13 | }; | |
| 14 | } | |
| 15 | ||
| 16 | //@ has - '//*[@class="expansion"]/*[@class="expanded"]' 'fn printf(...);' | |
| 17 | extern "C" { | |
| 18 | print! {} | |
| 19 | } |
tests/rustdoc-html/reexport/glob-reexport-feature-combination.rs created+67| ... | ... | @@ -0,0 +1,67 @@ |
| 1 | // This test ensures that `cfg`s are correctly propagated for re-export chains | |
| 2 | // where the outermost is a glob re-export. | |
| 3 | ||
| 4 | #![crate_name = "foo"] | |
| 5 | #![feature(doc_cfg)] | |
| 6 | ||
| 7 | //@ has 'foo/index.html' | |
| 8 | //@ count - '//*[@class="item-table"]/dt' 3 | |
| 9 | ||
| 10 | //@ has 'foo/index.html' | |
| 11 | //@ has - '//dt/a[@title="struct foo::A"]/../*[@class="stab portability"]' 'Non-bar and non-foo' | |
| 12 | ||
| 13 | //@ has 'foo/struct.A.html' | |
| 14 | //@ has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ | |
| 15 | // 'Available on non-crate feature bar and non-crate feature foo only.' | |
| 16 | ||
| 17 | mod a { | |
| 18 | mod inner { | |
| 19 | pub struct A {} | |
| 20 | } | |
| 21 | #[cfg(not(feature = "bar"))] | |
| 22 | pub use self::inner::A; | |
| 23 | } | |
| 24 | #[cfg(not(feature = "foo"))] | |
| 25 | pub use a::*; | |
| 26 | ||
| 27 | //@ has 'foo/index.html' | |
| 28 | //@ has - '//dt/a[@title="struct foo::B"]/../*[@class="stab portability"]' 'Non-bar and non-baz and non-foo' | |
| 29 | ||
| 30 | //@ has 'foo/struct.B.html' | |
| 31 | //@ has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ | |
| 32 | // 'Available on non-crate feature bar and non-crate feature baz and non-crate feature foo only.' | |
| 33 | ||
| 34 | mod b { | |
| 35 | mod inner { | |
| 36 | mod innermost { | |
| 37 | pub struct B {} | |
| 38 | } | |
| 39 | #[cfg(not(feature = "baz"))] | |
| 40 | pub use self::innermost::B; | |
| 41 | } | |
| 42 | #[cfg(not(feature = "bar"))] | |
| 43 | pub use self::inner::*; | |
| 44 | } | |
| 45 | #[cfg(not(feature = "foo"))] | |
| 46 | pub use b::*; | |
| 47 | ||
| 48 | //@ has 'foo/index.html' | |
| 49 | //@ has - '//dt/a[@title="struct foo::C"]/../*[@class="stab portability"]' 'Non-bar and non-baz and non-foo' | |
| 50 | ||
| 51 | //@ has 'foo/struct.C.html' | |
| 52 | //@ has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \ | |
| 53 | // 'Available on non-crate feature bar and non-crate feature baz and non-crate feature foo only.' | |
| 54 | ||
| 55 | mod c { | |
| 56 | mod inner { | |
| 57 | mod innermost { | |
| 58 | #[cfg(not(feature = "baz"))] | |
| 59 | pub struct C {} | |
| 60 | } | |
| 61 | pub use self::innermost::*; | |
| 62 | } | |
| 63 | #[cfg(not(feature = "bar"))] | |
| 64 | pub use self::inner::*; | |
| 65 | } | |
| 66 | #[cfg(not(feature = "foo"))] | |
| 67 | pub use c::*; |
tests/rustdoc-json/attrs/derive_helper.rs created+7| ... | ... | @@ -0,0 +1,7 @@ |
| 1 | //@ is "$.index[?(@.name=='A')].attrs" '[{"other": "#[default]"}]' | |
| 2 | #[derive(Default)] | |
| 3 | pub enum Test { | |
| 4 | #[default] | |
| 5 | A, | |
| 6 | B, | |
| 7 | } |
tests/ui/attributes/arg-error-issue-121425.rs+6-6| ... | ... | @@ -2,28 +2,28 @@ |
| 2 | 2 | |
| 3 | 3 | const N: usize = 8; |
| 4 | 4 | #[repr(align(N))] |
| 5 | //~^ ERROR: incorrect `repr(align)` attribute format | |
| 5 | //~^ ERROR: malformed `repr` attribute input | |
| 6 | 6 | struct T; |
| 7 | 7 | |
| 8 | 8 | #[repr(align('a'))] |
| 9 | //~^ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer [E0589] | |
| 9 | //~^ ERROR: not an unsuffixed integer [E0589] | |
| 10 | 10 | struct H; |
| 11 | 11 | |
| 12 | 12 | #[repr(align("str"))] |
| 13 | //~^ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer [E0589] | |
| 13 | //~^ ERROR: not an unsuffixed integer [E0589] | |
| 14 | 14 | struct L; |
| 15 | 15 | |
| 16 | 16 | #[repr(align())] |
| 17 | //~^ ERROR: attribute format: `align` takes exactly one argument in parentheses | |
| 17 | //~^ ERROR: malformed `repr` attribute input | |
| 18 | 18 | struct X; |
| 19 | 19 | |
| 20 | 20 | const P: usize = 8; |
| 21 | 21 | #[repr(packed(P))] |
| 22 | //~^ ERROR: attribute format: `packed` expects a literal integer as argument | |
| 22 | //~^ ERROR: malformed `repr` attribute input | |
| 23 | 23 | struct A; |
| 24 | 24 | |
| 25 | 25 | #[repr(packed())] |
| 26 | //~^ ERROR: attribute format: `packed` takes exactly one parenthesized argument, or no parentheses at all | |
| 26 | //~^ ERROR: malformed `repr` attribute input | |
| 27 | 27 | struct B; |
| 28 | 28 | |
| 29 | 29 | #[repr(packed)] |
tests/ui/attributes/arg-error-issue-121425.stderr+32-16| ... | ... | @@ -1,40 +1,56 @@ |
| 1 | error[E0693]: incorrect `repr(align)` attribute format: `align` expects a literal integer as argument | |
| 2 | --> $DIR/arg-error-issue-121425.rs:4:14 | |
| 1 | error[E0539]: malformed `repr` attribute input | |
| 2 | --> $DIR/arg-error-issue-121425.rs:4:1 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[repr(align(N))] |
| 5 | | ^ | |
| 5 | | ^^^^^^^^^^^^^-^^^ | |
| 6 | | | | |
| 7 | | expected an integer literal here | |
| 8 | | | |
| 9 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 6 | 10 | |
| 7 | error[E0589]: invalid `repr(align)` attribute: not an unsuffixed integer | |
| 11 | error[E0589]: invalid alignment value: not an unsuffixed integer | |
| 8 | 12 | --> $DIR/arg-error-issue-121425.rs:8:14 |
| 9 | 13 | | |
| 10 | 14 | LL | #[repr(align('a'))] |
| 11 | 15 | | ^^^ |
| 12 | 16 | |
| 13 | error[E0589]: invalid `repr(align)` attribute: not an unsuffixed integer | |
| 17 | error[E0589]: invalid alignment value: not an unsuffixed integer | |
| 14 | 18 | --> $DIR/arg-error-issue-121425.rs:12:14 |
| 15 | 19 | | |
| 16 | 20 | LL | #[repr(align("str"))] |
| 17 | 21 | | ^^^^^ |
| 18 | 22 | |
| 19 | error[E0693]: incorrect `repr(align)` attribute format: `align` takes exactly one argument in parentheses | |
| 20 | --> $DIR/arg-error-issue-121425.rs:16:8 | |
| 23 | error[E0805]: malformed `repr` attribute input | |
| 24 | --> $DIR/arg-error-issue-121425.rs:16:1 | |
| 21 | 25 | | |
| 22 | 26 | LL | #[repr(align())] |
| 23 | | ^^^^^^^ | |
| 27 | | ^^^^^^^^^^^^--^^ | |
| 28 | | | | |
| 29 | | expected an argument here | |
| 30 | | | |
| 31 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 24 | 32 | |
| 25 | error[E0552]: incorrect `repr(packed)` attribute format: `packed` expects a literal integer as argument | |
| 26 | --> $DIR/arg-error-issue-121425.rs:21:15 | |
| 33 | error[E0539]: malformed `repr` attribute input | |
| 34 | --> $DIR/arg-error-issue-121425.rs:21:1 | |
| 27 | 35 | | |
| 28 | 36 | LL | #[repr(packed(P))] |
| 29 | | ^ | |
| 37 | | ^^^^^^^^^^^^^^-^^^ | |
| 38 | | | | |
| 39 | | expected an integer literal here | |
| 40 | | | |
| 41 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 30 | 42 | |
| 31 | error[E0552]: incorrect `repr(packed)` attribute format: `packed` takes exactly one parenthesized argument, or no parentheses at all | |
| 32 | --> $DIR/arg-error-issue-121425.rs:25:8 | |
| 43 | error[E0805]: malformed `repr` attribute input | |
| 44 | --> $DIR/arg-error-issue-121425.rs:25:1 | |
| 33 | 45 | | |
| 34 | 46 | LL | #[repr(packed())] |
| 35 | | ^^^^^^^^ | |
| 47 | | ^^^^^^^^^^^^^--^^ | |
| 48 | | | | |
| 49 | | expected an argument here | |
| 50 | | | |
| 51 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 36 | 52 | |
| 37 | 53 | error: aborting due to 6 previous errors |
| 38 | 54 | |
| 39 | Some errors have detailed explanations: E0552, E0589, E0693. | |
| 40 | For more information about an error, try `rustc --explain E0552`. | |
| 55 | Some errors have detailed explanations: E0539, E0589, E0805. | |
| 56 | For more information about an error, try `rustc --explain E0539`. |
tests/ui/attributes/attribute-on-wrong-item-inline-repr.rs+2-2| ... | ... | @@ -16,13 +16,13 @@ fn main() { |
| 16 | 16 | |
| 17 | 17 | #[repr(nothing)] |
| 18 | 18 | let _x = 0; |
| 19 | //~^^ ERROR E0552 | |
| 19 | //~^^ ERROR malformed `repr` attribute input | |
| 20 | 20 | |
| 21 | 21 | #[repr(something_not_real)] |
| 22 | 22 | loop { |
| 23 | 23 | () |
| 24 | 24 | }; |
| 25 | //~^^^^ ERROR E0552 | |
| 25 | //~^^^^ ERROR malformed `repr` attribute input | |
| 26 | 26 | |
| 27 | 27 | #[repr] |
| 28 | 28 | let _y = "123"; |
tests/ui/attributes/attribute-on-wrong-item-inline-repr.stderr+13-12| ... | ... | @@ -35,23 +35,25 @@ LL | #[inline(XYZ)] |
| 35 | 35 | | |
| 36 | 36 | = help: `#[inline]` can only be applied to functions |
| 37 | 37 | |
| 38 | error[E0552]: unrecognized representation hint | |
| 39 | --> $DIR/attribute-on-wrong-item-inline-repr.rs:17:12 | |
| 38 | error[E0539]: malformed `repr` attribute input | |
| 39 | --> $DIR/attribute-on-wrong-item-inline-repr.rs:17:5 | |
| 40 | 40 | | |
| 41 | 41 | LL | #[repr(nothing)] |
| 42 | | ^^^^^^^ | |
| 42 | | ^^^^^^^-------^^ | |
| 43 | | | | |
| 44 | | valid arguments are `align`, `packed`, `Rust`, `C`, `simd`, `transparent`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize` or `usize` | |
| 43 | 45 | | |
| 44 | = help: valid reprs are `Rust` (default), `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` | |
| 45 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html?highlight=repr#representations> | |
| 46 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 46 | 47 | |
| 47 | error[E0552]: unrecognized representation hint | |
| 48 | --> $DIR/attribute-on-wrong-item-inline-repr.rs:21:12 | |
| 48 | error[E0539]: malformed `repr` attribute input | |
| 49 | --> $DIR/attribute-on-wrong-item-inline-repr.rs:21:5 | |
| 49 | 50 | | |
| 50 | 51 | LL | #[repr(something_not_real)] |
| 51 | | ^^^^^^^^^^^^^^^^^^ | |
| 52 | | ^^^^^^^------------------^^ | |
| 53 | | | | |
| 54 | | valid arguments are `align`, `packed`, `Rust`, `C`, `simd`, `transparent`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize` or `usize` | |
| 52 | 55 | | |
| 53 | = help: valid reprs are `Rust` (default), `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` | |
| 54 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html?highlight=repr#representations> | |
| 56 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 55 | 57 | |
| 56 | 58 | error[E0539]: malformed `repr` attribute input |
| 57 | 59 | --> $DIR/attribute-on-wrong-item-inline-repr.rs:27:5 |
| ... | ... | @@ -100,5 +102,4 @@ LL | let _z = #[repr] 1; |
| 100 | 102 | |
| 101 | 103 | error: aborting due to 9 previous errors |
| 102 | 104 | |
| 103 | Some errors have detailed explanations: E0539, E0552. | |
| 104 | For more information about an error, try `rustc --explain E0539`. | |
| 105 | For more information about this error, try `rustc --explain E0539`. |
tests/ui/attributes/invalid-macro-use.stderr+2-2| ... | ... | @@ -28,7 +28,7 @@ LL - #[macro_use = 5] |
| 28 | 28 | LL + #[macro_use] |
| 29 | 29 | | |
| 30 | 30 | |
| 31 | error[E0539]: malformed `macro_use` attribute input | |
| 31 | error[E0565]: malformed `macro_use` attribute input | |
| 32 | 32 | --> $DIR/invalid-macro-use.rs:10:1 |
| 33 | 33 | | |
| 34 | 34 | LL | #[macro_use(5)] |
| ... | ... | @@ -82,7 +82,7 @@ LL - #[macro_use(a(b))] |
| 82 | 82 | LL + #[macro_use] |
| 83 | 83 | | |
| 84 | 84 | |
| 85 | error[E0539]: malformed `macro_use` attribute input | |
| 85 | error[E0565]: malformed `macro_use` attribute input | |
| 86 | 86 | --> $DIR/invalid-macro-use.rs:28:1 |
| 87 | 87 | | |
| 88 | 88 | LL | #[macro_use(a::b)] |
tests/ui/attributes/invalid-reprs.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | fn main() { |
| 2 | 2 | let y = #[repr(uwu(4))] |
| 3 | 3 | //~^ ERROR attributes on expressions are experimental |
| 4 | //~| ERROR unrecognized representation hint | |
| 4 | //~| ERROR malformed `repr` attribute input | |
| 5 | 5 | (&id(5)); //~ ERROR: cannot find function `id` in this scope |
| 6 | 6 | } |
tests/ui/attributes/invalid-reprs.stderr+7-6| ... | ... | @@ -19,16 +19,17 @@ help: consider importing this function |
| 19 | 19 | LL + use std::process::id; |
| 20 | 20 | | |
| 21 | 21 | |
| 22 | error[E0552]: unrecognized representation hint | |
| 23 | --> $DIR/invalid-reprs.rs:2:20 | |
| 22 | error[E0539]: malformed `repr` attribute input | |
| 23 | --> $DIR/invalid-reprs.rs:2:13 | |
| 24 | 24 | | |
| 25 | 25 | LL | let y = #[repr(uwu(4))] |
| 26 | | ^^^^^^ | |
| 26 | | ^^^^^^^------^^ | |
| 27 | | | | |
| 28 | | valid arguments are `align`, `packed`, `Rust`, `C`, `simd`, `transparent`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize` or `usize` | |
| 27 | 29 | | |
| 28 | = help: valid reprs are `Rust` (default), `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` | |
| 29 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html?highlight=repr#representations> | |
| 30 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 30 | 31 | |
| 31 | 32 | error: aborting due to 3 previous errors |
| 32 | 33 | |
| 33 | Some errors have detailed explanations: E0425, E0552, E0658. | |
| 34 | Some errors have detailed explanations: E0425, E0539, E0658. | |
| 34 | 35 | For more information about an error, try `rustc --explain E0425`. |
tests/ui/attributes/malformed-reprs.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | |
| 8 | 8 | // This is a regression test for https://github.com/rust-lang/rust/issues/143479 |
| 9 | 9 | #[repr(align(0))] |
| 10 | //~^ ERROR invalid `repr(align)` attribute: not a power of two | |
| 10 | //~^ ERROR not a power of two | |
| 11 | 11 | //~| ERROR unsupported representation for zero-variant enum [E0084] |
| 12 | 12 | enum Foo {} |
| 13 | 13 |
tests/ui/attributes/malformed-reprs.stderr+1-1| ... | ... | @@ -21,7 +21,7 @@ LL - #![repr] |
| 21 | 21 | LL + #[repr] |
| 22 | 22 | | |
| 23 | 23 | |
| 24 | error[E0589]: invalid `repr(align)` attribute: not a power of two | |
| 24 | error[E0589]: invalid alignment value: not a power of two | |
| 25 | 25 | --> $DIR/malformed-reprs.rs:9:14 |
| 26 | 26 | | |
| 27 | 27 | LL | #[repr(align(0))] |
tests/ui/attributes/repr-align-in-trait-issue-132391.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | trait MyTrait { |
| 2 | #[repr(align)] //~ ERROR invalid `repr(align)` attribute: `align` needs an argument | |
| 2 | #[repr(align)] //~ ERROR malformed `repr` attribute input | |
| 3 | 3 | fn myfun(); |
| 4 | 4 | } |
| 5 | 5 |
tests/ui/attributes/repr-align-in-trait-issue-132391.stderr+8-4| ... | ... | @@ -1,9 +1,13 @@ |
| 1 | error[E0589]: invalid `repr(align)` attribute: `align` needs an argument | |
| 2 | --> $DIR/repr-align-in-trait-issue-132391.rs:2:12 | |
| 1 | error[E0539]: malformed `repr` attribute input | |
| 2 | --> $DIR/repr-align-in-trait-issue-132391.rs:2:5 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[repr(align)] |
| 5 | | ^^^^^ help: supply an argument here: `align(...)` | |
| 5 | | ^^^^^^^-----^^ | |
| 6 | | | | |
| 7 | | expected this to be a list | |
| 8 | | | |
| 9 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 6 | 10 | |
| 7 | 11 | error: aborting due to 1 previous error |
| 8 | 12 | |
| 9 | For more information about this error, try `rustc --explain E0589`. | |
| 13 | For more information about this error, try `rustc --explain E0539`. |
tests/ui/cfg/cfg-path-error.stderr+5-5| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0539]: malformed `cfg` attribute input | |
| 1 | error[E0565]: malformed `cfg` attribute input | |
| 2 | 2 | --> $DIR/cfg-path-error.rs:6:1 |
| 3 | 3 | | |
| 4 | 4 | LL | #[cfg(any(foo, foo::bar))] |
| ... | ... | @@ -13,7 +13,7 @@ LL - #[cfg(any(foo, foo::bar))] |
| 13 | 13 | LL + #[cfg(predicate)] |
| 14 | 14 | | |
| 15 | 15 | |
| 16 | error[E0539]: malformed `cfg` attribute input | |
| 16 | error[E0565]: malformed `cfg` attribute input | |
| 17 | 17 | --> $DIR/cfg-path-error.rs:12:1 |
| 18 | 18 | | |
| 19 | 19 | LL | #[cfg(any(foo::bar, foo))] |
| ... | ... | @@ -28,7 +28,7 @@ LL - #[cfg(any(foo::bar, foo))] |
| 28 | 28 | LL + #[cfg(predicate)] |
| 29 | 29 | | |
| 30 | 30 | |
| 31 | error[E0539]: malformed `cfg` attribute input | |
| 31 | error[E0565]: malformed `cfg` attribute input | |
| 32 | 32 | --> $DIR/cfg-path-error.rs:18:1 |
| 33 | 33 | | |
| 34 | 34 | LL | #[cfg(all(foo, foo::bar))] |
| ... | ... | @@ -43,7 +43,7 @@ LL - #[cfg(all(foo, foo::bar))] |
| 43 | 43 | LL + #[cfg(predicate)] |
| 44 | 44 | | |
| 45 | 45 | |
| 46 | error[E0539]: malformed `cfg` attribute input | |
| 46 | error[E0565]: malformed `cfg` attribute input | |
| 47 | 47 | --> $DIR/cfg-path-error.rs:24:1 |
| 48 | 48 | | |
| 49 | 49 | LL | #[cfg(all(foo::bar, foo))] |
| ... | ... | @@ -60,4 +60,4 @@ LL + #[cfg(predicate)] |
| 60 | 60 | |
| 61 | 61 | error: aborting due to 4 previous errors |
| 62 | 62 | |
| 63 | For more information about this error, try `rustc --explain E0539`. | |
| 63 | For more information about this error, try `rustc --explain E0565`. |
tests/ui/cfg/cfg-target-compact-errors.stderr+4-3| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0539]: malformed `cfg` attribute input | |
| 1 | error[E0565]: malformed `cfg` attribute input | |
| 2 | 2 | --> $DIR/cfg-target-compact-errors.rs:5:1 |
| 3 | 3 | | |
| 4 | 4 | LL | #[cfg(target(o::o))] |
| ... | ... | @@ -73,7 +73,7 @@ LL - #[cfg(target(true))] |
| 73 | 73 | LL + #[cfg(predicate)] |
| 74 | 74 | | |
| 75 | 75 | |
| 76 | error[E0539]: malformed `cfg` attribute input | |
| 76 | error[E0565]: malformed `cfg` attribute input | |
| 77 | 77 | --> $DIR/cfg-target-compact-errors.rs:32:1 |
| 78 | 78 | | |
| 79 | 79 | LL | #[cfg(target(clippy::os = "linux"))] |
| ... | ... | @@ -90,4 +90,5 @@ LL + #[cfg(predicate)] |
| 90 | 90 | |
| 91 | 91 | error: aborting due to 6 previous errors |
| 92 | 92 | |
| 93 | For more information about this error, try `rustc --explain E0539`. | |
| 93 | Some errors have detailed explanations: E0539, E0565. | |
| 94 | For more information about an error, try `rustc --explain E0539`. |
tests/ui/cfg/path-kw-as-cfg-pred.stderr+33-33| ... | ... | @@ -118,7 +118,7 @@ error: `_` cannot be a raw identifier |
| 118 | 118 | LL | #[cfg_attr(r#_, cfg(r#_))] |
| 119 | 119 | | ^^^ |
| 120 | 120 | |
| 121 | error[E0539]: malformed `cfg` attribute input | |
| 121 | error[E0565]: malformed `cfg` attribute input | |
| 122 | 122 | --> $DIR/path-kw-as-cfg-pred.rs:20:1 |
| 123 | 123 | | |
| 124 | 124 | LL | #[cfg(crate)] |
| ... | ... | @@ -133,7 +133,7 @@ LL - #[cfg(crate)] |
| 133 | 133 | LL + #[cfg(predicate)] |
| 134 | 134 | | |
| 135 | 135 | |
| 136 | error[E0539]: malformed `cfg` attribute input | |
| 136 | error[E0565]: malformed `cfg` attribute input | |
| 137 | 137 | --> $DIR/path-kw-as-cfg-pred.rs:22:1 |
| 138 | 138 | | |
| 139 | 139 | LL | #[cfg(super)] |
| ... | ... | @@ -148,7 +148,7 @@ LL - #[cfg(super)] |
| 148 | 148 | LL + #[cfg(predicate)] |
| 149 | 149 | | |
| 150 | 150 | |
| 151 | error[E0539]: malformed `cfg` attribute input | |
| 151 | error[E0565]: malformed `cfg` attribute input | |
| 152 | 152 | --> $DIR/path-kw-as-cfg-pred.rs:24:1 |
| 153 | 153 | | |
| 154 | 154 | LL | #[cfg(self)] |
| ... | ... | @@ -163,7 +163,7 @@ LL - #[cfg(self)] |
| 163 | 163 | LL + #[cfg(predicate)] |
| 164 | 164 | | |
| 165 | 165 | |
| 166 | error[E0539]: malformed `cfg` attribute input | |
| 166 | error[E0565]: malformed `cfg` attribute input | |
| 167 | 167 | --> $DIR/path-kw-as-cfg-pred.rs:26:1 |
| 168 | 168 | | |
| 169 | 169 | LL | #[cfg(Self)] |
| ... | ... | @@ -178,7 +178,7 @@ LL - #[cfg(Self)] |
| 178 | 178 | LL + #[cfg(predicate)] |
| 179 | 179 | | |
| 180 | 180 | |
| 181 | error[E0539]: malformed `cfg_attr` attribute input | |
| 181 | error[E0565]: malformed `cfg_attr` attribute input | |
| 182 | 182 | --> $DIR/path-kw-as-cfg-pred.rs:28:1 |
| 183 | 183 | | |
| 184 | 184 | LL | #[cfg_attr(crate, path = "foo")] |
| ... | ... | @@ -193,7 +193,7 @@ LL - #[cfg_attr(crate, path = "foo")] |
| 193 | 193 | LL + #[cfg_attr(predicate, attr1, attr2, ...)] |
| 194 | 194 | | |
| 195 | 195 | |
| 196 | error[E0539]: malformed `cfg_attr` attribute input | |
| 196 | error[E0565]: malformed `cfg_attr` attribute input | |
| 197 | 197 | --> $DIR/path-kw-as-cfg-pred.rs:30:1 |
| 198 | 198 | | |
| 199 | 199 | LL | #[cfg_attr(super, path = "foo")] |
| ... | ... | @@ -208,7 +208,7 @@ LL - #[cfg_attr(super, path = "foo")] |
| 208 | 208 | LL + #[cfg_attr(predicate, attr1, attr2, ...)] |
| 209 | 209 | | |
| 210 | 210 | |
| 211 | error[E0539]: malformed `cfg_attr` attribute input | |
| 211 | error[E0565]: malformed `cfg_attr` attribute input | |
| 212 | 212 | --> $DIR/path-kw-as-cfg-pred.rs:32:1 |
| 213 | 213 | | |
| 214 | 214 | LL | #[cfg_attr(self, path = "foo")] |
| ... | ... | @@ -223,7 +223,7 @@ LL - #[cfg_attr(self, path = "foo")] |
| 223 | 223 | LL + #[cfg_attr(predicate, attr1, attr2, ...)] |
| 224 | 224 | | |
| 225 | 225 | |
| 226 | error[E0539]: malformed `cfg_attr` attribute input | |
| 226 | error[E0565]: malformed `cfg_attr` attribute input | |
| 227 | 227 | --> $DIR/path-kw-as-cfg-pred.rs:34:1 |
| 228 | 228 | | |
| 229 | 229 | LL | #[cfg_attr(Self, path = "foo")] |
| ... | ... | @@ -238,7 +238,7 @@ LL - #[cfg_attr(Self, path = "foo")] |
| 238 | 238 | LL + #[cfg_attr(predicate, attr1, attr2, ...)] |
| 239 | 239 | | |
| 240 | 240 | |
| 241 | error[E0539]: malformed `cfg` attribute input | |
| 241 | error[E0565]: malformed `cfg` attribute input | |
| 242 | 242 | --> $DIR/path-kw-as-cfg-pred.rs:36:18 |
| 243 | 243 | | |
| 244 | 244 | LL | #[cfg_attr(true, cfg(crate))] |
| ... | ... | @@ -253,7 +253,7 @@ LL - #[cfg_attr(true, cfg(crate))] |
| 253 | 253 | LL + #[cfg_attr(true, cfg(predicate))] |
| 254 | 254 | | |
| 255 | 255 | |
| 256 | error[E0539]: malformed `cfg` attribute input | |
| 256 | error[E0565]: malformed `cfg` attribute input | |
| 257 | 257 | --> $DIR/path-kw-as-cfg-pred.rs:38:18 |
| 258 | 258 | | |
| 259 | 259 | LL | #[cfg_attr(true, cfg(super))] |
| ... | ... | @@ -268,7 +268,7 @@ LL - #[cfg_attr(true, cfg(super))] |
| 268 | 268 | LL + #[cfg_attr(true, cfg(predicate))] |
| 269 | 269 | | |
| 270 | 270 | |
| 271 | error[E0539]: malformed `cfg` attribute input | |
| 271 | error[E0565]: malformed `cfg` attribute input | |
| 272 | 272 | --> $DIR/path-kw-as-cfg-pred.rs:40:18 |
| 273 | 273 | | |
| 274 | 274 | LL | #[cfg_attr(true, cfg(self))] |
| ... | ... | @@ -283,7 +283,7 @@ LL - #[cfg_attr(true, cfg(self))] |
| 283 | 283 | LL + #[cfg_attr(true, cfg(predicate))] |
| 284 | 284 | | |
| 285 | 285 | |
| 286 | error[E0539]: malformed `cfg` attribute input | |
| 286 | error[E0565]: malformed `cfg` attribute input | |
| 287 | 287 | --> $DIR/path-kw-as-cfg-pred.rs:42:18 |
| 288 | 288 | | |
| 289 | 289 | LL | #[cfg_attr(true, cfg(Self))] |
| ... | ... | @@ -362,7 +362,7 @@ error: expected identifier, found reserved identifier `_` |
| 362 | 362 | LL | #[cfg_attr(true, cfg(_))] |
| 363 | 363 | | ^ expected identifier, found reserved identifier |
| 364 | 364 | |
| 365 | error[E0539]: malformed `cfg` attribute input | |
| 365 | error[E0565]: malformed `cfg` attribute input | |
| 366 | 366 | --> $DIR/path-kw-as-cfg-pred.rs:90:1 |
| 367 | 367 | | |
| 368 | 368 | LL | #[cfg(r#crate)] |
| ... | ... | @@ -377,7 +377,7 @@ LL - #[cfg(r#crate)] |
| 377 | 377 | LL + #[cfg(predicate)] |
| 378 | 378 | | |
| 379 | 379 | |
| 380 | error[E0539]: malformed `cfg` attribute input | |
| 380 | error[E0565]: malformed `cfg` attribute input | |
| 381 | 381 | --> $DIR/path-kw-as-cfg-pred.rs:93:1 |
| 382 | 382 | | |
| 383 | 383 | LL | #[cfg(r#super)] |
| ... | ... | @@ -392,7 +392,7 @@ LL - #[cfg(r#super)] |
| 392 | 392 | LL + #[cfg(predicate)] |
| 393 | 393 | | |
| 394 | 394 | |
| 395 | error[E0539]: malformed `cfg` attribute input | |
| 395 | error[E0565]: malformed `cfg` attribute input | |
| 396 | 396 | --> $DIR/path-kw-as-cfg-pred.rs:96:1 |
| 397 | 397 | | |
| 398 | 398 | LL | #[cfg(r#self)] |
| ... | ... | @@ -407,7 +407,7 @@ LL - #[cfg(r#self)] |
| 407 | 407 | LL + #[cfg(predicate)] |
| 408 | 408 | | |
| 409 | 409 | |
| 410 | error[E0539]: malformed `cfg` attribute input | |
| 410 | error[E0565]: malformed `cfg` attribute input | |
| 411 | 411 | --> $DIR/path-kw-as-cfg-pred.rs:99:1 |
| 412 | 412 | | |
| 413 | 413 | LL | #[cfg(r#Self)] |
| ... | ... | @@ -422,7 +422,7 @@ LL - #[cfg(r#Self)] |
| 422 | 422 | LL + #[cfg(predicate)] |
| 423 | 423 | | |
| 424 | 424 | |
| 425 | error[E0539]: malformed `cfg_attr` attribute input | |
| 425 | error[E0565]: malformed `cfg_attr` attribute input | |
| 426 | 426 | --> $DIR/path-kw-as-cfg-pred.rs:102:1 |
| 427 | 427 | | |
| 428 | 428 | LL | #[cfg_attr(r#crate, cfg(r#crate))] |
| ... | ... | @@ -437,7 +437,7 @@ LL - #[cfg_attr(r#crate, cfg(r#crate))] |
| 437 | 437 | LL + #[cfg_attr(predicate, attr1, attr2, ...)] |
| 438 | 438 | | |
| 439 | 439 | |
| 440 | error[E0539]: malformed `cfg_attr` attribute input | |
| 440 | error[E0565]: malformed `cfg_attr` attribute input | |
| 441 | 441 | --> $DIR/path-kw-as-cfg-pred.rs:106:1 |
| 442 | 442 | | |
| 443 | 443 | LL | #[cfg_attr(r#super, cfg(r#super))] |
| ... | ... | @@ -452,7 +452,7 @@ LL - #[cfg_attr(r#super, cfg(r#super))] |
| 452 | 452 | LL + #[cfg_attr(predicate, attr1, attr2, ...)] |
| 453 | 453 | | |
| 454 | 454 | |
| 455 | error[E0539]: malformed `cfg_attr` attribute input | |
| 455 | error[E0565]: malformed `cfg_attr` attribute input | |
| 456 | 456 | --> $DIR/path-kw-as-cfg-pred.rs:110:1 |
| 457 | 457 | | |
| 458 | 458 | LL | #[cfg_attr(r#self, cfg(r#self))] |
| ... | ... | @@ -467,7 +467,7 @@ LL - #[cfg_attr(r#self, cfg(r#self))] |
| 467 | 467 | LL + #[cfg_attr(predicate, attr1, attr2, ...)] |
| 468 | 468 | | |
| 469 | 469 | |
| 470 | error[E0539]: malformed `cfg_attr` attribute input | |
| 470 | error[E0565]: malformed `cfg_attr` attribute input | |
| 471 | 471 | --> $DIR/path-kw-as-cfg-pred.rs:114:1 |
| 472 | 472 | | |
| 473 | 473 | LL | #[cfg_attr(r#Self, cfg(r#Self))] |
| ... | ... | @@ -482,7 +482,7 @@ LL - #[cfg_attr(r#Self, cfg(r#Self))] |
| 482 | 482 | LL + #[cfg_attr(predicate, attr1, attr2, ...)] |
| 483 | 483 | | |
| 484 | 484 | |
| 485 | error[E0539]: malformed `cfg` attribute input | |
| 485 | error[E0565]: malformed `cfg` attribute input | |
| 486 | 486 | --> $DIR/path-kw-as-cfg-pred.rs:9:9 |
| 487 | 487 | | |
| 488 | 488 | LL | #[cfg($crate)] |
| ... | ... | @@ -501,7 +501,7 @@ LL - #[cfg($crate)] |
| 501 | 501 | LL + #[cfg(predicate)] |
| 502 | 502 | | |
| 503 | 503 | |
| 504 | error[E0539]: malformed `cfg_attr` attribute input | |
| 504 | error[E0565]: malformed `cfg_attr` attribute input | |
| 505 | 505 | --> $DIR/path-kw-as-cfg-pred.rs:11:9 |
| 506 | 506 | | |
| 507 | 507 | LL | #[cfg_attr($crate, path = "foo")] |
| ... | ... | @@ -520,7 +520,7 @@ LL - #[cfg_attr($crate, path = "foo")] |
| 520 | 520 | LL + #[cfg_attr(predicate, attr1, attr2, ...)] |
| 521 | 521 | | |
| 522 | 522 | |
| 523 | error[E0539]: malformed `cfg` attribute input | |
| 523 | error[E0565]: malformed `cfg` attribute input | |
| 524 | 524 | --> $DIR/path-kw-as-cfg-pred.rs:13:26 |
| 525 | 525 | | |
| 526 | 526 | LL | #[cfg_attr(true, cfg($crate))] |
| ... | ... | @@ -539,7 +539,7 @@ LL - #[cfg_attr(true, cfg($crate))] |
| 539 | 539 | LL + #[cfg_attr(true, cfg(predicate))] |
| 540 | 540 | | |
| 541 | 541 | |
| 542 | error[E0539]: malformed `cfg` macro input | |
| 542 | error[E0565]: malformed `cfg` macro input | |
| 543 | 543 | --> $DIR/path-kw-as-cfg-pred.rs:16:9 |
| 544 | 544 | | |
| 545 | 545 | LL | cfg!($crate); |
| ... | ... | @@ -558,7 +558,7 @@ LL - cfg!($crate); |
| 558 | 558 | LL + cfg!(predicate); |
| 559 | 559 | | |
| 560 | 560 | |
| 561 | error[E0539]: malformed `cfg` macro input | |
| 561 | error[E0565]: malformed `cfg` macro input | |
| 562 | 562 | --> $DIR/path-kw-as-cfg-pred.rs:67:5 |
| 563 | 563 | | |
| 564 | 564 | LL | cfg!(crate); |
| ... | ... | @@ -573,7 +573,7 @@ LL - cfg!(crate); |
| 573 | 573 | LL + cfg!(predicate); |
| 574 | 574 | | |
| 575 | 575 | |
| 576 | error[E0539]: malformed `cfg` macro input | |
| 576 | error[E0565]: malformed `cfg` macro input | |
| 577 | 577 | --> $DIR/path-kw-as-cfg-pred.rs:68:5 |
| 578 | 578 | | |
| 579 | 579 | LL | cfg!(super); |
| ... | ... | @@ -588,7 +588,7 @@ LL - cfg!(super); |
| 588 | 588 | LL + cfg!(predicate); |
| 589 | 589 | | |
| 590 | 590 | |
| 591 | error[E0539]: malformed `cfg` macro input | |
| 591 | error[E0565]: malformed `cfg` macro input | |
| 592 | 592 | --> $DIR/path-kw-as-cfg-pred.rs:69:5 |
| 593 | 593 | | |
| 594 | 594 | LL | cfg!(self); |
| ... | ... | @@ -603,7 +603,7 @@ LL - cfg!(self); |
| 603 | 603 | LL + cfg!(predicate); |
| 604 | 604 | | |
| 605 | 605 | |
| 606 | error[E0539]: malformed `cfg` macro input | |
| 606 | error[E0565]: malformed `cfg` macro input | |
| 607 | 607 | --> $DIR/path-kw-as-cfg-pred.rs:70:5 |
| 608 | 608 | | |
| 609 | 609 | LL | cfg!(Self); |
| ... | ... | @@ -618,7 +618,7 @@ LL - cfg!(Self); |
| 618 | 618 | LL + cfg!(predicate); |
| 619 | 619 | | |
| 620 | 620 | |
| 621 | error[E0539]: malformed `cfg` macro input | |
| 621 | error[E0565]: malformed `cfg` macro input | |
| 622 | 622 | --> $DIR/path-kw-as-cfg-pred.rs:72:5 |
| 623 | 623 | | |
| 624 | 624 | LL | cfg!(r#crate); |
| ... | ... | @@ -633,7 +633,7 @@ LL - cfg!(r#crate); |
| 633 | 633 | LL + cfg!(predicate); |
| 634 | 634 | | |
| 635 | 635 | |
| 636 | error[E0539]: malformed `cfg` macro input | |
| 636 | error[E0565]: malformed `cfg` macro input | |
| 637 | 637 | --> $DIR/path-kw-as-cfg-pred.rs:74:5 |
| 638 | 638 | | |
| 639 | 639 | LL | cfg!(r#super); |
| ... | ... | @@ -648,7 +648,7 @@ LL - cfg!(r#super); |
| 648 | 648 | LL + cfg!(predicate); |
| 649 | 649 | | |
| 650 | 650 | |
| 651 | error[E0539]: malformed `cfg` macro input | |
| 651 | error[E0565]: malformed `cfg` macro input | |
| 652 | 652 | --> $DIR/path-kw-as-cfg-pred.rs:76:5 |
| 653 | 653 | | |
| 654 | 654 | LL | cfg!(r#self); |
| ... | ... | @@ -663,7 +663,7 @@ LL - cfg!(r#self); |
| 663 | 663 | LL + cfg!(predicate); |
| 664 | 664 | | |
| 665 | 665 | |
| 666 | error[E0539]: malformed `cfg` macro input | |
| 666 | error[E0565]: malformed `cfg` macro input | |
| 667 | 667 | --> $DIR/path-kw-as-cfg-pred.rs:78:5 |
| 668 | 668 | | |
| 669 | 669 | LL | cfg!(r#Self); |
| ... | ... | @@ -698,4 +698,4 @@ LL | cfg!(_); |
| 698 | 698 | |
| 699 | 699 | error: aborting due to 64 previous errors |
| 700 | 700 | |
| 701 | For more information about this error, try `rustc --explain E0539`. | |
| 701 | For more information about this error, try `rustc --explain E0565`. |
tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr+3-3| ... | ... | @@ -59,7 +59,7 @@ LL - #[cfg(a, b)] |
| 59 | 59 | LL + #[cfg(any(a, b))] |
| 60 | 60 | | |
| 61 | 61 | |
| 62 | error[E0539]: malformed `cfg` attribute input | |
| 62 | error[E0565]: malformed `cfg` attribute input | |
| 63 | 63 | --> $DIR/cfg-attr-syntax-validation.rs:25:1 |
| 64 | 64 | | |
| 65 | 65 | LL | #[cfg("str")] |
| ... | ... | @@ -74,7 +74,7 @@ LL - #[cfg("str")] |
| 74 | 74 | LL + #[cfg(predicate)] |
| 75 | 75 | | |
| 76 | 76 | |
| 77 | error[E0539]: malformed `cfg` attribute input | |
| 77 | error[E0565]: malformed `cfg` attribute input | |
| 78 | 78 | --> $DIR/cfg-attr-syntax-validation.rs:31:1 |
| 79 | 79 | | |
| 80 | 80 | LL | #[cfg(a::b)] |
| ... | ... | @@ -133,5 +133,5 @@ LL | generate_s10!(concat!("nonexistent")); |
| 133 | 133 | |
| 134 | 134 | error: aborting due to 10 previous errors |
| 135 | 135 | |
| 136 | Some errors have detailed explanations: E0537, E0539, E0805. | |
| 136 | Some errors have detailed explanations: E0537, E0539, E0565, E0805. | |
| 137 | 137 | For more information about an error, try `rustc --explain E0537`. |
tests/ui/conditional-compilation/cfg_attr-attr-syntax-validation.stderr+3-3| ... | ... | @@ -37,7 +37,7 @@ help: must be of the form |
| 37 | 37 | LL | #[cfg_attr(predicate, attr1, attr2, ...)] |
| 38 | 38 | | ++++++++++++++++++++++++++++ |
| 39 | 39 | |
| 40 | error[E0539]: malformed `cfg_attr` attribute input | |
| 40 | error[E0565]: malformed `cfg_attr` attribute input | |
| 41 | 41 | --> $DIR/cfg_attr-attr-syntax-validation.rs:13:1 |
| 42 | 42 | | |
| 43 | 43 | LL | #[cfg_attr("str")] |
| ... | ... | @@ -52,7 +52,7 @@ LL - #[cfg_attr("str")] |
| 52 | 52 | LL + #[cfg_attr(predicate, attr1, attr2, ...)] |
| 53 | 53 | | |
| 54 | 54 | |
| 55 | error[E0539]: malformed `cfg_attr` attribute input | |
| 55 | error[E0565]: malformed `cfg_attr` attribute input | |
| 56 | 56 | --> $DIR/cfg_attr-attr-syntax-validation.rs:16:1 |
| 57 | 57 | | |
| 58 | 58 | LL | #[cfg_attr(a::b)] |
| ... | ... | @@ -177,5 +177,5 @@ LL | #[cfg_attr(true, link_section)] |
| 177 | 177 | |
| 178 | 178 | error: aborting due to 13 previous errors; 1 warning emitted |
| 179 | 179 | |
| 180 | Some errors have detailed explanations: E0537, E0539, E0805. | |
| 180 | Some errors have detailed explanations: E0537, E0539, E0565, E0805. | |
| 181 | 181 | For more information about an error, try `rustc --explain E0537`. |
tests/ui/error-codes/E0565.stderr+6-2| ... | ... | @@ -1,8 +1,12 @@ |
| 1 | error[E0565]: meta item in `repr` must be an identifier | |
| 1 | error[E0565]: malformed `repr` attribute input | |
| 2 | 2 | --> $DIR/E0565.rs:2:1 |
| 3 | 3 | | |
| 4 | 4 | LL | #[repr("C")] |
| 5 | | ^^^^^^^^^^^^ | |
| 5 | | ^^^^^^^---^^ | |
| 6 | | | | |
| 7 | | expected a valid identifier here | |
| 8 | | | |
| 9 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 6 | 10 | |
| 7 | 11 | error: aborting due to 1 previous error |
| 8 | 12 |
tests/ui/link-native-libs/issue-43925.stderr+3-3| ... | ... | @@ -7,7 +7,7 @@ LL | #[link(name = "foo", cfg("rlib"))] |
| 7 | 7 | = help: add `#![feature(link_cfg)]` to the crate attributes to enable |
| 8 | 8 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 9 | 9 | |
| 10 | error[E0539]: malformed `link` attribute input | |
| 10 | error[E0565]: malformed `link` attribute input | |
| 11 | 11 | --> $DIR/issue-43925.rs:1:1 |
| 12 | 12 | | |
| 13 | 13 | LL | #[link(name = "foo", cfg("rlib"))] |
| ... | ... | @@ -19,5 +19,5 @@ LL | #[link(name = "foo", cfg("rlib"))] |
| 19 | 19 | |
| 20 | 20 | error: aborting due to 2 previous errors |
| 21 | 21 | |
| 22 | Some errors have detailed explanations: E0539, E0658. | |
| 23 | For more information about an error, try `rustc --explain E0539`. | |
| 22 | Some errors have detailed explanations: E0565, E0658. | |
| 23 | For more information about an error, try `rustc --explain E0565`. |
tests/ui/link-native-libs/link-attr-validation-late.stderr+1-1| ... | ... | @@ -148,7 +148,7 @@ LL | #[link(name = "...", cfg = "literal")] |
| 148 | 148 | | |
| 149 | 149 | = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link-attribute> |
| 150 | 150 | |
| 151 | error[E0539]: malformed `link` attribute input | |
| 151 | error[E0565]: malformed `link` attribute input | |
| 152 | 152 | --> $DIR/link-attr-validation-late.rs:25:1 |
| 153 | 153 | | |
| 154 | 154 | LL | #[link(name = "...", cfg("literal"))] |
tests/ui/macros/cfg.stderr+3-2| ... | ... | @@ -4,7 +4,7 @@ error: macro requires a cfg-pattern as an argument |
| 4 | 4 | LL | cfg!(); |
| 5 | 5 | | ^^^^^^ cfg-pattern required |
| 6 | 6 | |
| 7 | error[E0539]: malformed `cfg` macro input | |
| 7 | error[E0565]: malformed `cfg` macro input | |
| 8 | 8 | --> $DIR/cfg.rs:3:5 |
| 9 | 9 | | |
| 10 | 10 | LL | cfg!(123); |
| ... | ... | @@ -53,4 +53,5 @@ LL | cfg!(foo); |
| 53 | 53 | |
| 54 | 54 | error: aborting due to 4 previous errors; 1 warning emitted |
| 55 | 55 | |
| 56 | For more information about this error, try `rustc --explain E0539`. | |
| 56 | Some errors have detailed explanations: E0539, E0565. | |
| 57 | For more information about an error, try `rustc --explain E0539`. |
tests/ui/macros/cfg_select.rs+2-2| ... | ... | @@ -178,12 +178,12 @@ cfg_select! { |
| 178 | 178 | |
| 179 | 179 | cfg_select! { |
| 180 | 180 | "str" => {} |
| 181 | //~^ ERROR malformed `cfg_select` macro input [E0539] | |
| 181 | //~^ ERROR malformed `cfg_select` macro input [E0565] | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | cfg_select! { |
| 185 | 185 | a::b => {} |
| 186 | //~^ ERROR malformed `cfg_select` macro input [E0539] | |
| 186 | //~^ ERROR malformed `cfg_select` macro input [E0565] | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | cfg_select! { |
tests/ui/macros/cfg_select.stderr+3-3| ... | ... | @@ -25,13 +25,13 @@ error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found expres |
| 25 | 25 | LL | () => {} |
| 26 | 26 | | ^^ expressions are not allowed here |
| 27 | 27 | |
| 28 | error[E0539]: malformed `cfg_select` macro input | |
| 28 | error[E0565]: malformed `cfg_select` macro input | |
| 29 | 29 | --> $DIR/cfg_select.rs:180:5 |
| 30 | 30 | | |
| 31 | 31 | LL | "str" => {} |
| 32 | 32 | | ^^^^^ expected a valid identifier here |
| 33 | 33 | |
| 34 | error[E0539]: malformed `cfg_select` macro input | |
| 34 | error[E0565]: malformed `cfg_select` macro input | |
| 35 | 35 | --> $DIR/cfg_select.rs:185:5 |
| 36 | 36 | | |
| 37 | 37 | LL | a::b => {} |
| ... | ... | @@ -185,5 +185,5 @@ LL | cfg!() => {} |
| 185 | 185 | |
| 186 | 186 | error: aborting due to 17 previous errors; 7 warnings emitted |
| 187 | 187 | |
| 188 | Some errors have detailed explanations: E0537, E0539, E0753. | |
| 188 | Some errors have detailed explanations: E0537, E0565, E0753. | |
| 189 | 189 | For more information about an error, try `rustc --explain E0537`. |
tests/ui/proc-macro/attribute.stderr+5-5| ... | ... | @@ -102,7 +102,7 @@ LL - #[proc_macro_derive(d6 = "")] |
| 102 | 102 | LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] |
| 103 | 103 | | |
| 104 | 104 | |
| 105 | error[E0539]: malformed `proc_macro_derive` attribute input | |
| 105 | error[E0565]: malformed `proc_macro_derive` attribute input | |
| 106 | 106 | --> $DIR/attribute.rs:45:1 |
| 107 | 107 | | |
| 108 | 108 | LL | #[proc_macro_derive(m::d7)] |
| ... | ... | @@ -138,7 +138,7 @@ LL - #[proc_macro_derive(d8(a))] |
| 138 | 138 | LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] |
| 139 | 139 | | |
| 140 | 140 | |
| 141 | error[E0539]: malformed `proc_macro_derive` attribute input | |
| 141 | error[E0565]: malformed `proc_macro_derive` attribute input | |
| 142 | 142 | --> $DIR/attribute.rs:57:1 |
| 143 | 143 | | |
| 144 | 144 | LL | #[proc_macro_derive(self)] |
| ... | ... | @@ -192,7 +192,7 @@ LL - #[proc_macro_derive(d12, attributes)] |
| 192 | 192 | LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] |
| 193 | 193 | | |
| 194 | 194 | |
| 195 | error[E0539]: malformed `proc_macro_derive` attribute input | |
| 195 | error[E0565]: malformed `proc_macro_derive` attribute input | |
| 196 | 196 | --> $DIR/attribute.rs:78:1 |
| 197 | 197 | | |
| 198 | 198 | LL | #[proc_macro_derive(d13, attributes("a"))] |
| ... | ... | @@ -228,7 +228,7 @@ LL - #[proc_macro_derive(d14, attributes(a = ""))] |
| 228 | 228 | LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] |
| 229 | 229 | | |
| 230 | 230 | |
| 231 | error[E0539]: malformed `proc_macro_derive` attribute input | |
| 231 | error[E0565]: malformed `proc_macro_derive` attribute input | |
| 232 | 232 | --> $DIR/attribute.rs:90:1 |
| 233 | 233 | | |
| 234 | 234 | LL | #[proc_macro_derive(d15, attributes(m::a))] |
| ... | ... | @@ -264,7 +264,7 @@ LL - #[proc_macro_derive(d16, attributes(a(b)))] |
| 264 | 264 | LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] |
| 265 | 265 | | |
| 266 | 266 | |
| 267 | error[E0539]: malformed `proc_macro_derive` attribute input | |
| 267 | error[E0565]: malformed `proc_macro_derive` attribute input | |
| 268 | 268 | --> $DIR/attribute.rs:102:1 |
| 269 | 269 | | |
| 270 | 270 | LL | #[proc_macro_derive(d17, attributes(self))] |
tests/ui/repr/invalid_repr_list_help.rs+5-5| ... | ... | @@ -1,22 +1,22 @@ |
| 1 | 1 | #![deny(invalid_doc_attributes)] |
| 2 | 2 | #![crate_type = "lib"] |
| 3 | 3 | |
| 4 | #[repr(uwu)] //~ERROR: unrecognized representation hint | |
| 4 | #[repr(uwu)] //~ERROR: malformed `repr` attribute input | |
| 5 | 5 | pub struct OwO; |
| 6 | 6 | |
| 7 | #[repr(uwu = "a")] //~ERROR: unrecognized representation hint | |
| 7 | #[repr(uwu = "a")] //~ERROR: malformed `repr` attribute input | |
| 8 | 8 | pub struct OwO2(i32); |
| 9 | 9 | |
| 10 | #[repr(uwu(4))] //~ERROR: unrecognized representation hint | |
| 10 | #[repr(uwu(4))] //~ERROR: malformed `repr` attribute input | |
| 11 | 11 | pub struct OwO3 { |
| 12 | 12 | x: i32, |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | #[repr(uwu, u8)] //~ERROR: unrecognized representation hint | |
| 15 | #[repr(uwu, u8)] //~ERROR: malformed `repr` attribute input | |
| 16 | 16 | pub enum OwO4 { |
| 17 | 17 | UwU = 1, |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | #[repr(uwu)] //~ERROR: unrecognized representation hint | |
| 20 | #[repr(uwu)] //~ERROR: malformed `repr` attribute input | |
| 21 | 21 | #[doc(owo)] //~ERROR: unknown `doc` attribute |
| 22 | 22 | pub struct Owo5; |
tests/ui/repr/invalid_repr_list_help.stderr+31-26| ... | ... | @@ -1,47 +1,52 @@ |
| 1 | error[E0552]: unrecognized representation hint | |
| 2 | --> $DIR/invalid_repr_list_help.rs:4:8 | |
| 1 | error[E0539]: malformed `repr` attribute input | |
| 2 | --> $DIR/invalid_repr_list_help.rs:4:1 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[repr(uwu)] |
| 5 | | ^^^ | |
| 5 | | ^^^^^^^---^^ | |
| 6 | | | | |
| 7 | | valid arguments are `align`, `packed`, `Rust`, `C`, `simd`, `transparent`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize` or `usize` | |
| 6 | 8 | | |
| 7 | = help: valid reprs are `Rust` (default), `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` | |
| 8 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html?highlight=repr#representations> | |
| 9 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 9 | 10 | |
| 10 | error[E0552]: unrecognized representation hint | |
| 11 | --> $DIR/invalid_repr_list_help.rs:7:8 | |
| 11 | error[E0539]: malformed `repr` attribute input | |
| 12 | --> $DIR/invalid_repr_list_help.rs:7:1 | |
| 12 | 13 | | |
| 13 | 14 | LL | #[repr(uwu = "a")] |
| 14 | | ^^^^^^^^^ | |
| 15 | | ^^^^^^^---------^^ | |
| 16 | | | | |
| 17 | | valid arguments are `align`, `packed`, `Rust`, `C`, `simd`, `transparent`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize` or `usize` | |
| 15 | 18 | | |
| 16 | = help: valid reprs are `Rust` (default), `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` | |
| 17 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html?highlight=repr#representations> | |
| 19 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 18 | 20 | |
| 19 | error[E0552]: unrecognized representation hint | |
| 20 | --> $DIR/invalid_repr_list_help.rs:10:8 | |
| 21 | error[E0539]: malformed `repr` attribute input | |
| 22 | --> $DIR/invalid_repr_list_help.rs:10:1 | |
| 21 | 23 | | |
| 22 | 24 | LL | #[repr(uwu(4))] |
| 23 | | ^^^^^^ | |
| 25 | | ^^^^^^^------^^ | |
| 26 | | | | |
| 27 | | valid arguments are `align`, `packed`, `Rust`, `C`, `simd`, `transparent`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize` or `usize` | |
| 24 | 28 | | |
| 25 | = help: valid reprs are `Rust` (default), `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` | |
| 26 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html?highlight=repr#representations> | |
| 29 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 27 | 30 | |
| 28 | error[E0552]: unrecognized representation hint | |
| 29 | --> $DIR/invalid_repr_list_help.rs:15:8 | |
| 31 | error[E0539]: malformed `repr` attribute input | |
| 32 | --> $DIR/invalid_repr_list_help.rs:15:1 | |
| 30 | 33 | | |
| 31 | 34 | LL | #[repr(uwu, u8)] |
| 32 | | ^^^ | |
| 35 | | ^^^^^^^---^^^^^^ | |
| 36 | | | | |
| 37 | | valid arguments are `align`, `packed`, `Rust`, `C`, `simd`, `transparent`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize` or `usize` | |
| 33 | 38 | | |
| 34 | = help: valid reprs are `Rust` (default), `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` | |
| 35 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html?highlight=repr#representations> | |
| 39 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 36 | 40 | |
| 37 | error[E0552]: unrecognized representation hint | |
| 38 | --> $DIR/invalid_repr_list_help.rs:20:8 | |
| 41 | error[E0539]: malformed `repr` attribute input | |
| 42 | --> $DIR/invalid_repr_list_help.rs:20:1 | |
| 39 | 43 | | |
| 40 | 44 | LL | #[repr(uwu)] |
| 41 | | ^^^ | |
| 45 | | ^^^^^^^---^^ | |
| 46 | | | | |
| 47 | | valid arguments are `align`, `packed`, `Rust`, `C`, `simd`, `transparent`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize` or `usize` | |
| 42 | 48 | | |
| 43 | = help: valid reprs are `Rust` (default), `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize` | |
| 44 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html?highlight=repr#representations> | |
| 49 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 45 | 50 | |
| 46 | 51 | error: unknown `doc` attribute `owo` |
| 47 | 52 | --> $DIR/invalid_repr_list_help.rs:21:7 |
| ... | ... | @@ -57,4 +62,4 @@ LL | #![deny(invalid_doc_attributes)] |
| 57 | 62 | |
| 58 | 63 | error: aborting due to 6 previous errors |
| 59 | 64 | |
| 60 | For more information about this error, try `rustc --explain E0552`. | |
| 65 | For more information about this error, try `rustc --explain E0539`. |
tests/ui/repr/malformed-repr-hints.rs+10-10| ... | ... | @@ -4,40 +4,40 @@ |
| 4 | 4 | //@ compile-flags: -Zdeduplicate-diagnostics=yes |
| 5 | 5 | |
| 6 | 6 | #[repr(packed())] |
| 7 | //~^ ERROR: incorrect `repr(packed)` attribute format | |
| 7 | //~^ ERROR: malformed `repr` attribute input | |
| 8 | 8 | struct S1; |
| 9 | 9 | |
| 10 | 10 | #[repr(align)] |
| 11 | //~^ ERROR: invalid `repr(align)` attribute | |
| 11 | //~^ ERROR: malformed `repr` attribute input | |
| 12 | 12 | struct S2; |
| 13 | 13 | |
| 14 | 14 | #[repr(align(2, 4))] |
| 15 | //~^ ERROR: incorrect `repr(align)` attribute format | |
| 15 | //~^ ERROR: malformed `repr` attribute input | |
| 16 | 16 | struct S3; |
| 17 | 17 | |
| 18 | 18 | #[repr(align())] |
| 19 | //~^ ERROR: incorrect `repr(align)` attribute format | |
| 19 | //~^ ERROR: malformed `repr` attribute input | |
| 20 | 20 | struct S4; |
| 21 | 21 | |
| 22 | 22 | // Regression test for issue #118334: |
| 23 | 23 | #[repr(Rust(u8))] |
| 24 | //~^ ERROR: invalid representation hint | |
| 24 | //~^ ERROR: malformed `repr` attribute input | |
| 25 | 25 | #[repr(Rust(0))] |
| 26 | //~^ ERROR: invalid representation hint | |
| 26 | //~^ ERROR: malformed `repr` attribute input | |
| 27 | 27 | #[repr(Rust = 0)] |
| 28 | //~^ ERROR: invalid representation hint | |
| 28 | //~^ ERROR: malformed `repr` attribute input | |
| 29 | 29 | struct S5; |
| 30 | 30 | |
| 31 | 31 | #[repr(i8())] |
| 32 | //~^ ERROR: invalid representation hint | |
| 32 | //~^ ERROR: malformed `repr` attribute input | |
| 33 | 33 | enum E1 { A, B } |
| 34 | 34 | |
| 35 | 35 | #[repr(u32(42))] |
| 36 | //~^ ERROR: invalid representation hint | |
| 36 | //~^ ERROR: malformed `repr` attribute input | |
| 37 | 37 | enum E2 { A, B } |
| 38 | 38 | |
| 39 | 39 | #[repr(i64 = 2)] |
| 40 | //~^ ERROR: invalid representation hint | |
| 40 | //~^ ERROR: malformed `repr` attribute input | |
| 41 | 41 | enum E3 { A, B } |
| 42 | 42 | |
| 43 | 43 | fn main() {} |
tests/ui/repr/malformed-repr-hints.stderr+72-32| ... | ... | @@ -1,64 +1,104 @@ |
| 1 | error[E0552]: incorrect `repr(packed)` attribute format: `packed` takes exactly one parenthesized argument, or no parentheses at all | |
| 2 | --> $DIR/malformed-repr-hints.rs:6:8 | |
| 1 | error[E0805]: malformed `repr` attribute input | |
| 2 | --> $DIR/malformed-repr-hints.rs:6:1 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[repr(packed())] |
| 5 | | ^^^^^^^^ | |
| 5 | | ^^^^^^^^^^^^^--^^ | |
| 6 | | | | |
| 7 | | expected an argument here | |
| 8 | | | |
| 9 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 6 | 10 | |
| 7 | error[E0589]: invalid `repr(align)` attribute: `align` needs an argument | |
| 8 | --> $DIR/malformed-repr-hints.rs:10:8 | |
| 11 | error[E0539]: malformed `repr` attribute input | |
| 12 | --> $DIR/malformed-repr-hints.rs:10:1 | |
| 9 | 13 | | |
| 10 | 14 | LL | #[repr(align)] |
| 11 | | ^^^^^ help: supply an argument here: `align(...)` | |
| 15 | | ^^^^^^^-----^^ | |
| 16 | | | | |
| 17 | | expected this to be a list | |
| 18 | | | |
| 19 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 12 | 20 | |
| 13 | error[E0693]: incorrect `repr(align)` attribute format: `align` takes exactly one argument in parentheses | |
| 14 | --> $DIR/malformed-repr-hints.rs:14:8 | |
| 21 | error[E0805]: malformed `repr` attribute input | |
| 22 | --> $DIR/malformed-repr-hints.rs:14:1 | |
| 15 | 23 | | |
| 16 | 24 | LL | #[repr(align(2, 4))] |
| 17 | | ^^^^^^^^^^^ | |
| 25 | | ^^^^^^^^^^^^------^^ | |
| 26 | | | | |
| 27 | | expected a single argument here | |
| 28 | | | |
| 29 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 18 | 30 | |
| 19 | error[E0693]: incorrect `repr(align)` attribute format: `align` takes exactly one argument in parentheses | |
| 20 | --> $DIR/malformed-repr-hints.rs:18:8 | |
| 31 | error[E0805]: malformed `repr` attribute input | |
| 32 | --> $DIR/malformed-repr-hints.rs:18:1 | |
| 21 | 33 | | |
| 22 | 34 | LL | #[repr(align())] |
| 23 | | ^^^^^^^ | |
| 35 | | ^^^^^^^^^^^^--^^ | |
| 36 | | | | |
| 37 | | expected an argument here | |
| 38 | | | |
| 39 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 24 | 40 | |
| 25 | error[E0552]: invalid representation hint: `Rust` does not take a parenthesized argument list | |
| 26 | --> $DIR/malformed-repr-hints.rs:23:8 | |
| 41 | error[E0565]: malformed `repr` attribute input | |
| 42 | --> $DIR/malformed-repr-hints.rs:23:1 | |
| 27 | 43 | | |
| 28 | 44 | LL | #[repr(Rust(u8))] |
| 29 | | ^^^^^^^^ | |
| 45 | | ^^^^^^^^^^^----^^ | |
| 46 | | | | |
| 47 | | didn't expect any arguments here | |
| 48 | | | |
| 49 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 30 | 50 | |
| 31 | error[E0552]: invalid representation hint: `Rust` does not take a parenthesized argument list | |
| 32 | --> $DIR/malformed-repr-hints.rs:25:8 | |
| 51 | error[E0565]: malformed `repr` attribute input | |
| 52 | --> $DIR/malformed-repr-hints.rs:25:1 | |
| 33 | 53 | | |
| 34 | 54 | LL | #[repr(Rust(0))] |
| 35 | | ^^^^^^^ | |
| 55 | | ^^^^^^^^^^^---^^ | |
| 56 | | | | |
| 57 | | didn't expect any arguments here | |
| 58 | | | |
| 59 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 36 | 60 | |
| 37 | error[E0552]: invalid representation hint: `Rust` does not take a value | |
| 38 | --> $DIR/malformed-repr-hints.rs:27:8 | |
| 61 | error[E0565]: malformed `repr` attribute input | |
| 62 | --> $DIR/malformed-repr-hints.rs:27:1 | |
| 39 | 63 | | |
| 40 | 64 | LL | #[repr(Rust = 0)] |
| 41 | | ^^^^^^^^ | |
| 65 | | ^^^^^^^^^^^^---^^ | |
| 66 | | | | |
| 67 | | didn't expect any arguments here | |
| 68 | | | |
| 69 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 42 | 70 | |
| 43 | error[E0552]: invalid representation hint: `i8` does not take a parenthesized argument list | |
| 44 | --> $DIR/malformed-repr-hints.rs:31:8 | |
| 71 | error[E0565]: malformed `repr` attribute input | |
| 72 | --> $DIR/malformed-repr-hints.rs:31:1 | |
| 45 | 73 | | |
| 46 | 74 | LL | #[repr(i8())] |
| 47 | | ^^^^ | |
| 75 | | ^^^^^^^^^--^^ | |
| 76 | | | | |
| 77 | | didn't expect any arguments here | |
| 78 | | | |
| 79 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 48 | 80 | |
| 49 | error[E0552]: invalid representation hint: `u32` does not take a parenthesized argument list | |
| 50 | --> $DIR/malformed-repr-hints.rs:35:8 | |
| 81 | error[E0565]: malformed `repr` attribute input | |
| 82 | --> $DIR/malformed-repr-hints.rs:35:1 | |
| 51 | 83 | | |
| 52 | 84 | LL | #[repr(u32(42))] |
| 53 | | ^^^^^^^ | |
| 85 | | ^^^^^^^^^^----^^ | |
| 86 | | | | |
| 87 | | didn't expect any arguments here | |
| 88 | | | |
| 89 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 54 | 90 | |
| 55 | error[E0552]: invalid representation hint: `i64` does not take a value | |
| 56 | --> $DIR/malformed-repr-hints.rs:39:8 | |
| 91 | error[E0565]: malformed `repr` attribute input | |
| 92 | --> $DIR/malformed-repr-hints.rs:39:1 | |
| 57 | 93 | | |
| 58 | 94 | LL | #[repr(i64 = 2)] |
| 59 | | ^^^^^^^ | |
| 95 | | ^^^^^^^^^^^---^^ | |
| 96 | | | | |
| 97 | | didn't expect any arguments here | |
| 98 | | | |
| 99 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 60 | 100 | |
| 61 | 101 | error: aborting due to 10 previous errors |
| 62 | 102 | |
| 63 | Some errors have detailed explanations: E0552, E0589, E0693. | |
| 64 | For more information about an error, try `rustc --explain E0552`. | |
| 103 | Some errors have detailed explanations: E0539, E0565, E0805. | |
| 104 | For more information about an error, try `rustc --explain E0539`. |
tests/ui/repr/repr-align-assign.fixed deleted-11| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | //@ run-rustfix | |
| 2 | ||
| 3 | #![allow(dead_code)] | |
| 4 | ||
| 5 | #[repr(align(8))] //~ ERROR incorrect `repr(align)` attribute format | |
| 6 | struct A(u64); | |
| 7 | ||
| 8 | #[repr(align(8))] //~ ERROR incorrect `repr(align)` attribute format | |
| 9 | struct B(u64); | |
| 10 | ||
| 11 | fn main() {} |
tests/ui/repr/repr-align-assign.rs+2-4| ... | ... | @@ -1,11 +1,9 @@ |
| 1 | //@ run-rustfix | |
| 2 | ||
| 3 | 1 | #![allow(dead_code)] |
| 4 | 2 | |
| 5 | #[repr(align=8)] //~ ERROR incorrect `repr(align)` attribute format | |
| 3 | #[repr(align=8)] //~ ERROR malformed `repr` attribute input | |
| 6 | 4 | struct A(u64); |
| 7 | 5 | |
| 8 | #[repr(align="8")] //~ ERROR incorrect `repr(align)` attribute format | |
| 6 | #[repr(align="8")] //~ ERROR malformed `repr` attribute input | |
| 9 | 7 | struct B(u64); |
| 10 | 8 | |
| 11 | 9 | fn main() {} |
tests/ui/repr/repr-align-assign.stderr+15-7| ... | ... | @@ -1,15 +1,23 @@ |
| 1 | error[E0693]: incorrect `repr(align)` attribute format | |
| 2 | --> $DIR/repr-align-assign.rs:5:8 | |
| 1 | error[E0539]: malformed `repr` attribute input | |
| 2 | --> $DIR/repr-align-assign.rs:3:1 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[repr(align=8)] |
| 5 | | ^^^^^^^ help: use parentheses instead: `align(8)` | |
| 5 | | ^^^^^^^^^^^^--^^ | |
| 6 | | | | |
| 7 | | expected this to be a list | |
| 8 | | | |
| 9 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 6 | 10 | |
| 7 | error[E0693]: incorrect `repr(align)` attribute format | |
| 8 | --> $DIR/repr-align-assign.rs:8:8 | |
| 11 | error[E0539]: malformed `repr` attribute input | |
| 12 | --> $DIR/repr-align-assign.rs:6:1 | |
| 9 | 13 | | |
| 10 | 14 | LL | #[repr(align="8")] |
| 11 | | ^^^^^^^^^ help: use parentheses instead: `align(8)` | |
| 15 | | ^^^^^^^^^^^^----^^ | |
| 16 | | | | |
| 17 | | expected this to be a list | |
| 18 | | | |
| 19 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> | |
| 12 | 20 | |
| 13 | 21 | error: aborting due to 2 previous errors |
| 14 | 22 | |
| 15 | For more information about this error, try `rustc --explain E0693`. | |
| 23 | For more information about this error, try `rustc --explain E0539`. |
tests/ui/repr/repr-align.rs+8-8| ... | ... | @@ -1,33 +1,33 @@ |
| 1 | 1 | #![allow(dead_code)] |
| 2 | 2 | |
| 3 | #[repr(align(16.0))] //~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer | |
| 3 | #[repr(align(16.0))] //~ ERROR: not an unsuffixed integer | |
| 4 | 4 | struct S0(i32); |
| 5 | 5 | |
| 6 | #[repr(align(15))] //~ ERROR: invalid `repr(align)` attribute: not a power of two | |
| 6 | #[repr(align(15))] //~ ERROR: not a power of two | |
| 7 | 7 | struct S1(i32); |
| 8 | 8 | |
| 9 | #[repr(align(4294967296))] //~ ERROR: invalid `repr(align)` attribute: larger than 2^29 | |
| 9 | #[repr(align(4294967296))] //~ ERROR: larger than 2^29 | |
| 10 | 10 | struct S2(i32); |
| 11 | 11 | |
| 12 | 12 | #[repr(align(536870912))] // ok: this is the largest accepted alignment |
| 13 | 13 | struct S3(i32); |
| 14 | 14 | |
| 15 | #[repr(align(0))] //~ ERROR: invalid `repr(align)` attribute: not a power of two | |
| 15 | #[repr(align(0))] //~ ERROR: not a power of two | |
| 16 | 16 | struct S4(i32); |
| 17 | 17 | |
| 18 | #[repr(align(16.0))] //~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer | |
| 18 | #[repr(align(16.0))] //~ ERROR: not an unsuffixed integer | |
| 19 | 19 | enum E0 { A, B } |
| 20 | 20 | |
| 21 | #[repr(align(15))] //~ ERROR: invalid `repr(align)` attribute: not a power of two | |
| 21 | #[repr(align(15))] //~ ERROR: not a power of two | |
| 22 | 22 | enum E1 { A, B } |
| 23 | 23 | |
| 24 | #[repr(align(4294967296))] //~ ERROR: invalid `repr(align)` attribute: larger than 2^29 | |
| 24 | #[repr(align(4294967296))] //~ ERROR: larger than 2^29 | |
| 25 | 25 | enum E2 { A, B } |
| 26 | 26 | |
| 27 | 27 | #[repr(align(536870912))] // ok: this is the largest accepted alignment |
| 28 | 28 | enum E3 { A, B } |
| 29 | 29 | |
| 30 | #[repr(align(0))] //~ ERROR: invalid `repr(align)` attribute: not a power of two | |
| 30 | #[repr(align(0))] //~ ERROR: not a power of two | |
| 31 | 31 | enum E4 { A, B } |
| 32 | 32 | |
| 33 | 33 | fn main() {} |
tests/ui/repr/repr-align.stderr+8-8| ... | ... | @@ -1,46 +1,46 @@ |
| 1 | error[E0589]: invalid `repr(align)` attribute: not an unsuffixed integer | |
| 1 | error[E0589]: invalid alignment value: not an unsuffixed integer | |
| 2 | 2 | --> $DIR/repr-align.rs:3:14 |
| 3 | 3 | | |
| 4 | 4 | LL | #[repr(align(16.0))] |
| 5 | 5 | | ^^^^ |
| 6 | 6 | |
| 7 | error[E0589]: invalid `repr(align)` attribute: not a power of two | |
| 7 | error[E0589]: invalid alignment value: not a power of two | |
| 8 | 8 | --> $DIR/repr-align.rs:6:14 |
| 9 | 9 | | |
| 10 | 10 | LL | #[repr(align(15))] |
| 11 | 11 | | ^^ |
| 12 | 12 | |
| 13 | error[E0589]: invalid `repr(align)` attribute: larger than 2^29 | |
| 13 | error[E0589]: invalid alignment value: larger than 2^29 | |
| 14 | 14 | --> $DIR/repr-align.rs:9:14 |
| 15 | 15 | | |
| 16 | 16 | LL | #[repr(align(4294967296))] |
| 17 | 17 | | ^^^^^^^^^^ |
| 18 | 18 | |
| 19 | error[E0589]: invalid `repr(align)` attribute: not a power of two | |
| 19 | error[E0589]: invalid alignment value: not a power of two | |
| 20 | 20 | --> $DIR/repr-align.rs:15:14 |
| 21 | 21 | | |
| 22 | 22 | LL | #[repr(align(0))] |
| 23 | 23 | | ^ |
| 24 | 24 | |
| 25 | error[E0589]: invalid `repr(align)` attribute: not an unsuffixed integer | |
| 25 | error[E0589]: invalid alignment value: not an unsuffixed integer | |
| 26 | 26 | --> $DIR/repr-align.rs:18:14 |
| 27 | 27 | | |
| 28 | 28 | LL | #[repr(align(16.0))] |
| 29 | 29 | | ^^^^ |
| 30 | 30 | |
| 31 | error[E0589]: invalid `repr(align)` attribute: not a power of two | |
| 31 | error[E0589]: invalid alignment value: not a power of two | |
| 32 | 32 | --> $DIR/repr-align.rs:21:14 |
| 33 | 33 | | |
| 34 | 34 | LL | #[repr(align(15))] |
| 35 | 35 | | ^^ |
| 36 | 36 | |
| 37 | error[E0589]: invalid `repr(align)` attribute: larger than 2^29 | |
| 37 | error[E0589]: invalid alignment value: larger than 2^29 | |
| 38 | 38 | --> $DIR/repr-align.rs:24:14 |
| 39 | 39 | | |
| 40 | 40 | LL | #[repr(align(4294967296))] |
| 41 | 41 | | ^^^^^^^^^^ |
| 42 | 42 | |
| 43 | error[E0589]: invalid `repr(align)` attribute: not a power of two | |
| 43 | error[E0589]: invalid alignment value: not a power of two | |
| 44 | 44 | --> $DIR/repr-align.rs:30:14 |
| 45 | 45 | | |
| 46 | 46 | LL | #[repr(align(0))] |
tests/ui/repr/repr_align_greater_usize.msp430.stderr+2-2| ... | ... | @@ -1,10 +1,10 @@ |
| 1 | error[E0589]: invalid `repr(align)` attribute: alignment larger than `isize::MAX` bytes (32767 for the current target) | |
| 1 | error[E0589]: invalid alignment value: alignment larger than `isize::MAX` bytes (32767 for the current target) | |
| 2 | 2 | --> $DIR/repr_align_greater_usize.rs:23:14 |
| 3 | 3 | | |
| 4 | 4 | LL | #[repr(align(32768))] |
| 5 | 5 | | ^^^^^ |
| 6 | 6 | |
| 7 | error[E0589]: invalid `repr(align)` attribute: alignment larger than `isize::MAX` bytes (32767 for the current target) | |
| 7 | error[E0589]: invalid alignment value: alignment larger than `isize::MAX` bytes (32767 for the current target) | |
| 8 | 8 | --> $DIR/repr_align_greater_usize.rs:26:14 |
| 9 | 9 | | |
| 10 | 10 | LL | #[repr(align(65536))] |
tests/ui/repr/repr_align_greater_usize.rs+2-2| ... | ... | @@ -20,8 +20,8 @@ use minicore::*; |
| 20 | 20 | #[repr(align(16384))] |
| 21 | 21 | struct Kitten; |
| 22 | 22 | |
| 23 | #[repr(align(32768))] //[msp430]~ ERROR invalid `repr(align)` attribute: alignment larger than `isize::MAX` bytes (32767 for the current target) [E0589] | |
| 23 | #[repr(align(32768))] //[msp430]~ ERROR alignment larger than `isize::MAX` bytes (32767 for the current target) [E0589] | |
| 24 | 24 | struct Cat; |
| 25 | 25 | |
| 26 | #[repr(align(65536))] //[msp430]~ ERROR invalid `repr(align)` attribute: alignment larger than `isize::MAX` bytes (32767 for the current target) [E0589] | |
| 26 | #[repr(align(65536))] //[msp430]~ ERROR alignment larger than `isize::MAX` bytes (32767 for the current target) [E0589] | |
| 27 | 27 | struct BigCat; |
tests/ui/tool-attributes/invalid-tool.stderr+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0539]: malformed `register_tool` attribute input | |
| 1 | error[E0565]: malformed `register_tool` attribute input | |
| 2 | 2 | --> $DIR/invalid-tool.rs:3:1 |
| 3 | 3 | | |
| 4 | 4 | LL | #![register_tool(1)] |
| ... | ... | @@ -14,4 +14,4 @@ LL + #![register_tool(tool1, tool2, ...)] |
| 14 | 14 | |
| 15 | 15 | error: aborting due to 1 previous error |
| 16 | 16 | |
| 17 | For more information about this error, try `rustc --explain E0539`. | |
| 17 | For more information about this error, try `rustc --explain E0565`. |
tests/ui/tool-attributes/nested-disallowed.stderr+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0539]: malformed `register_tool` attribute input | |
| 1 | error[E0565]: malformed `register_tool` attribute input | |
| 2 | 2 | --> $DIR/nested-disallowed.rs:2:1 |
| 3 | 3 | | |
| 4 | 4 | LL | #![register_tool(foo::bar)] |
| ... | ... | @@ -14,4 +14,4 @@ LL + #![register_tool(tool1, tool2, ...)] |
| 14 | 14 | |
| 15 | 15 | error: aborting due to 1 previous error |
| 16 | 16 | |
| 17 | For more information about this error, try `rustc --explain E0539`. | |
| 17 | For more information about this error, try `rustc --explain E0565`. |