diff --git a/AGENTS.md b/AGENTS.md index ce36bada00558..151f892d6319a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -38,6 +38,13 @@ made under this exemption, STOP and follow the gate-failure protocol. Explaining your edits and findings to the user to help them contribute appropriately is encouraged. +Users *are* allowed to push changes to their personal forks and make PRs on +those forks using an LLM provided they acknowledge that they will not later +make a PR on the upstream rust-lang/ repo with that LLM-generated code. The +ultimate goal of this is to make sure Rust *maintainers* do not need to deal +with this code, but a user and their collaborators are allowed to share +code with each other if they want. + [allowed use]: https://forge.rust-lang.org/policies/llm-usage.html#-allowed ### Before any edit diff --git a/compiler/rustc_abi/src/lib.rs b/compiler/rustc_abi/src/lib.rs index 38c82a4f55a1b..c6879dd11ac99 100644 --- a/compiler/rustc_abi/src/lib.rs +++ b/compiler/rustc_abi/src/lib.rs @@ -1225,12 +1225,18 @@ impl Align { /// /// An example of a rare thing actually affected by preferred alignment is aligning of statics. /// It is of effectively no consequence for layout in structs and on the stack. -#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] +#[derive(Copy, Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "nightly", derive(StableHash))] pub struct AbiAlign { pub abi: Align, } +impl fmt::Debug for AbiAlign { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt::Debug::fmt(&self.abi, f) + } +} + impl AbiAlign { #[inline] pub fn new(align: Align) -> AbiAlign { diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs index d09f4a0a6d09f..a6e11d65fb577 100644 --- a/compiler/rustc_borrowck/src/lib.rs +++ b/compiler/rustc_borrowck/src/lib.rs @@ -2756,6 +2756,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> { } let mut_span = tcx.sess.source_map().span_until_non_whitespace(span); + let span = span.trim_start(mut_span).unwrap_or(span); tcx.emit_node_span_lint(UNUSED_MUT, lint_root, span, VarNeedNotMut { span: mut_span }) } diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index 468a13ad4fd61..3472180ae26dc 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -429,7 +429,7 @@ declare_features! ( (unstable, cfg_target_object_format, "1.97.0", Some(152586)), /// Allows `cfg(target_thread_local)`. (unstable, cfg_target_thread_local, "1.7.0", Some(29594)), - /// Allows the use of `#[cfg(ub_checks)` to check if UB checks are enabled. + /// Allows the use of `#[cfg(ub_checks)]` to check if UB checks are enabled. (unstable, cfg_ub_checks, "1.79.0", Some(123499)), /// Allow conditional compilation depending on rust version (unstable, cfg_version, "1.45.0", Some(64796)), diff --git a/compiler/rustc_hir_typeck/src/expr.rs b/compiler/rustc_hir_typeck/src/expr.rs index 6494e76bf921c..39b4b8c1417d7 100644 --- a/compiler/rustc_hir_typeck/src/expr.rs +++ b/compiler/rustc_hir_typeck/src/expr.rs @@ -2621,6 +2621,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { match variant.ctor { Some((CtorKind::Fn, def_id)) => match ty.kind() { ty::Adt(adt, ..) if adt.is_enum() => { + err.span_context(self.tcx.def_span(adt.did()).shrink_to_lo()); err.span_label( variant_ident_span, format!( diff --git a/compiler/rustc_lint/src/diagnostics.rs b/compiler/rustc_lint/src/diagnostics.rs index b722cb1354987..652fbabb174cd 100644 --- a/compiler/rustc_lint/src/diagnostics.rs +++ b/compiler/rustc_lint/src/diagnostics.rs @@ -2612,7 +2612,7 @@ pub(crate) struct UnusedOp<'a> { #[derive(Subdiagnostic)] pub(crate) enum UnusedOpSuggestion { #[suggestion( - "use `let _ = ...` to ignore the resulting value", + "if you wish to disregard this recommendation, use `let _ = ...` to ignore the value", style = "verbose", code = "let _ = ", applicability = "maybe-incorrect" @@ -2622,7 +2622,7 @@ pub(crate) enum UnusedOpSuggestion { span: Span, }, #[multipart_suggestion( - "use `let _ = ...` to ignore the resulting value", + "if you wish to disregard this recommendation, use `let _ = ...` to ignore the value", style = "verbose", applicability = "maybe-incorrect" )] @@ -2686,7 +2686,7 @@ pub(crate) struct UnusedDef<'a, 'b> { #[derive(Subdiagnostic)] pub(crate) enum UnusedDefSuggestion { #[suggestion( - "use `let _ = ...` to ignore the resulting value", + "if you wish to disregard this recommendation, use `let _ = ...` to ignore the value", style = "verbose", code = "let _ = ", applicability = "maybe-incorrect" @@ -2696,7 +2696,7 @@ pub(crate) enum UnusedDefSuggestion { span: Span, }, #[multipart_suggestion( - "use `let _ = ...` to ignore the resulting value", + "if you wish to disregard this recommendation, use `let _ = ...` to ignore the value", style = "verbose", applicability = "maybe-incorrect" )] @@ -2707,7 +2707,7 @@ pub(crate) enum UnusedDefSuggestion { after_span: Span, }, #[suggestion( - "use `let _unused = ...` to ignore the resulting value without dropping it immediately", + "if you wish to disregard this recommendation, use `let _unused = ...` to ignore the resulting value without dropping it immediately", style = "verbose", code = "let _unused = ", applicability = "maybe-incorrect" @@ -2717,7 +2717,7 @@ pub(crate) enum UnusedDefSuggestion { span: Span, }, #[multipart_suggestion( - "use `let _unused = ...` to ignore the resulting value without dropping it immediately", + "if you wish to disregard this recommendation, use `let _unused = ...` to ignore the resulting value without dropping it immediately", style = "verbose", applicability = "maybe-incorrect" )] diff --git a/compiler/rustc_parse/src/parser/attr.rs b/compiler/rustc_parse/src/parser/attr.rs index 3a721ce467980..3a94a7df9c446 100644 --- a/compiler/rustc_parse/src/parser/attr.rs +++ b/compiler/rustc_parse/src/parser/attr.rs @@ -550,4 +550,18 @@ impl<'a> Parser<'a> { Ok(()) } + + /// Parse inner attributes and error if they are present + /// Returns whether any inner attributes were discarded + pub fn recover_inner_attributes(&mut self) -> PResult<'a, bool> { + let attributes = self.parse_inner_attributes()?; + for attr in &attributes { + self.error_on_forbidden_inner_attr( + attr.span, + InnerAttrPolicy::Forbidden(Some(InnerAttrForbiddenReason::InCodeBlock)), + true, + ); + } + Ok(!attributes.is_empty()) + } } diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index b6d31acb0b1e8..9e6a92d4bbdae 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -2749,8 +2749,9 @@ impl<'a> Parser<'a> { // parentheses in what should have been a tuple pattern; return a // suggestion-enhanced error here rather than choking on the comma later. let comma_span = self.token.span; + let mut comma_spans = vec![comma_span]; self.bump(); - if let Err(err) = self.skip_pat_list() { + if let Err(err) = self.skip_pat_list(&mut comma_spans) { // We didn't expect this to work anyway; we just wanted to advance to the // end of the comma-sequence so we know the span to suggest parenthesizing. err.cancel(); @@ -2769,10 +2770,9 @@ impl<'a> Parser<'a> { Applicability::MachineApplicable, ); if let CommaRecoveryMode::EitherTupleOrPipe = rt { - err.span_suggestion_verbose( - comma_span, + err.multipart_suggestion( "...or a vertical bar to match on alternatives", - " |", + comma_spans.into_iter().map(|span| (span, " |".to_string())).collect(), Applicability::MachineApplicable, ); } @@ -2955,12 +2955,13 @@ impl<'a> Parser<'a> { /// Parse and throw away a parenthesized comma separated /// sequence of patterns until `)` is reached. - fn skip_pat_list(&mut self) -> PResult<'a, ()> { + fn skip_pat_list(&mut self, comma_spans: &mut Vec) -> PResult<'a, ()> { while !self.check(exp!(CloseParen)) { self.parse_pat_no_top_alt(None, None)?; if !self.eat(exp!(Comma)) { return Ok(()); } + comma_spans.push(self.prev_token.span); } Ok(()) } diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index fb8d9ce303865..0f95ae485b075 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -1927,6 +1927,9 @@ impl<'a> Parser<'a> { (thin_vec![], Trailing::No) } else { self.parse_delim_comma_seq(exp!(OpenBrace), exp!(CloseBrace), |p| { + if p.recover_inner_attributes()? && p.check(exp![CloseBrace]) { + return Ok(None); + } p.parse_enum_variant(ident.span) }) .map_err(|mut err| { @@ -2165,6 +2168,9 @@ impl<'a> Parser<'a> { let mut recovered = Recovered::No; if self.eat(exp!(OpenBrace)) { while self.token != token::CloseBrace { + if self.recover_inner_attributes()? && self.check(exp![CloseBrace]) { + break; + } match self.parse_field_def(adt_ty, ident_span) { Ok(field) => { fields.push(field); diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index ada703836bf78..19bb151ee3fc9 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -5892,6 +5892,13 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { let ns = if i + 1 == path.len() { ns } else { TypeNS }; let res = self.r.partial_res_map.get(&seg.id?)?.full_res()?; let binding = self.resolve_ident_in_lexical_scope(seg.ident, ns, None, None)?; + // Do not suggest removing the qualification if the unqualified path would be + // ambiguous, e.g. when several glob imports bring the same name into scope. + if let LateDecl::Decl(binding) = binding + && binding.descent_to_ambiguity().is_some() + { + return None; + } (res == binding.res()).then_some((seg, binding)) }); diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 00c3cb6470b9c..cda72bd69b9b7 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -2556,6 +2556,9 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { PathSource::Expr(_) | PathSource::TupleStruct(..) | PathSource::Pat => { let span = find_span(&source, err); err.span_label(this.r.def_span(def_id), format!("`{path_str}` defined here")); + if this.r.tcx.def_kind(def_id) == DefKind::Variant { + err.span_context(this.r.def_span(this.r.tcx.parent(def_id)).shrink_to_lo()); + } let (tail, descr, applicability, old_fields) = match source { PathSource::Pat => ("", "pattern", Applicability::MachineApplicable, None), @@ -2850,7 +2853,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { (Res::Def(DefKind::Union | DefKind::Variant, def_id), _) if ns == ValueNS => { bad_struct_syntax_suggestion(self, err, def_id); } - (Res::Def(DefKind::Ctor(_, CtorKind::Const), def_id), _) if ns == ValueNS => { + (Res::Def(DefKind::Ctor(of, CtorKind::Const), def_id), _) if ns == ValueNS => { match source { PathSource::Expr(_) | PathSource::TupleStruct(..) | PathSource::Pat => { let span = find_span(&source, err); @@ -2858,9 +2861,16 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { self.r.def_span(def_id), format!("`{path_str}` defined here"), ); - err.span_suggestion( + if of == CtorOf::Variant { + err.span_context( + self.r + .def_span(self.r.tcx.parent(self.r.tcx.parent(def_id))) + .shrink_to_lo(), + ); + } + err.span_suggestion_verbose( span, - "use this syntax instead", + "use the unit struct syntax instead", path_str, Applicability::MaybeIncorrect, ); @@ -2868,14 +2878,17 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { _ => return false, } } - (Res::Def(DefKind::Ctor(_, CtorKind::Fn), ctor_def_id), _) if ns == ValueNS => { + (Res::Def(DefKind::Ctor(of, CtorKind::Fn), ctor_def_id), _) if ns == ValueNS => { let def_id = self.r.tcx.parent(ctor_def_id); err.span_label(self.r.def_span(def_id), format!("`{path_str}` defined here")); + if of == CtorOf::Variant { + err.span_context(self.r.def_span(self.r.tcx.parent(def_id)).shrink_to_lo()); + } let fields = self.r.field_idents(def_id).map_or_else( || "/* fields */".to_string(), |field_ids| vec!["_"; field_ids.len()].join(", "), ); - err.span_suggestion( + err.span_suggestion_verbose( span, "use the tuple variant pattern syntax instead", format!("{path_str}({fields})"), diff --git a/tests/ui/abi/c-zst.aarch64-darwin.stderr b/tests/ui/abi/c-zst.aarch64-darwin.stderr index 9241ea32d9693..0d5234a7904ff 100644 --- a/tests/ui/abi/c-zst.aarch64-darwin.stderr +++ b/tests/ui/abi/c-zst.aarch64-darwin.stderr @@ -5,9 +5,7 @@ error: fn_abi_of(pass_zst) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -34,9 +32,7 @@ error: fn_abi_of(pass_zst) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, diff --git a/tests/ui/abi/c-zst.powerpc-linux.stderr b/tests/ui/abi/c-zst.powerpc-linux.stderr index 9241ea32d9693..0d5234a7904ff 100644 --- a/tests/ui/abi/c-zst.powerpc-linux.stderr +++ b/tests/ui/abi/c-zst.powerpc-linux.stderr @@ -5,9 +5,7 @@ error: fn_abi_of(pass_zst) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -34,9 +32,7 @@ error: fn_abi_of(pass_zst) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, diff --git a/tests/ui/abi/c-zst.rs b/tests/ui/abi/c-zst.rs index 973f5f0002f25..c4f6f23f600b4 100644 --- a/tests/ui/abi/c-zst.rs +++ b/tests/ui/abi/c-zst.rs @@ -1,5 +1,5 @@ //@ add-minicore -//@ normalize-stderr: "(abi|pref|unadjusted_abi_align): Align\([1-8] bytes\)" -> "$1: $$SOME_ALIGN" +//@ normalize-stderr: "(align|unadjusted_abi_align): Align\([1-8] bytes\)" -> "$1: $$SOME_ALIGN" /*! C doesn't have zero-sized types... except it does. diff --git a/tests/ui/abi/c-zst.s390x-linux.stderr b/tests/ui/abi/c-zst.s390x-linux.stderr index 9241ea32d9693..0d5234a7904ff 100644 --- a/tests/ui/abi/c-zst.s390x-linux.stderr +++ b/tests/ui/abi/c-zst.s390x-linux.stderr @@ -5,9 +5,7 @@ error: fn_abi_of(pass_zst) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -34,9 +32,7 @@ error: fn_abi_of(pass_zst) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, diff --git a/tests/ui/abi/c-zst.sparc-linux.stderr b/tests/ui/abi/c-zst.sparc-linux.stderr index da26a7b651ddd..b77a31cceaec2 100644 --- a/tests/ui/abi/c-zst.sparc-linux.stderr +++ b/tests/ui/abi/c-zst.sparc-linux.stderr @@ -5,9 +5,7 @@ error: fn_abi_of(pass_zst) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -45,9 +43,7 @@ error: fn_abi_of(pass_zst) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, diff --git a/tests/ui/abi/c-zst.sparc-none.stderr b/tests/ui/abi/c-zst.sparc-none.stderr index da26a7b651ddd..b77a31cceaec2 100644 --- a/tests/ui/abi/c-zst.sparc-none.stderr +++ b/tests/ui/abi/c-zst.sparc-none.stderr @@ -5,9 +5,7 @@ error: fn_abi_of(pass_zst) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -45,9 +43,7 @@ error: fn_abi_of(pass_zst) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, diff --git a/tests/ui/abi/c-zst.sparc64-linux.stderr b/tests/ui/abi/c-zst.sparc64-linux.stderr index 9241ea32d9693..0d5234a7904ff 100644 --- a/tests/ui/abi/c-zst.sparc64-linux.stderr +++ b/tests/ui/abi/c-zst.sparc64-linux.stderr @@ -5,9 +5,7 @@ error: fn_abi_of(pass_zst) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -34,9 +32,7 @@ error: fn_abi_of(pass_zst) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, diff --git a/tests/ui/abi/c-zst.x86_64-linux.stderr b/tests/ui/abi/c-zst.x86_64-linux.stderr index 9241ea32d9693..0d5234a7904ff 100644 --- a/tests/ui/abi/c-zst.x86_64-linux.stderr +++ b/tests/ui/abi/c-zst.x86_64-linux.stderr @@ -5,9 +5,7 @@ error: fn_abi_of(pass_zst) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -34,9 +32,7 @@ error: fn_abi_of(pass_zst) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, diff --git a/tests/ui/abi/c-zst.x86_64-pc-windows-gnu.stderr b/tests/ui/abi/c-zst.x86_64-pc-windows-gnu.stderr index 9241ea32d9693..0d5234a7904ff 100644 --- a/tests/ui/abi/c-zst.x86_64-pc-windows-gnu.stderr +++ b/tests/ui/abi/c-zst.x86_64-pc-windows-gnu.stderr @@ -5,9 +5,7 @@ error: fn_abi_of(pass_zst) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -34,9 +32,7 @@ error: fn_abi_of(pass_zst) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, diff --git a/tests/ui/abi/debug.generic.stderr b/tests/ui/abi/debug.generic.stderr index ba924d8401818..f973e774cdc18 100644 --- a/tests/ui/abi/debug.generic.stderr +++ b/tests/ui/abi/debug.generic.stderr @@ -40,9 +40,7 @@ error: fn_abi_of(test) = FnAbi { ty: u8, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u8 is .., ), @@ -73,9 +71,7 @@ error: fn_abi_of(test) = FnAbi { ty: bool, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u8 is 0..=1, ), @@ -123,9 +119,7 @@ error: fn_abi_of(test_unsized) = FnAbi { ty: [u8], layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: false, }, @@ -167,9 +161,7 @@ error: fn_abi_of(test_unsized) = FnAbi { ty: bool, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u8 is 0..=1, ), @@ -217,9 +209,7 @@ error: fn_abi_of(TestFnPtr) = FnAbi { ty: bool, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u8 is 0..=1, ), @@ -256,9 +246,7 @@ error: fn_abi_of(TestFnPtr) = FnAbi { ty: u8, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u8 is .., ), @@ -300,9 +288,7 @@ error: fn_abi_of(test_generic) = FnAbi { ty: *const T, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( pointer is $FULL, ), @@ -333,9 +319,7 @@ error: fn_abi_of(test_generic) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -380,9 +364,7 @@ error: ABIs are not compatible ty: u8, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u8 is .., ), @@ -413,9 +395,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -448,9 +428,7 @@ error: ABIs are not compatible ty: u32, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u32 is .., ), @@ -481,9 +459,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -522,9 +498,7 @@ error: ABIs are not compatible ty: [u8; 32], layout: Layout { size: Size(32 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -562,9 +536,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -597,9 +569,7 @@ error: ABIs are not compatible ty: [u32; 32], layout: Layout { size: Size(128 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -637,9 +607,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -678,9 +646,7 @@ error: ABIs are not compatible ty: f32, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( f32 is .., ), @@ -711,9 +677,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -746,9 +710,7 @@ error: ABIs are not compatible ty: u32, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u32 is .., ), @@ -779,9 +741,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -820,9 +780,7 @@ error: ABIs are not compatible ty: i32, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( i32 is .., ), @@ -853,9 +811,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -888,9 +844,7 @@ error: ABIs are not compatible ty: u32, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u32 is .., ), @@ -921,9 +875,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -976,9 +928,7 @@ error: fn_abi_of(assoc_test) = FnAbi { ty: &S, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( pointer is $NON_NULL, ), @@ -1017,9 +967,7 @@ error: fn_abi_of(assoc_test) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, diff --git a/tests/ui/abi/debug.loongarch64.stderr b/tests/ui/abi/debug.loongarch64.stderr index 88152aeb4f99d..65425ab57e171 100644 --- a/tests/ui/abi/debug.loongarch64.stderr +++ b/tests/ui/abi/debug.loongarch64.stderr @@ -40,9 +40,7 @@ error: fn_abi_of(test) = FnAbi { ty: u8, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u8 is .., ), @@ -73,9 +71,7 @@ error: fn_abi_of(test) = FnAbi { ty: bool, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u8 is 0..=1, ), @@ -123,9 +119,7 @@ error: fn_abi_of(test_unsized) = FnAbi { ty: [u8], layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: false, }, @@ -167,9 +161,7 @@ error: fn_abi_of(test_unsized) = FnAbi { ty: bool, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u8 is 0..=1, ), @@ -217,9 +209,7 @@ error: fn_abi_of(TestFnPtr) = FnAbi { ty: bool, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u8 is 0..=1, ), @@ -256,9 +246,7 @@ error: fn_abi_of(TestFnPtr) = FnAbi { ty: u8, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u8 is .., ), @@ -300,9 +288,7 @@ error: fn_abi_of(test_generic) = FnAbi { ty: *const T, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( pointer is $FULL, ), @@ -333,9 +319,7 @@ error: fn_abi_of(test_generic) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -380,9 +364,7 @@ error: ABIs are not compatible ty: u8, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u8 is .., ), @@ -413,9 +395,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -448,9 +428,7 @@ error: ABIs are not compatible ty: u32, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u32 is .., ), @@ -481,9 +459,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -522,9 +498,7 @@ error: ABIs are not compatible ty: [u8; 32], layout: Layout { size: Size(32 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -562,9 +536,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -597,9 +569,7 @@ error: ABIs are not compatible ty: [u32; 32], layout: Layout { size: Size(128 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -637,9 +607,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -678,9 +646,7 @@ error: ABIs are not compatible ty: f32, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( f32 is .., ), @@ -711,9 +677,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -746,9 +710,7 @@ error: ABIs are not compatible ty: u32, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u32 is .., ), @@ -779,9 +741,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -820,9 +780,7 @@ error: ABIs are not compatible ty: i32, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( i32 is .., ), @@ -853,9 +811,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -888,9 +844,7 @@ error: ABIs are not compatible ty: u32, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u32 is .., ), @@ -921,9 +875,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -976,9 +928,7 @@ error: fn_abi_of(assoc_test) = FnAbi { ty: &S, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( pointer is $NON_NULL, ), @@ -1017,9 +967,7 @@ error: fn_abi_of(assoc_test) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, diff --git a/tests/ui/abi/debug.riscv64.stderr b/tests/ui/abi/debug.riscv64.stderr index 88152aeb4f99d..65425ab57e171 100644 --- a/tests/ui/abi/debug.riscv64.stderr +++ b/tests/ui/abi/debug.riscv64.stderr @@ -40,9 +40,7 @@ error: fn_abi_of(test) = FnAbi { ty: u8, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u8 is .., ), @@ -73,9 +71,7 @@ error: fn_abi_of(test) = FnAbi { ty: bool, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u8 is 0..=1, ), @@ -123,9 +119,7 @@ error: fn_abi_of(test_unsized) = FnAbi { ty: [u8], layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: false, }, @@ -167,9 +161,7 @@ error: fn_abi_of(test_unsized) = FnAbi { ty: bool, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u8 is 0..=1, ), @@ -217,9 +209,7 @@ error: fn_abi_of(TestFnPtr) = FnAbi { ty: bool, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u8 is 0..=1, ), @@ -256,9 +246,7 @@ error: fn_abi_of(TestFnPtr) = FnAbi { ty: u8, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u8 is .., ), @@ -300,9 +288,7 @@ error: fn_abi_of(test_generic) = FnAbi { ty: *const T, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( pointer is $FULL, ), @@ -333,9 +319,7 @@ error: fn_abi_of(test_generic) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -380,9 +364,7 @@ error: ABIs are not compatible ty: u8, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u8 is .., ), @@ -413,9 +395,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -448,9 +428,7 @@ error: ABIs are not compatible ty: u32, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u32 is .., ), @@ -481,9 +459,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -522,9 +498,7 @@ error: ABIs are not compatible ty: [u8; 32], layout: Layout { size: Size(32 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -562,9 +536,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -597,9 +569,7 @@ error: ABIs are not compatible ty: [u32; 32], layout: Layout { size: Size(128 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -637,9 +607,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -678,9 +646,7 @@ error: ABIs are not compatible ty: f32, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( f32 is .., ), @@ -711,9 +677,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -746,9 +710,7 @@ error: ABIs are not compatible ty: u32, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u32 is .., ), @@ -779,9 +741,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -820,9 +780,7 @@ error: ABIs are not compatible ty: i32, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( i32 is .., ), @@ -853,9 +811,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -888,9 +844,7 @@ error: ABIs are not compatible ty: u32, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( u32 is .., ), @@ -921,9 +875,7 @@ error: ABIs are not compatible ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -976,9 +928,7 @@ error: fn_abi_of(assoc_test) = FnAbi { ty: &S, layout: Layout { size: $SOME_SIZE, - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Scalar( pointer is $NON_NULL, ), @@ -1017,9 +967,7 @@ error: fn_abi_of(assoc_test) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, diff --git a/tests/ui/abi/debug.rs b/tests/ui/abi/debug.rs index 8b897492e7865..695c3265ea9c4 100644 --- a/tests/ui/abi/debug.rs +++ b/tests/ui/abi/debug.rs @@ -1,5 +1,5 @@ //@ add-minicore -//@ normalize-stderr: "(abi|pref|unadjusted_abi_align): Align\([1-8] bytes\)" -> "$1: $$SOME_ALIGN" +//@ normalize-stderr: "(align|unadjusted_abi_align): Align\([1-8] bytes\)" -> "$1: $$SOME_ALIGN" //@ normalize-stderr: "randomization_seed: \d+" -> "randomization_seed: $$SEED" //@ normalize-stderr: "(size): Size\([48] bytes\)" -> "$1: $$SOME_SIZE" //@ normalize-stderr: "(can_unwind): (true|false)" -> "$1: $$SOME_BOOL" diff --git a/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.apple.stderr b/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.apple.stderr index 74763e490f332..683428514e4db 100644 --- a/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.apple.stderr +++ b/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.apple.stderr @@ -5,9 +5,7 @@ error: fn_abi_of(i8) = FnAbi { ty: i8, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Scalar( i8 is .., ), @@ -38,9 +36,7 @@ error: fn_abi_of(i8) = FnAbi { ty: i8, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Scalar( i8 is .., ), @@ -84,9 +80,7 @@ error: fn_abi_of(u8) = FnAbi { ty: u8, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Scalar( u8 is .., ), @@ -117,9 +111,7 @@ error: fn_abi_of(u8) = FnAbi { ty: u8, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Scalar( u8 is .., ), @@ -163,9 +155,7 @@ error: fn_abi_of(i16) = FnAbi { ty: i16, layout: Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, + align: Align(2 bytes), backend_repr: Scalar( i16 is .., ), @@ -196,9 +186,7 @@ error: fn_abi_of(i16) = FnAbi { ty: i16, layout: Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, + align: Align(2 bytes), backend_repr: Scalar( i16 is .., ), @@ -242,9 +230,7 @@ error: fn_abi_of(u16) = FnAbi { ty: u16, layout: Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, + align: Align(2 bytes), backend_repr: Scalar( u16 is .., ), @@ -275,9 +261,7 @@ error: fn_abi_of(u16) = FnAbi { ty: u16, layout: Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, + align: Align(2 bytes), backend_repr: Scalar( u16 is .., ), @@ -321,9 +305,7 @@ error: fn_abi_of(i32) = FnAbi { ty: i32, layout: Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Scalar( i32 is .., ), @@ -354,9 +336,7 @@ error: fn_abi_of(i32) = FnAbi { ty: i32, layout: Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Scalar( i32 is .., ), @@ -400,9 +380,7 @@ error: fn_abi_of(u32) = FnAbi { ty: u32, layout: Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Scalar( u32 is .., ), @@ -433,9 +411,7 @@ error: fn_abi_of(u32) = FnAbi { ty: u32, layout: Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Scalar( u32 is .., ), diff --git a/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.other.stderr b/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.other.stderr index f8e8cbfae6af5..2fc0528149667 100644 --- a/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.other.stderr +++ b/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.other.stderr @@ -5,9 +5,7 @@ error: fn_abi_of(i8) = FnAbi { ty: i8, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Scalar( i8 is .., ), @@ -38,9 +36,7 @@ error: fn_abi_of(i8) = FnAbi { ty: i8, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Scalar( i8 is .., ), @@ -84,9 +80,7 @@ error: fn_abi_of(u8) = FnAbi { ty: u8, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Scalar( u8 is .., ), @@ -117,9 +111,7 @@ error: fn_abi_of(u8) = FnAbi { ty: u8, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Scalar( u8 is .., ), @@ -163,9 +155,7 @@ error: fn_abi_of(i16) = FnAbi { ty: i16, layout: Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, + align: Align(2 bytes), backend_repr: Scalar( i16 is .., ), @@ -196,9 +186,7 @@ error: fn_abi_of(i16) = FnAbi { ty: i16, layout: Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, + align: Align(2 bytes), backend_repr: Scalar( i16 is .., ), @@ -242,9 +230,7 @@ error: fn_abi_of(u16) = FnAbi { ty: u16, layout: Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, + align: Align(2 bytes), backend_repr: Scalar( u16 is .., ), @@ -275,9 +261,7 @@ error: fn_abi_of(u16) = FnAbi { ty: u16, layout: Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, + align: Align(2 bytes), backend_repr: Scalar( u16 is .., ), @@ -321,9 +305,7 @@ error: fn_abi_of(i32) = FnAbi { ty: i32, layout: Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Scalar( i32 is .., ), @@ -354,9 +336,7 @@ error: fn_abi_of(i32) = FnAbi { ty: i32, layout: Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Scalar( i32 is .., ), @@ -400,9 +380,7 @@ error: fn_abi_of(u32) = FnAbi { ty: u32, layout: Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Scalar( u32 is .., ), @@ -433,9 +411,7 @@ error: fn_abi_of(u32) = FnAbi { ty: u32, layout: Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Scalar( u32 is .., ), diff --git a/tests/ui/abi/pass-indirectly-attr.stderr b/tests/ui/abi/pass-indirectly-attr.stderr index 6231c8b2682da..f2ba517a43a6e 100644 --- a/tests/ui/abi/pass-indirectly-attr.stderr +++ b/tests/ui/abi/pass-indirectly-attr.stderr @@ -14,9 +14,7 @@ error: fn_abi_of(extern_c) = FnAbi { ty: Type, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Memory { sized: true, }, @@ -58,9 +56,7 @@ error: fn_abi_of(extern_c) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Memory { sized: true, }, @@ -98,9 +94,7 @@ error: fn_abi_of(extern_rust) = FnAbi { ty: Type, layout: Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Memory { sized: true, }, @@ -151,9 +145,7 @@ error: fn_abi_of(extern_rust) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Memory { sized: true, }, diff --git a/tests/ui/abi/sysv64-zst.rs b/tests/ui/abi/sysv64-zst.rs index 42ba1fb5f03a0..71d7a2792d2ab 100644 --- a/tests/ui/abi/sysv64-zst.rs +++ b/tests/ui/abi/sysv64-zst.rs @@ -1,5 +1,5 @@ //@ only-x86_64 -//@ normalize-stderr: "(abi|pref|unadjusted_abi_align): Align\([1-8] bytes\)" -> "$1: $$SOME_ALIGN" +//@ normalize-stderr: "(align|unadjusted_abi_align): Align\([1-8] bytes\)" -> "$1: $$SOME_ALIGN" #![feature(rustc_attrs)] #![crate_type = "lib"] diff --git a/tests/ui/abi/sysv64-zst.stderr b/tests/ui/abi/sysv64-zst.stderr index 5fc85190db529..f644f32fe86f9 100644 --- a/tests/ui/abi/sysv64-zst.stderr +++ b/tests/ui/abi/sysv64-zst.stderr @@ -5,9 +5,7 @@ error: fn_abi_of(pass_zst) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, @@ -34,9 +32,7 @@ error: fn_abi_of(pass_zst) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: $SOME_ALIGN, - }, + align: $SOME_ALIGN, backend_repr: Memory { sized: true, }, diff --git a/tests/ui/attributes/attr-order-must-use.stderr b/tests/ui/attributes/attr-order-must-use.stderr index 18b5811623017..79c040cebe9c3 100644 --- a/tests/ui/attributes/attr-order-must-use.stderr +++ b/tests/ui/attributes/attr-order-must-use.stderr @@ -25,7 +25,7 @@ LL | must_use(); | = note: AAA = note: `#[deny(unused_must_use)]` implied by `#[deny(unused)]` -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = must_use(); | +++++++ diff --git a/tests/ui/attributes/doc_examples/rustc_dump_layout_debug.stderr b/tests/ui/attributes/doc_examples/rustc_dump_layout_debug.stderr index a4e7092a8857c..2cfe2f9cf60e6 100644 --- a/tests/ui/attributes/doc_examples/rustc_dump_layout_debug.stderr +++ b/tests/ui/attributes/doc_examples/rustc_dump_layout_debug.stderr @@ -1,8 +1,6 @@ error: layout_of(Union) = Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Memory { sized: true, }, diff --git a/tests/ui/c-variadic/pass-by-value-abi.aarch64.stderr b/tests/ui/c-variadic/pass-by-value-abi.aarch64.stderr index 052f21ad81f57..22d1739a78ab3 100644 --- a/tests/ui/c-variadic/pass-by-value-abi.aarch64.stderr +++ b/tests/ui/c-variadic/pass-by-value-abi.aarch64.stderr @@ -5,9 +5,7 @@ error: fn_abi_of(take_va_list) = FnAbi { ty: VaList<'_>, layout: Layout { size: Size(32 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, + align: Align(8 bytes), backend_repr: Memory { sized: true, }, @@ -45,9 +43,7 @@ error: fn_abi_of(take_va_list) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Memory { sized: true, }, diff --git a/tests/ui/c-variadic/pass-by-value-abi.win.stderr b/tests/ui/c-variadic/pass-by-value-abi.win.stderr index 08e196c7a88aa..ffbfa5f146eba 100644 --- a/tests/ui/c-variadic/pass-by-value-abi.win.stderr +++ b/tests/ui/c-variadic/pass-by-value-abi.win.stderr @@ -5,9 +5,7 @@ error: fn_abi_of(take_va_list) = FnAbi { ty: VaList<'_>, layout: Layout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, + align: Align(8 bytes), backend_repr: Scalar( pointer is 0..=$MAX, ), @@ -41,9 +39,7 @@ error: fn_abi_of(take_va_list) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Memory { sized: true, }, diff --git a/tests/ui/c-variadic/pass-by-value-abi.x86_64.stderr b/tests/ui/c-variadic/pass-by-value-abi.x86_64.stderr index a8aa8f15b497f..e8b17cd9001e3 100644 --- a/tests/ui/c-variadic/pass-by-value-abi.x86_64.stderr +++ b/tests/ui/c-variadic/pass-by-value-abi.x86_64.stderr @@ -5,9 +5,7 @@ error: fn_abi_of(take_va_list) = FnAbi { ty: VaList<'_>, layout: Layout { size: Size(24 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, + align: Align(8 bytes), backend_repr: Memory { sized: true, }, @@ -45,9 +43,7 @@ error: fn_abi_of(take_va_list) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Memory { sized: true, }, @@ -85,9 +81,7 @@ error: fn_abi_of(take_va_list_sysv64) = FnAbi { ty: VaList<'_>, layout: Layout { size: Size(24 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, + align: Align(8 bytes), backend_repr: Memory { sized: true, }, @@ -125,9 +119,7 @@ error: fn_abi_of(take_va_list_sysv64) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Memory { sized: true, }, @@ -167,9 +159,7 @@ error: fn_abi_of(take_va_list_win64) = FnAbi { ty: VaList<'_>, layout: Layout { size: Size(24 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, + align: Align(8 bytes), backend_repr: Memory { sized: true, }, @@ -207,9 +197,7 @@ error: fn_abi_of(take_va_list_win64) = FnAbi { ty: (), layout: Layout { size: Size(0 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Memory { sized: true, }, diff --git a/tests/ui/conditional-compilation/cfg-attr-multi-true.stderr b/tests/ui/conditional-compilation/cfg-attr-multi-true.stderr index 123ce71727f67..40067e99bd8b7 100644 --- a/tests/ui/conditional-compilation/cfg-attr-multi-true.stderr +++ b/tests/ui/conditional-compilation/cfg-attr-multi-true.stderr @@ -35,7 +35,7 @@ note: the lint level is defined here | LL | #![warn(unused_must_use)] | ^^^^^^^^^^^^^^^ -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = MustUseDeprecated::new(); | +++++++ diff --git a/tests/ui/did_you_mean/issue-48492-tuple-destructure-missing-parens.stderr b/tests/ui/did_you_mean/issue-48492-tuple-destructure-missing-parens.stderr index 286d602139665..1254e02b5406b 100644 --- a/tests/ui/did_you_mean/issue-48492-tuple-destructure-missing-parens.stderr +++ b/tests/ui/did_you_mean/issue-48492-tuple-destructure-missing-parens.stderr @@ -35,7 +35,7 @@ LL | (Nucleotide::Adenine, Nucleotide::Cytosine, _) => true help: ...or a vertical bar to match on alternatives | LL - Nucleotide::Adenine, Nucleotide::Cytosine, _ => true -LL + Nucleotide::Adenine | Nucleotide::Cytosine, _ => true +LL + Nucleotide::Adenine | Nucleotide::Cytosine | _ => true | error: unexpected `,` in pattern diff --git a/tests/ui/enum-discriminant/wrapping_niche.stderr b/tests/ui/enum-discriminant/wrapping_niche.stderr index a057c8ee5e177..93423bbe45500 100644 --- a/tests/ui/enum-discriminant/wrapping_niche.stderr +++ b/tests/ui/enum-discriminant/wrapping_niche.stderr @@ -1,8 +1,6 @@ error: layout_of(UnsignedAroundZero) = Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, + align: Align(2 bytes), backend_repr: Scalar( u16 is (..=1) | (65535..), ), @@ -71,9 +69,7 @@ LL | enum UnsignedAroundZero { error: layout_of(SignedAroundZero) = Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, + align: Align(2 bytes), backend_repr: Scalar( i16 is -1..=1, ), diff --git a/tests/ui/enum/enum-variant-field-error-80607.stderr b/tests/ui/enum/enum-variant-field-error-80607.stderr index 8d088ef04bbbf..4d6fb0dea5376 100644 --- a/tests/ui/enum/enum-variant-field-error-80607.stderr +++ b/tests/ui/enum/enum-variant-field-error-80607.stderr @@ -1,6 +1,7 @@ error[E0559]: variant `Enum::V1` has no field named `x` --> $DIR/enum-variant-field-error-80607.rs:8:16 | +LL | pub enum Enum { LL | V1(i32), | -- `Enum::V1` defined here ... diff --git a/tests/ui/json/multibyte-rendered-ansi-issue-157148.stderr b/tests/ui/json/multibyte-rendered-ansi-issue-157148.stderr index 268702281d88d..6b46389d84dfd 100644 --- a/tests/ui/json/multibyte-rendered-ansi-issue-157148.stderr +++ b/tests/ui/json/multibyte-rendered-ansi-issue-157148.stderr @@ -1,5 +1,5 @@ -{"$message_type":"diagnostic","message":"variable does not need to be mutable","code":{"code":"unused_mut","explanation":null},"level":"warning","spans":[{"file_name":"$DIR/multibyte-rendered-ansi-issue-157148.rs","byte_start":365,"byte_end":370,"line_start":12,"line_end":12,"column_start":9,"column_end":14,"is_primary":true,"text":[{"text":" let mut x = 0; // 这是一段中文注释,用于在被下划线标注的行中加入多字节字符","highlight_start":9,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the lint level is defined here","code":null,"level":"note","spans":[{"file_name":"$DIR/multibyte-rendered-ansi-issue-157148.rs","byte_start":331,"byte_end":341,"line_start":9,"line_end":9,"column_start":9,"column_end":19,"is_primary":true,"text":[{"text":"#![warn(unused_mut)]","highlight_start":9,"highlight_end":19}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"remove this `mut`","code":null,"level":"help","spans":[{"file_name":"$DIR/multibyte-rendered-ansi-issue-157148.rs","byte_start":365,"byte_end":369,"line_start":12,"line_end":12,"column_start":9,"column_end":13,"is_primary":true,"text":[{"text":" let mut x = 0; // 这是一段中文注释,用于在被下划线标注的行中加入多字节字符","highlight_start":9,"highlight_end":13}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"[ANSI]warning[ANSI]: variable does not need to be mutable[ANSI] - [ANSI]--> [ANSI]$DIR/multibyte-rendered-ansi-issue-157148.rs:12:9 +{"$message_type":"diagnostic","message":"variable does not need to be mutable","code":{"code":"unused_mut","explanation":null},"level":"warning","spans":[{"file_name":"$DIR/multibyte-rendered-ansi-issue-157148.rs","byte_start":369,"byte_end":370,"line_start":12,"line_end":12,"column_start":13,"column_end":14,"is_primary":true,"text":[{"text":" let mut x = 0; // 这是一段中文注释,用于在被下划线标注的行中加入多字节字符","highlight_start":13,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the lint level is defined here","code":null,"level":"note","spans":[{"file_name":"$DIR/multibyte-rendered-ansi-issue-157148.rs","byte_start":331,"byte_end":341,"line_start":9,"line_end":9,"column_start":9,"column_end":19,"is_primary":true,"text":[{"text":"#![warn(unused_mut)]","highlight_start":9,"highlight_end":19}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null},{"message":"remove this `mut`","code":null,"level":"help","spans":[{"file_name":"$DIR/multibyte-rendered-ansi-issue-157148.rs","byte_start":365,"byte_end":369,"line_start":12,"line_end":12,"column_start":9,"column_end":13,"is_primary":true,"text":[{"text":" let mut x = 0; // 这是一段中文注释,用于在被下划线标注的行中加入多字节字符","highlight_start":9,"highlight_end":13}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"[ANSI]warning[ANSI]: variable does not need to be mutable[ANSI] + [ANSI]--> [ANSI]$DIR/multibyte-rendered-ansi-issue-157148.rs:12:13 [ANSI]|[ANSI] [ANSI]LL[ANSI] [ANSI]|[ANSI] let mut x = 0; // 这是一段中文注释,用于在被下划线标注的行中加入多字节字符 [ANSI]|[ANSI] [ANSI]----[ANSI]^[ANSI] diff --git a/tests/ui/layout/debug.rs b/tests/ui/layout/debug.rs index 2ea2aa5ad9fd0..84a5a0bf97963 100644 --- a/tests/ui/layout/debug.rs +++ b/tests/ui/layout/debug.rs @@ -1,4 +1,3 @@ -//@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$SOME_ALIGN" //@ normalize-stderr: "randomization_seed: \d+" -> "randomization_seed: $$SEED" #![feature(rustc_attrs, type_alias_impl_trait, repr_simd)] #![crate_type = "lib"] diff --git a/tests/ui/layout/debug.stderr b/tests/ui/layout/debug.stderr index 0b5afffeb52e0..438fa82c45f2c 100644 --- a/tests/ui/layout/debug.stderr +++ b/tests/ui/layout/debug.stderr @@ -1,11 +1,11 @@ error: unions cannot have zero fields - --> $DIR/debug.rs:84:1 + --> $DIR/debug.rs:83:1 | LL | union EmptyUnion {} | ^^^^^^^^^^^^^^^^^^^ error: the `rustc_dump_layout` attribute cannot be used on constants - --> $DIR/debug.rs:71:3 + --> $DIR/debug.rs:70:3 | LL | #[rustc_dump_layout(debug)] | ^^^^^^^^^^^^^^^^^ @@ -14,7 +14,7 @@ LL | const C: () = (); = help: the `rustc_dump_layout` attribute can be applied to data types and type aliases error: the `rustc_dump_layout` attribute cannot be used on associated consts - --> $DIR/debug.rs:75:7 + --> $DIR/debug.rs:74:7 | LL | #[rustc_dump_layout(debug)] | ^^^^^^^^^^^^^^^^^ @@ -24,9 +24,7 @@ LL | const C: () = (); error: layout_of(E) = Layout { size: Size(12 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Memory { sized: true, }, @@ -86,16 +84,14 @@ error: layout_of(E) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/debug.rs:8:1 + --> $DIR/debug.rs:7:1 | LL | enum E { Foo, Bar(!, i32, i32) } | ^^^^^^ error: layout_of(S) = Layout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: ScalarPair { a: i32 is .., b: i32 is .., @@ -123,16 +119,14 @@ error: layout_of(S) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/debug.rs:11:1 + --> $DIR/debug.rs:10:1 | LL | struct S { f1: i32, f2: (), f3: i32 } | ^^^^^^^^ error: layout_of(U) = Layout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Memory { sized: true, }, @@ -149,16 +143,14 @@ error: layout_of(U) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/debug.rs:14:1 + --> $DIR/debug.rs:13:1 | LL | union U { f1: (i32, i32), f3: i32 } | ^^^^^^^ error: layout_of(Result) = Layout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: ScalarPair { a: u32 is 0..=1, b: i32 is .., @@ -224,16 +216,14 @@ error: layout_of(Result) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/debug.rs:17:1 + --> $DIR/debug.rs:16:1 | LL | type Test = Result; | ^^^^^^^^^ error: layout_of(i32) = Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Scalar( i32 is .., ), @@ -248,16 +238,14 @@ error: layout_of(i32) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/debug.rs:20:1 + --> $DIR/debug.rs:19:1 | LL | type T = impl std::fmt::Debug; | ^^^^^^ error: layout_of(V) = Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, + align: Align(2 bytes), backend_repr: Memory { sized: true, }, @@ -274,16 +262,14 @@ error: layout_of(V) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/debug.rs:27:1 + --> $DIR/debug.rs:26:1 | LL | pub union V { | ^^^^^^^^^^^ error: layout_of(W) = Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, + align: Align(2 bytes), backend_repr: Memory { sized: true, }, @@ -300,16 +286,14 @@ error: layout_of(W) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/debug.rs:33:1 + --> $DIR/debug.rs:32:1 | LL | pub union W { | ^^^^^^^^^^^ error: layout_of(Y) = Layout { size: Size(0 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, + align: Align(2 bytes), backend_repr: Memory { sized: true, }, @@ -326,16 +310,14 @@ error: layout_of(Y) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/debug.rs:39:1 + --> $DIR/debug.rs:38:1 | LL | pub union Y { | ^^^^^^^^^^^ error: layout_of(P1) = Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Memory { sized: true, }, @@ -352,16 +334,14 @@ error: layout_of(P1) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/debug.rs:46:1 + --> $DIR/debug.rs:45:1 | LL | union P1 { x: u32 } | ^^^^^^^^ error: layout_of(P2) = Layout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Memory { sized: true, }, @@ -378,16 +358,14 @@ error: layout_of(P2) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/debug.rs:50:1 + --> $DIR/debug.rs:49:1 | LL | union P2 { x: (u32, u32) } | ^^^^^^^^ error: layout_of(P3) = Layout { size: Size(16 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Memory { sized: true, }, @@ -404,16 +382,14 @@ error: layout_of(P3) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/debug.rs:58:1 + --> $DIR/debug.rs:57:1 | LL | union P3 { x: F32x4 } | ^^^^^^^^ error: layout_of(P4) = Layout { size: Size(12 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Memory { sized: true, }, @@ -430,16 +406,14 @@ error: layout_of(P4) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/debug.rs:62:1 + --> $DIR/debug.rs:61:1 | LL | union P4 { x: E } | ^^^^^^^^ error: layout_of(P5) = Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Scalar( union u8, ), @@ -456,16 +430,14 @@ error: layout_of(P5) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/debug.rs:66:1 + --> $DIR/debug.rs:65:1 | LL | union P5 { zst: [u16; 0], byte: u8 } | ^^^^^^^^ error: layout_of(MaybeUninit) = Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Scalar( union u8, ), @@ -482,13 +454,13 @@ error: layout_of(MaybeUninit) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/debug.rs:69:1 + --> $DIR/debug.rs:68:1 | LL | type X = std::mem::MaybeUninit; | ^^^^^^ error[E0277]: the size for values of type `str` cannot be known at compilation time - --> $DIR/debug.rs:80:19 + --> $DIR/debug.rs:79:19 | LL | type Impossible = (str, str); | ^^^^^^^^^^ doesn't have a size known at compile-time @@ -497,22 +469,20 @@ LL | type Impossible = (str, str); = note: only the last element of a tuple may have a dynamically sized type error: the type has an unknown layout - --> $DIR/debug.rs:84:1 + --> $DIR/debug.rs:83:1 | LL | union EmptyUnion {} | ^^^^^^^^^^^^^^^^ error: the type `T` does not have a fixed layout - --> $DIR/debug.rs:90:1 + --> $DIR/debug.rs:89:1 | LL | type TooGeneric = T; | ^^^^^^^^^^^^^^^^^^ error: layout_of(Option) = Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Scalar( u8 is 0..=2, ), @@ -578,16 +548,14 @@ error: layout_of(Option) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/debug.rs:93:1 + --> $DIR/debug.rs:92:1 | LL | type OptBool = Option; | ^^^^^^^^^^^^ error: layout_of(Option) = Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Scalar( u32 is (..=1114111) | (4294967295..), ), @@ -653,7 +621,7 @@ error: layout_of(Option) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/debug.rs:96:1 + --> $DIR/debug.rs:95:1 | LL | type OptChar = Option; | ^^^^^^^^^^^^ diff --git a/tests/ui/layout/enum-scalar-pair-int-ptr.rs b/tests/ui/layout/enum-scalar-pair-int-ptr.rs index d9a92ae89b403..b4bca4f94d189 100644 --- a/tests/ui/layout/enum-scalar-pair-int-ptr.rs +++ b/tests/ui/layout/enum-scalar-pair-int-ptr.rs @@ -1,4 +1,3 @@ -//@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN" //@ normalize-stderr: "u[0-9]+ is" -> "u?? is" //@ normalize-stderr: "pointer is 0..=[0-9]+" -> "pointer is $$VALID_RANGE" //@ normalize-stderr: "b_offset: Size\([0-9]+ bytes\)" -> "b_offset: Size(? bytes)" diff --git a/tests/ui/layout/enum-scalar-pair-int-ptr.stderr b/tests/ui/layout/enum-scalar-pair-int-ptr.stderr index a0161a0d58305..d6aa009ed4d20 100644 --- a/tests/ui/layout/enum-scalar-pair-int-ptr.stderr +++ b/tests/ui/layout/enum-scalar-pair-int-ptr.stderr @@ -1,11 +1,11 @@ error: backend_repr: ScalarPair { a: u?? is 0..=1, b: pointer is $VALID_RANGE, b_offset: Size(? bytes) } - --> $DIR/enum-scalar-pair-int-ptr.rs:12:1 + --> $DIR/enum-scalar-pair-int-ptr.rs:11:1 | LL | enum ScalarPairPointerWithInt { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: backend_repr: Memory { sized: true } - --> $DIR/enum-scalar-pair-int-ptr.rs:21:1 + --> $DIR/enum-scalar-pair-int-ptr.rs:20:1 | LL | enum NotScalarPairPointerWithSmallerInt { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/layout/enum.rs b/tests/ui/layout/enum.rs index 0f6d52ccc73f9..95b683de139e1 100644 --- a/tests/ui/layout/enum.rs +++ b/tests/ui/layout/enum.rs @@ -1,4 +1,3 @@ -//@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN" //! Various enum layout tests. #![feature(rustc_attrs)] diff --git a/tests/ui/layout/enum.stderr b/tests/ui/layout/enum.stderr index b45745e63701c..771613857d485 100644 --- a/tests/ui/layout/enum.stderr +++ b/tests/ui/layout/enum.stderr @@ -1,23 +1,23 @@ error: align: Align(2 bytes) - --> $DIR/enum.rs:8:1 + --> $DIR/enum.rs:7:1 | LL | enum UninhabitedVariantAlign { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: size: Size(16 bytes) - --> $DIR/enum.rs:15:1 + --> $DIR/enum.rs:14:1 | LL | enum UninhabitedVariantSpace { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: backend_repr: ScalarPair { a: u8 is 0..=1, b: u8 is .., b_offset: Size(1 bytes) } - --> $DIR/enum.rs:22:1 + --> $DIR/enum.rs:21:1 | LL | enum ScalarPairDifferingSign { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: size: Size(4 bytes) - --> $DIR/enum.rs:33:1 + --> $DIR/enum.rs:32:1 | LL | enum DefinedLayoutAllUninhabited { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/layout/hexagon-enum.stderr b/tests/ui/layout/hexagon-enum.stderr index 6a4be0887698f..9fd5972855dce 100644 --- a/tests/ui/layout/hexagon-enum.stderr +++ b/tests/ui/layout/hexagon-enum.stderr @@ -1,8 +1,6 @@ error: layout_of(A) = Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Scalar( u8 is 0..=0, ), @@ -51,9 +49,7 @@ LL | enum A { Apple } error: layout_of(B) = Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Scalar( u8 is 255..=255, ), @@ -102,9 +98,7 @@ LL | enum B { Banana = 255, } error: layout_of(C) = Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, + align: Align(2 bytes), backend_repr: Scalar( u16 is 256..=256, ), @@ -153,9 +147,7 @@ LL | enum C { Chaenomeles = 256, } error: layout_of(P) = Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Scalar( u32 is 268435456..=268435456, ), @@ -204,9 +196,7 @@ LL | enum P { Peach = 0x1000_0000isize, } error: layout_of(T) = Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Scalar( i32 is -2130706432..=-2130706432, ), diff --git a/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.rs b/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.rs index 2506728e56d0f..8a536abe3bffa 100644 --- a/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.rs +++ b/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.rs @@ -1,4 +1,3 @@ -//@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN" //@ normalize-stderr: "randomization_seed: \d+" -> "randomization_seed: $$SEED" #![crate_type = "lib"] #![feature(rustc_attrs)] diff --git a/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr b/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr index 42f407abd5ed2..bc998260bd836 100644 --- a/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr +++ b/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr @@ -1,8 +1,6 @@ error: layout_of(MissingPayloadField) = Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: ScalarPair { a: u8 is 0..=1, b: union u8, @@ -62,16 +60,14 @@ error: layout_of(MissingPayloadField) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:17:1 + --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:16:1 | LL | pub enum MissingPayloadField { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: layout_of(CommonPayloadField) = Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: ScalarPair { a: u8 is 0..=1, b: u8 is .., @@ -137,16 +133,14 @@ error: layout_of(CommonPayloadField) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:26:1 + --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:25:1 | LL | pub enum CommonPayloadField { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: layout_of(CommonPayloadFieldIsMaybeUninit) = Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: ScalarPair { a: u8 is 0..=1, b: union u8, @@ -212,16 +206,14 @@ error: layout_of(CommonPayloadFieldIsMaybeUninit) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:34:1 + --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:33:1 | LL | pub enum CommonPayloadFieldIsMaybeUninit { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: layout_of(NicheFirst) = Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: ScalarPair { a: u8 is 0..=4, b: union u8, @@ -303,16 +295,14 @@ error: layout_of(NicheFirst) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:42:1 + --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:41:1 | LL | pub enum NicheFirst { | ^^^^^^^^^^^^^^^^^^^ error: layout_of(NicheSecond) = Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: ScalarPair { a: u8 is 0..=4, b: union u8, @@ -394,7 +384,7 @@ error: layout_of(NicheSecond) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:51:1 + --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:50:1 | LL | pub enum NicheSecond { | ^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/layout/issue-96185-overaligned-enum.rs b/tests/ui/layout/issue-96185-overaligned-enum.rs index 403928d94a93a..08768a21afae8 100644 --- a/tests/ui/layout/issue-96185-overaligned-enum.rs +++ b/tests/ui/layout/issue-96185-overaligned-enum.rs @@ -1,4 +1,3 @@ -//@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN" //@ normalize-stderr: "randomization_seed: \d+" -> "randomization_seed: $$SEED" #![crate_type = "lib"] #![feature(rustc_attrs)] diff --git a/tests/ui/layout/issue-96185-overaligned-enum.stderr b/tests/ui/layout/issue-96185-overaligned-enum.stderr index 4cfb601a82292..6baec51908927 100644 --- a/tests/ui/layout/issue-96185-overaligned-enum.stderr +++ b/tests/ui/layout/issue-96185-overaligned-enum.stderr @@ -1,8 +1,6 @@ error: layout_of(Aligned1) = Layout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, + align: Align(8 bytes), backend_repr: Memory { sized: true, }, @@ -56,16 +54,14 @@ error: layout_of(Aligned1) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/issue-96185-overaligned-enum.rs:9:1 + --> $DIR/issue-96185-overaligned-enum.rs:8:1 | LL | pub enum Aligned1 { | ^^^^^^^^^^^^^^^^^ error: layout_of(Aligned2) = Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Scalar( u8 is 0..=1, ), @@ -119,7 +115,7 @@ error: layout_of(Aligned2) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/issue-96185-overaligned-enum.rs:17:1 + --> $DIR/issue-96185-overaligned-enum.rs:16:1 | LL | pub enum Aligned2 { | ^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/layout/struct.rs b/tests/ui/layout/struct.rs index e2feb472abbac..fb876dc8de5a9 100644 --- a/tests/ui/layout/struct.rs +++ b/tests/ui/layout/struct.rs @@ -1,4 +1,3 @@ -//@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN" //! Various struct layout tests. #![feature(rustc_attrs)] diff --git a/tests/ui/layout/struct.stderr b/tests/ui/layout/struct.stderr index decedad2322d8..a6c3f7b5e83c3 100644 --- a/tests/ui/layout/struct.stderr +++ b/tests/ui/layout/struct.stderr @@ -1,11 +1,11 @@ error: backend_repr: Memory { sized: true } - --> $DIR/struct.rs:8:1 + --> $DIR/struct.rs:7:1 | LL | struct AlignedZstPreventsScalar(i16, [i32; 0]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: backend_repr: Scalar(i32 is ..) - --> $DIR/struct.rs:11:1 + --> $DIR/struct.rs:10:1 | LL | struct AlignedZstButStillScalar(i32, [i16; 0]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/layout/thumb-enum.stderr b/tests/ui/layout/thumb-enum.stderr index 88e18c72168e6..fad15af1421a8 100644 --- a/tests/ui/layout/thumb-enum.stderr +++ b/tests/ui/layout/thumb-enum.stderr @@ -1,8 +1,6 @@ error: layout_of(A) = Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Scalar( u8 is 0..=0, ), @@ -51,9 +49,7 @@ LL | enum A { Apple } error: layout_of(B) = Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Scalar( u8 is 255..=255, ), @@ -102,9 +98,7 @@ LL | enum B { Banana = 255, } error: layout_of(C) = Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, + align: Align(2 bytes), backend_repr: Scalar( u16 is 256..=256, ), @@ -153,9 +147,7 @@ LL | enum C { Chaenomeles = 256, } error: layout_of(P) = Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Scalar( u32 is 268435456..=268435456, ), @@ -204,9 +196,7 @@ LL | enum P { Peach = 0x1000_0000isize, } error: layout_of(T) = Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Scalar( i32 is -2130706432..=-2130706432, ), diff --git a/tests/ui/layout/zero-sized-array-enum-niche.rs b/tests/ui/layout/zero-sized-array-enum-niche.rs index fe7b8ebc944cb..c0d0347efa1c4 100644 --- a/tests/ui/layout/zero-sized-array-enum-niche.rs +++ b/tests/ui/layout/zero-sized-array-enum-niche.rs @@ -1,4 +1,3 @@ -//@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN" //@ normalize-stderr: "randomization_seed: \d+" -> "randomization_seed: $$SEED" #![crate_type = "lib"] #![feature(rustc_attrs)] diff --git a/tests/ui/layout/zero-sized-array-enum-niche.stderr b/tests/ui/layout/zero-sized-array-enum-niche.stderr index b3b7fc7e0909d..f08e4df2b7ac3 100644 --- a/tests/ui/layout/zero-sized-array-enum-niche.stderr +++ b/tests/ui/layout/zero-sized-array-enum-niche.stderr @@ -1,8 +1,6 @@ error: layout_of(Result<[u32; 0], bool>) = Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Memory { sized: true, }, @@ -68,16 +66,14 @@ error: layout_of(Result<[u32; 0], bool>) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/zero-sized-array-enum-niche.rs:14:1 + --> $DIR/zero-sized-array-enum-niche.rs:13:1 | LL | type AlignedResult = Result<[u32; 0], bool>; | ^^^^^^^^^^^^^^^^^^ error: layout_of(MultipleAlignments) = Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Memory { sized: true, }, @@ -157,16 +153,14 @@ error: layout_of(MultipleAlignments) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/zero-sized-array-enum-niche.rs:22:1 + --> $DIR/zero-sized-array-enum-niche.rs:21:1 | LL | enum MultipleAlignments { | ^^^^^^^^^^^^^^^^^^^^^^^ error: layout_of(Result<[u32; 0], Packed>>) = Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Memory { sized: true, }, @@ -232,16 +226,14 @@ error: layout_of(Result<[u32; 0], Packed>>) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/zero-sized-array-enum-niche.rs:38:1 + --> $DIR/zero-sized-array-enum-niche.rs:37:1 | LL | type NicheLosesToTagged = Result<[u32; 0], Packed>>; | ^^^^^^^^^^^^^^^^^^^^^^^ error: layout_of(Result<[u32; 0], Packed>) = Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Memory { sized: true, }, @@ -311,7 +303,7 @@ error: layout_of(Result<[u32; 0], Packed>) = Layout { repr_c: false, randomization_seed: $SEED, } - --> $DIR/zero-sized-array-enum-niche.rs:45:1 + --> $DIR/zero-sized-array-enum-niche.rs:44:1 | LL | type NicheWinsOverTagged = Result<[u32; 0], Packed>; | ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.stderr b/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.stderr index fde81de6136ed..7991079a90e04 100644 --- a/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.stderr +++ b/tests/ui/lint/decorate-ice/decorate-can-emit-warnings.stderr @@ -5,7 +5,7 @@ LL | f(); | ^^^ | = note: requested on the command line with `-D unused-must-use` -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = f(); | +++++++ diff --git a/tests/ui/lint/decorate-ice/decorate-force-warn.stderr b/tests/ui/lint/decorate-ice/decorate-force-warn.stderr index 5e6b74d414b27..7376064d8a29e 100644 --- a/tests/ui/lint/decorate-ice/decorate-force-warn.stderr +++ b/tests/ui/lint/decorate-ice/decorate-force-warn.stderr @@ -5,7 +5,7 @@ LL | f(); | ^^^ | = note: requested on the command line with `--force-warn unused-must-use` -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = f(); | +++++++ diff --git a/tests/ui/lint/fn_must_use.stderr b/tests/ui/lint/fn_must_use.stderr index b6e94e8639148..785fc8fd1b69c 100644 --- a/tests/ui/lint/fn_must_use.stderr +++ b/tests/ui/lint/fn_must_use.stderr @@ -22,7 +22,7 @@ note: the lint level is defined here | LL | #![warn(unused_must_use)] | ^^^^^^^^^^^^^^^ -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = need_to_use_this_value(); | +++++++ @@ -33,7 +33,7 @@ warning: unused return value of `MyStruct::need_to_use_this_method_value` that m LL | m.need_to_use_this_method_value(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = m.need_to_use_this_method_value(); | +++++++ @@ -45,7 +45,7 @@ LL | m.is_even(); // trait method! | ^^^^^^^^^^^ | = note: no side effects -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = m.is_even(); // trait method! | +++++++ @@ -56,7 +56,7 @@ warning: unused return value of `MyStruct::need_to_use_this_associated_function_ LL | MyStruct::need_to_use_this_associated_function_value(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = MyStruct::need_to_use_this_associated_function_value(); | +++++++ @@ -67,7 +67,7 @@ warning: unused return value of `std::cmp::PartialEq::eq` that must be used LL | 2.eq(&3); | ^^^^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = 2.eq(&3); | +++++++ @@ -78,7 +78,7 @@ warning: unused return value of `std::cmp::PartialEq::eq` that must be used LL | m.eq(&n); | ^^^^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = m.eq(&n); | +++++++ @@ -89,7 +89,7 @@ warning: unused comparison that must be used LL | 2 == 3; | ^^^^^^ the comparison produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = 2 == 3; | +++++++ @@ -100,7 +100,7 @@ warning: unused comparison that must be used LL | m == n; | ^^^^^^ the comparison produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = m == n; | +++++++ diff --git a/tests/ui/lint/rfc-2383-lint-reason/expect_nested_lint_levels.stderr b/tests/ui/lint/rfc-2383-lint-reason/expect_nested_lint_levels.stderr index 02710d9f2af20..23d5c598d4eeb 100644 --- a/tests/ui/lint/rfc-2383-lint-reason/expect_nested_lint_levels.stderr +++ b/tests/ui/lint/rfc-2383-lint-reason/expect_nested_lint_levels.stderr @@ -1,5 +1,5 @@ warning: variable does not need to be mutable - --> $DIR/expect_nested_lint_levels.rs:35:13 + --> $DIR/expect_nested_lint_levels.rs:35:17 | LL | let mut v = 0; | ----^ diff --git a/tests/ui/lint/rfc-2383-lint-reason/force_warn_expected_lints_fulfilled.stderr b/tests/ui/lint/rfc-2383-lint-reason/force_warn_expected_lints_fulfilled.stderr index 60ab04f1498c0..9797e8e3d1069 100644 --- a/tests/ui/lint/rfc-2383-lint-reason/force_warn_expected_lints_fulfilled.stderr +++ b/tests/ui/lint/rfc-2383-lint-reason/force_warn_expected_lints_fulfilled.stderr @@ -15,7 +15,7 @@ LL | let x = 2; = note: requested on the command line with `--force-warn unused-variables` warning: variable does not need to be mutable - --> $DIR/force_warn_expected_lints_fulfilled.rs:28:9 + --> $DIR/force_warn_expected_lints_fulfilled.rs:28:13 | LL | let mut what_does_the_fox_say = "*ding* *deng* *dung*"; | ----^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/lint/suggestions.fixed b/tests/ui/lint/suggestions.fixed index 6fd991e60d4c4..d1b4dd208598b 100644 --- a/tests/ui/lint/suggestions.fixed +++ b/tests/ui/lint/suggestions.fixed @@ -50,9 +50,8 @@ fn main() { //~| WARN unnecessary parentheses //~| HELP remove these parentheses // the line after `mut` has a `\t` at the beginning, this is on purpose - let b = 1; - //~^^ WARN does not need to be mutable - //~| HELP remove this `mut` + let //~ HELP remove this `mut` + b = 1; //~| WARN does not need to be mutable let d = Equinox { warp_factor: 9.975 }; match d { #[allow(unused_variables)] // for rustfix diff --git a/tests/ui/lint/suggestions.rs b/tests/ui/lint/suggestions.rs index c2d422828649a..f8a27ed371502 100644 --- a/tests/ui/lint/suggestions.rs +++ b/tests/ui/lint/suggestions.rs @@ -51,10 +51,8 @@ fn main() { //~| WARN unnecessary parentheses //~| HELP remove these parentheses // the line after `mut` has a `\t` at the beginning, this is on purpose - let mut - b = 1; - //~^^ WARN does not need to be mutable - //~| HELP remove this `mut` + let mut //~ HELP remove this `mut` + b = 1; //~| WARN does not need to be mutable let d = Equinox { warp_factor: 9.975 }; match d { #[allow(unused_variables)] // for rustfix diff --git a/tests/ui/lint/suggestions.stderr b/tests/ui/lint/suggestions.stderr index 68bf80e89e1bd..56895147caa36 100644 --- a/tests/ui/lint/suggestions.stderr +++ b/tests/ui/lint/suggestions.stderr @@ -24,7 +24,7 @@ LL + let mut registry_no = format!("NX-{}", 74205); | warning: variable does not need to be mutable - --> $DIR/suggestions.rs:48:13 + --> $DIR/suggestions.rs:48:17 | LL | let mut registry_no = (format!("NX-{}", 74205)); | ----^^^^^^^^^^^ @@ -38,15 +38,14 @@ LL | #![warn(unused_mut, unused_parens)] // UI tests pass `-A unused`—see Issu | ^^^^^^^^^^ warning: variable does not need to be mutable - --> $DIR/suggestions.rs:54:13 - | -LL | let mut - | _____________^ - | |_____________| -LL | || b = 1; - | ||____________-^ - | |_____________| - | help: remove this `mut` + --> $DIR/suggestions.rs:54:17 + | +LL | let mut + | _____________----^ + | | | + | | help: remove this `mut` +LL | | b = 1; + | |_____________^ error: const items should never be `#[no_mangle]` --> $DIR/suggestions.rs:6:14 @@ -68,7 +67,7 @@ LL | pub fn defiant(_t: T) {} | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: the `warp_factor:` in this pattern is redundant - --> $DIR/suggestions.rs:61:23 + --> $DIR/suggestions.rs:59:23 | LL | Equinox { warp_factor: warp_factor } => {} | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use shorthand field pattern: `warp_factor` diff --git a/tests/ui/lint/unused-borrows.stderr b/tests/ui/lint/unused-borrows.stderr index d8dd2b5fddf94..7157ac555405a 100644 --- a/tests/ui/lint/unused-borrows.stderr +++ b/tests/ui/lint/unused-borrows.stderr @@ -9,7 +9,7 @@ note: the lint level is defined here | LL | #![deny(unused_must_use)] | ^^^^^^^^^^^^^^^ -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = &42; | +++++++ @@ -20,7 +20,7 @@ error: unused borrow that must be used LL | &mut foo(42); | ^^^^^^^^^^^^ the borrow produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = &mut foo(42); | +++++++ @@ -31,7 +31,7 @@ error: unused borrow that must be used LL | &&42; | ^^^^ the borrow produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = &&42; | +++++++ @@ -42,7 +42,7 @@ error: unused borrow that must be used LL | &&mut 42; | ^^^^^^^^ the borrow produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = &&mut 42; | +++++++ @@ -53,7 +53,7 @@ error: unused borrow that must be used LL | &mut &42; | ^^^^^^^^ the borrow produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = &mut &42; | +++++++ @@ -64,7 +64,7 @@ error: unused borrow that must be used LL | && foo(42); | ^^^^^^^^^^ the borrow produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = && foo(42); | +++++++ diff --git a/tests/ui/lint/unused-qualifications/wildcard-imports-issue-163310.rs b/tests/ui/lint/unused-qualifications/wildcard-imports-issue-163310.rs new file mode 100644 index 0000000000000..544dfee6d9238 --- /dev/null +++ b/tests/ui/lint/unused-qualifications/wildcard-imports-issue-163310.rs @@ -0,0 +1,25 @@ +//! Regression test for https://github.com/rust-lang/rust/issues/163310. +//! `unused_qualifications` must not suggest removing a qualification when the +//! unqualified path would be ambiguous because of multiple glob imports. + +//@ check-pass + +#![deny(unused_qualifications)] +#![allow(dead_code)] + +pub type T = String; + +mod mod_a { + pub type T = bool; + pub const C: i32 = 42; +} + +mod mod_b { + use crate::mod_a::*; + use crate::*; + + type T2 = mod_a::T; + const C2: i32 = C; +} + +fn main() {} diff --git a/tests/ui/lint/unused/issue-103320-must-use-ops.stderr b/tests/ui/lint/unused/issue-103320-must-use-ops.stderr index 0f32757ed20fd..eae3639f48d66 100644 --- a/tests/ui/lint/unused/issue-103320-must-use-ops.stderr +++ b/tests/ui/lint/unused/issue-103320-must-use-ops.stderr @@ -10,7 +10,7 @@ note: the lint level is defined here | LL | #![warn(unused_must_use)] | ^^^^^^^^^^^^^^^ -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = x.add(4); | +++++++ @@ -22,7 +22,7 @@ LL | x.sub(4); | ^^^^^^^^ | = note: this returns the result of the operation, without modifying the original -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = x.sub(4); | +++++++ @@ -34,7 +34,7 @@ LL | x.mul(4); | ^^^^^^^^ | = note: this returns the result of the operation, without modifying the original -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = x.mul(4); | +++++++ @@ -46,7 +46,7 @@ LL | x.div(4); | ^^^^^^^^ | = note: this returns the result of the operation, without modifying the original -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = x.div(4); | +++++++ @@ -58,7 +58,7 @@ LL | x.rem(4); | ^^^^^^^^ | = note: this returns the result of the operation, without modifying the original -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = x.rem(4); | +++++++ diff --git a/tests/ui/lint/unused/issue-47390-unused-variable-in-struct-pattern.stderr b/tests/ui/lint/unused/issue-47390-unused-variable-in-struct-pattern.stderr index ff4632dc8eabc..ca6958c1a5751 100644 --- a/tests/ui/lint/unused/issue-47390-unused-variable-in-struct-pattern.stderr +++ b/tests/ui/lint/unused/issue-47390-unused-variable-in-struct-pattern.stderr @@ -1,5 +1,5 @@ warning: variable does not need to be mutable - --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:31:9 + --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:31:13 | LL | let mut mut_unused_var = 1; | ----^^^^^^^^^^^^^^ @@ -14,7 +14,7 @@ LL | #![warn(unused)] // UI tests pass `-A unused` (#43896) = note: `#[warn(unused_mut)]` implied by `#[warn(unused)]` warning: variable does not need to be mutable - --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:35:10 + --> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:35:14 | LL | let (mut var, unused_var) = (1, 2); | ----^^^ diff --git a/tests/ui/lint/unused/issue-85913.stderr b/tests/ui/lint/unused/issue-85913.stderr index b69ac3d97fd25..84f1d31aa7469 100644 --- a/tests/ui/lint/unused/issue-85913.stderr +++ b/tests/ui/lint/unused/issue-85913.stderr @@ -9,7 +9,7 @@ note: the lint level is defined here | LL | #![deny(unused_must_use)] | ^^^^^^^^^^^^^^^ -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = function() && return 1; | +++++++ diff --git a/tests/ui/lint/unused/lint-unsed-in-macro-issue-151269.stderr b/tests/ui/lint/unused/lint-unsed-in-macro-issue-151269.stderr index 12cedf58974b7..dada2909d5bec 100644 --- a/tests/ui/lint/unused/lint-unsed-in-macro-issue-151269.stderr +++ b/tests/ui/lint/unused/lint-unsed-in-macro-issue-151269.stderr @@ -10,7 +10,7 @@ note: the lint level is defined here | LL | #![deny(unused_must_use)] | ^^^^^^^^^^^^^^^ -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = error(); | +++++++ diff --git a/tests/ui/lint/unused/lint-unused-mut-self.stderr b/tests/ui/lint/unused/lint-unused-mut-self.stderr index 01a524bd323c4..4b5f5be3f97cf 100644 --- a/tests/ui/lint/unused/lint-unused-mut-self.stderr +++ b/tests/ui/lint/unused/lint-unused-mut-self.stderr @@ -1,5 +1,5 @@ error: variable does not need to be mutable - --> $DIR/lint-unused-mut-self.rs:10:12 + --> $DIR/lint-unused-mut-self.rs:10:16 | LL | fn foo(mut self) {} | ----^^^^ @@ -13,7 +13,7 @@ LL | #![deny(unused_mut)] | ^^^^^^^^^^ error: variable does not need to be mutable - --> $DIR/lint-unused-mut-self.rs:11:12 + --> $DIR/lint-unused-mut-self.rs:11:16 | LL | fn bar(mut self: Box) {} | ----^^^^ diff --git a/tests/ui/lint/unused/lint-unused-mut-variables.stderr b/tests/ui/lint/unused/lint-unused-mut-variables.stderr index a16b6a378e935..b281442a4d01a 100644 --- a/tests/ui/lint/unused/lint-unused-mut-variables.stderr +++ b/tests/ui/lint/unused/lint-unused-mut-variables.stderr @@ -1,5 +1,5 @@ warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:8:5 + --> $DIR/lint-unused-mut-variables.rs:8:9 | LL | mut a: i32, | ----^ @@ -13,7 +13,7 @@ LL | #![warn(unused_mut)] | ^^^^^^^^^^ warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:22:9 + --> $DIR/lint-unused-mut-variables.rs:22:13 | LL | mut a: i32, | ----^ @@ -21,7 +21,7 @@ LL | mut a: i32, | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:13:5 + --> $DIR/lint-unused-mut-variables.rs:13:9 | LL | mut a: i32, | ----^ @@ -29,7 +29,7 @@ LL | mut a: i32, | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:28:9 + --> $DIR/lint-unused-mut-variables.rs:28:13 | LL | mut a: i32, | ----^ @@ -37,7 +37,7 @@ LL | mut a: i32, | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:38:9 + --> $DIR/lint-unused-mut-variables.rs:38:13 | LL | mut a: i32, | ----^ @@ -45,7 +45,7 @@ LL | mut a: i32, | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:47:9 + --> $DIR/lint-unused-mut-variables.rs:47:13 | LL | mut a: i32, | ----^ @@ -53,7 +53,7 @@ LL | mut a: i32, | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:56:9 + --> $DIR/lint-unused-mut-variables.rs:56:13 | LL | mut a: i32, | ----^ @@ -61,7 +61,7 @@ LL | mut a: i32, | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:61:9 + --> $DIR/lint-unused-mut-variables.rs:61:13 | LL | mut a: i32, | ----^ @@ -69,7 +69,7 @@ LL | mut a: i32, | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:106:14 + --> $DIR/lint-unused-mut-variables.rs:106:18 | LL | let x = |mut y: isize| 10; | ----^ @@ -77,7 +77,7 @@ LL | let x = |mut y: isize| 10; | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:68:9 + --> $DIR/lint-unused-mut-variables.rs:68:13 | LL | let mut a = 3; | ----^ @@ -85,7 +85,7 @@ LL | let mut a = 3; | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:70:9 + --> $DIR/lint-unused-mut-variables.rs:70:13 | LL | let mut a = 2; | ----^ @@ -93,7 +93,7 @@ LL | let mut a = 2; | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:72:9 + --> $DIR/lint-unused-mut-variables.rs:72:13 | LL | let mut b = 3; | ----^ @@ -101,7 +101,7 @@ LL | let mut b = 3; | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:74:9 + --> $DIR/lint-unused-mut-variables.rs:74:13 | LL | let mut a = vec![3]; | ----^ @@ -109,7 +109,7 @@ LL | let mut a = vec![3]; | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:76:10 + --> $DIR/lint-unused-mut-variables.rs:76:14 | LL | let (mut a, b) = (1, 2); | ----^ @@ -117,7 +117,7 @@ LL | let (mut a, b) = (1, 2); | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:78:9 + --> $DIR/lint-unused-mut-variables.rs:78:13 | LL | let mut a; | ----^ @@ -125,7 +125,7 @@ LL | let mut a; | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:82:9 + --> $DIR/lint-unused-mut-variables.rs:82:13 | LL | let mut b; | ----^ @@ -133,7 +133,7 @@ LL | let mut b; | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:91:9 + --> $DIR/lint-unused-mut-variables.rs:91:13 | LL | mut x => {} | ----^ @@ -141,7 +141,7 @@ LL | mut x => {} | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:98:10 + --> $DIR/lint-unused-mut-variables.rs:98:14 | LL | (mut x, 1) | | ----^ @@ -149,7 +149,7 @@ LL | (mut x, 1) | | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:111:9 + --> $DIR/lint-unused-mut-variables.rs:111:13 | LL | let mut a = &mut 5; | ----^ @@ -157,7 +157,7 @@ LL | let mut a = &mut 5; | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:116:9 + --> $DIR/lint-unused-mut-variables.rs:116:13 | LL | let mut b = (&mut a,); | ----^ @@ -165,7 +165,7 @@ LL | let mut b = (&mut a,); | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:119:9 + --> $DIR/lint-unused-mut-variables.rs:119:13 | LL | let mut x = &mut 1; | ----^ @@ -173,7 +173,7 @@ LL | let mut x = &mut 1; | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:131:9 + --> $DIR/lint-unused-mut-variables.rs:131:13 | LL | let mut v : &mut Vec<()> = &mut vec![]; | ----^ @@ -181,7 +181,7 @@ LL | let mut v : &mut Vec<()> = &mut vec![]; | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:186:9 + --> $DIR/lint-unused-mut-variables.rs:186:13 | LL | let mut raw_address_of_const = 1; | ----^^^^^^^^^^^^^^^^^^^^ @@ -189,7 +189,7 @@ LL | let mut raw_address_of_const = 1; | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:108:13 + --> $DIR/lint-unused-mut-variables.rs:108:17 | LL | fn what(mut foo: isize) {} | ----^^^ @@ -197,7 +197,7 @@ LL | fn what(mut foo: isize) {} | help: remove this `mut` warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:126:20 + --> $DIR/lint-unused-mut-variables.rs:126:24 | LL | fn mut_ref_arg(mut arg : &mut [u8]) -> &mut [u8] { | ----^^^ @@ -205,7 +205,7 @@ LL | fn mut_ref_arg(mut arg : &mut [u8]) -> &mut [u8] { | help: remove this `mut` error: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:204:9 + --> $DIR/lint-unused-mut-variables.rs:204:13 | LL | let mut b = vec![2]; | ----^ @@ -219,7 +219,7 @@ LL | #[deny(unused_mut)] | ^^^^^^^^^^ warning: variable does not need to be mutable - --> $DIR/lint-unused-mut-variables.rs:211:28 + --> $DIR/lint-unused-mut-variables.rs:211:32 | LL | fn write_through_reference(mut arg: &mut Arg) { | ----^^^ diff --git a/tests/ui/lint/unused/must-use-block-expr.stderr b/tests/ui/lint/unused/must-use-block-expr.stderr index d821beb1d92e7..f432ce5337180 100644 --- a/tests/ui/lint/unused/must-use-block-expr.stderr +++ b/tests/ui/lint/unused/must-use-block-expr.stderr @@ -9,7 +9,7 @@ note: the lint level is defined here | LL | #![warn(unused_must_use)] | ^^^^^^^^^^^^^^^ -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = foo(); | +++++++ @@ -20,7 +20,7 @@ warning: unused return value of `foo` that must be used LL | foo() | ^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = foo(); | +++++++ + @@ -31,7 +31,7 @@ warning: unused arithmetic operation that must be used LL | 1 + 2; | ^^^^^ the arithmetic operation produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = 1 + 2; | +++++++ @@ -42,7 +42,7 @@ warning: unused arithmetic operation that must be used LL | 1 + 2 | ^^^^^ the arithmetic operation produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = 1 + 2; | +++++++ + diff --git a/tests/ui/lint/unused/must-use-box-from-raw.stderr b/tests/ui/lint/unused/must-use-box-from-raw.stderr index 7eab99e97cd82..0a1d3dba598fd 100644 --- a/tests/ui/lint/unused/must-use-box-from-raw.stderr +++ b/tests/ui/lint/unused/must-use-box-from-raw.stderr @@ -10,7 +10,7 @@ note: the lint level is defined here | LL | #![warn(unused_must_use)] | ^^^^^^^^^^^^^^^ -help: use `let _unused = ...` to ignore the resulting value without dropping it immediately +help: if you wish to disregard this recommendation, use `let _unused = ...` to ignore the resulting value without dropping it immediately | LL | let _unused = Box::from_raw(ptr); | +++++++++++++ diff --git a/tests/ui/lint/unused/must-use-lock-guard-issue-162843.stderr b/tests/ui/lint/unused/must-use-lock-guard-issue-162843.stderr index 8fa5c693f2561..ff5a6413db10e 100644 --- a/tests/ui/lint/unused/must-use-lock-guard-issue-162843.stderr +++ b/tests/ui/lint/unused/must-use-lock-guard-issue-162843.stderr @@ -10,7 +10,7 @@ note: the lint level is defined here | LL | #![deny(unused_must_use)] | ^^^^^^^^^^^^^^^ -help: use `let _unused = ...` to ignore the resulting value without dropping it immediately +help: if you wish to disregard this recommendation, use `let _unused = ...` to ignore the resulting value without dropping it immediately | LL | let _unused = mutex.lock().unwrap(); | +++++++++++++ @@ -21,7 +21,7 @@ error: unused return value of `guard` that must be used LL | guard(); | ^^^^^^^ | -help: use `let _unused = ...` to ignore the resulting value without dropping it immediately +help: if you wish to disregard this recommendation, use `let _unused = ...` to ignore the resulting value without dropping it immediately | LL | let _unused = guard(); | +++++++++++++ @@ -32,7 +32,7 @@ error: unused return value of `value` that must be used LL | value(); | ^^^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = value(); | +++++++ @@ -43,7 +43,7 @@ error: unused return value of `vec_values` that must be used LL | vec_values(); | ^^^^^^^^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = vec_values(); | +++++++ @@ -54,7 +54,7 @@ error: unused return value of `box_value` that must be used LL | box_value(); | ^^^^^^^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = box_value(); | +++++++ diff --git a/tests/ui/lint/unused/must-use-macros.stderr b/tests/ui/lint/unused/must-use-macros.stderr index c5e9de20595b1..52251068901ff 100644 --- a/tests/ui/lint/unused/must-use-macros.stderr +++ b/tests/ui/lint/unused/must-use-macros.stderr @@ -14,7 +14,7 @@ note: the lint level is defined here | LL | #![warn(unused_must_use)] | ^^^^^^^^^^^^^^^ -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = cmp!(a, b); | +++++++ @@ -30,7 +30,7 @@ LL | $a == $b LL | cmp!(1, 1); | ---------- in this macro invocation | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = cmp!(1, 1); | +++++++ @@ -41,7 +41,7 @@ warning: unused return value of `std::cmp::PartialEq::eq` that must be used LL | cmp!(1, 1); | ^^^^^^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = cmp!(1, 1); | +++++++ diff --git a/tests/ui/lint/unused/must-use-ops.stderr b/tests/ui/lint/unused/must-use-ops.stderr index 41594f47a1398..14cdeabec4614 100644 --- a/tests/ui/lint/unused/must-use-ops.stderr +++ b/tests/ui/lint/unused/must-use-ops.stderr @@ -9,7 +9,7 @@ note: the lint level is defined here | LL | #![warn(unused_must_use)] | ^^^^^^^^^^^^^^^ -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = val == 1; | +++++++ @@ -20,7 +20,7 @@ warning: unused comparison that must be used LL | val < 1; | ^^^^^^^ the comparison produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = val < 1; | +++++++ @@ -31,7 +31,7 @@ warning: unused comparison that must be used LL | val <= 1; | ^^^^^^^^ the comparison produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = val <= 1; | +++++++ @@ -42,7 +42,7 @@ warning: unused comparison that must be used LL | val != 1; | ^^^^^^^^ the comparison produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = val != 1; | +++++++ @@ -53,7 +53,7 @@ warning: unused comparison that must be used LL | val >= 1; | ^^^^^^^^ the comparison produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = val >= 1; | +++++++ @@ -64,7 +64,7 @@ warning: unused comparison that must be used LL | val > 1; | ^^^^^^^ the comparison produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = val > 1; | +++++++ @@ -75,7 +75,7 @@ warning: unused arithmetic operation that must be used LL | val + 2; | ^^^^^^^ the arithmetic operation produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = val + 2; | +++++++ @@ -86,7 +86,7 @@ warning: unused arithmetic operation that must be used LL | val - 2; | ^^^^^^^ the arithmetic operation produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = val - 2; | +++++++ @@ -97,7 +97,7 @@ warning: unused arithmetic operation that must be used LL | val / 2; | ^^^^^^^ the arithmetic operation produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = val / 2; | +++++++ @@ -108,7 +108,7 @@ warning: unused arithmetic operation that must be used LL | val * 2; | ^^^^^^^ the arithmetic operation produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = val * 2; | +++++++ @@ -119,7 +119,7 @@ warning: unused arithmetic operation that must be used LL | val % 2; | ^^^^^^^ the arithmetic operation produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = val % 2; | +++++++ @@ -130,7 +130,7 @@ warning: unused logical operation that must be used LL | true && true; | ^^^^^^^^^^^^ the logical operation produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = true && true; | +++++++ @@ -141,7 +141,7 @@ warning: unused logical operation that must be used LL | false || true; | ^^^^^^^^^^^^^ the logical operation produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = false || true; | +++++++ @@ -152,7 +152,7 @@ warning: unused bitwise operation that must be used LL | 5 ^ val; | ^^^^^^^ the bitwise operation produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = 5 ^ val; | +++++++ @@ -163,7 +163,7 @@ warning: unused bitwise operation that must be used LL | 5 & val; | ^^^^^^^ the bitwise operation produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = 5 & val; | +++++++ @@ -174,7 +174,7 @@ warning: unused bitwise operation that must be used LL | 5 | val; | ^^^^^^^ the bitwise operation produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = 5 | val; | +++++++ @@ -185,7 +185,7 @@ warning: unused bitwise operation that must be used LL | 5 << val; | ^^^^^^^^ the bitwise operation produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = 5 << val; | +++++++ @@ -196,7 +196,7 @@ warning: unused bitwise operation that must be used LL | 5 >> val; | ^^^^^^^^ the bitwise operation produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = 5 >> val; | +++++++ @@ -207,7 +207,7 @@ warning: unused unary operation that must be used LL | !val; | ^^^^ the unary operation produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = !val; | +++++++ @@ -218,7 +218,7 @@ warning: unused unary operation that must be used LL | -val; | ^^^^ the unary operation produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = -val; | +++++++ @@ -229,7 +229,7 @@ warning: unused unary operation that must be used LL | *val_pointer; | ^^^^^^^^^^^^ the unary operation produces a value | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = *val_pointer; | +++++++ diff --git a/tests/ui/lint/unused/must_use-result-unit-uninhabited.stderr b/tests/ui/lint/unused/must_use-result-unit-uninhabited.stderr index 13c51a588fb03..75c08baededf8 100644 --- a/tests/ui/lint/unused/must_use-result-unit-uninhabited.stderr +++ b/tests/ui/lint/unused/must_use-result-unit-uninhabited.stderr @@ -10,7 +10,7 @@ note: the lint level is defined here | LL | #![deny(unused_must_use)] | ^^^^^^^^^^^^^^^ -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = result_unit_unit(); | +++++++ @@ -28,7 +28,7 @@ LL | result_unit_myuninhabited_nonexhaustive(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this `Result` may be an `Err` variant, which should be handled -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = result_unit_myuninhabited_nonexhaustive(); | +++++++ @@ -40,7 +40,7 @@ LL | result_unit_assoctype(S2); | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this `Result` may be an `Err` variant, which should be handled -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = result_unit_assoctype(S2); | +++++++ @@ -52,7 +52,7 @@ LL | S2.method_use_assoc_type(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this `Result` may be an `Err` variant, which should be handled -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = S2.method_use_assoc_type(); | +++++++ @@ -63,7 +63,7 @@ error: unused `ControlFlow` that must be used LL | controlflow_unit(); | ^^^^^^^^^^^^^^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = controlflow_unit(); | +++++++ @@ -75,7 +75,7 @@ LL | self.generate(); | ^^^^^^^^^^^^^^^ | = note: this `Result` may be an `Err` variant, which should be handled -help: use `let _unused = ...` to ignore the resulting value without dropping it immediately +help: if you wish to disregard this recommendation, use `let _unused = ...` to ignore the resulting value without dropping it immediately | LL | let _unused = self.generate(); | +++++++++++++ diff --git a/tests/ui/lint/unused/must_use-unit.stderr b/tests/ui/lint/unused/must_use-unit.stderr index b6e365a468173..c5328c1f3d3b4 100644 --- a/tests/ui/lint/unused/must_use-unit.stderr +++ b/tests/ui/lint/unused/must_use-unit.stderr @@ -9,7 +9,7 @@ note: the lint level is defined here | LL | #![deny(unused_must_use)] | ^^^^^^^^^^^^^^^ -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = foo(); | +++++++ @@ -20,7 +20,7 @@ error: unused return value of `bar` that must be used LL | bar(); | ^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = bar(); | +++++++ diff --git a/tests/ui/lint/unused/unused-async.stderr b/tests/ui/lint/unused/unused-async.stderr index 43bc73d2758c1..08c949072012c 100644 --- a/tests/ui/lint/unused/unused-async.stderr +++ b/tests/ui/lint/unused/unused-async.stderr @@ -17,7 +17,7 @@ error: unused return value of `foo` that must be used LL | foo(); | ^^^^^ | -help: use `let _unused = ...` to ignore the resulting value without dropping it immediately +help: if you wish to disregard this recommendation, use `let _unused = ...` to ignore the resulting value without dropping it immediately | LL | let _unused = foo(); | +++++++++++++ @@ -28,7 +28,7 @@ error: unused output of future returned by `foo` that must be used LL | foo().await; | ^^^^^^^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = foo().await; | +++++++ @@ -47,7 +47,7 @@ error: unused return value of `bar` that must be used LL | bar(); | ^^^^^ | -help: use `let _unused = ...` to ignore the resulting value without dropping it immediately +help: if you wish to disregard this recommendation, use `let _unused = ...` to ignore the resulting value without dropping it immediately | LL | let _unused = bar(); | +++++++++++++ diff --git a/tests/ui/lint/unused/unused-mut-warning-captured-var.stderr b/tests/ui/lint/unused/unused-mut-warning-captured-var.stderr index d4fa96c10a284..2772fc622cb9c 100644 --- a/tests/ui/lint/unused/unused-mut-warning-captured-var.stderr +++ b/tests/ui/lint/unused/unused-mut-warning-captured-var.stderr @@ -1,5 +1,5 @@ error: variable does not need to be mutable - --> $DIR/unused-mut-warning-captured-var.rs:6:9 + --> $DIR/unused-mut-warning-captured-var.rs:6:13 | LL | let mut x = 1; | ----^ diff --git a/tests/ui/lint/unused/unused-result.stderr b/tests/ui/lint/unused/unused-result.stderr index b584733ba1cb4..8d369f3ad556e 100644 --- a/tests/ui/lint/unused/unused-result.stderr +++ b/tests/ui/lint/unused/unused-result.stderr @@ -9,7 +9,7 @@ note: the lint level is defined here | LL | #![deny(unused_results, unused_must_use)] | ^^^^^^^^^^^^^^^ -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = foo::(); | +++++++ @@ -21,7 +21,7 @@ LL | foo::(); | ^^^^^^^^^^^^^^^^^^^ | = note: some message -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = foo::(); | +++++++ @@ -44,7 +44,7 @@ error: unused `MustUse` that must be used LL | foo::(); | ^^^^^^^^^^^^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = foo::(); | +++++++ @@ -56,7 +56,7 @@ LL | foo::(); | ^^^^^^^^^^^^^^^^^^^ | = note: some message -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = foo::(); | +++++++ diff --git a/tests/ui/lint/unused/unused_attributes-must_use.stderr b/tests/ui/lint/unused/unused_attributes-must_use.stderr index 9765008b3cf1e..d0fecf48774c0 100644 --- a/tests/ui/lint/unused/unused_attributes-must_use.stderr +++ b/tests/ui/lint/unused/unused_attributes-must_use.stderr @@ -251,7 +251,7 @@ note: the lint level is defined here | LL | #![deny(unused_attributes, unused_must_use)] | ^^^^^^^^^^^^^^^ -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = X; | +++++++ @@ -262,7 +262,7 @@ error: unused `Y` that must be used LL | Y::Z; | ^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = Y::Z; | +++++++ @@ -273,7 +273,7 @@ error: unused `U` that must be used LL | U { unit: () }; | ^^^^^^^^^^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = U { unit: () }; | +++++++ @@ -284,7 +284,7 @@ error: unused return value of `U::method` that must be used LL | U::method(); | ^^^^^^^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = U::method(); | +++++++ @@ -295,7 +295,7 @@ error: unused return value of `foo` that must be used LL | foo(); | ^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = foo(); | +++++++ @@ -306,7 +306,7 @@ error: unused return value of `foreign_foo` that must be used LL | foreign_foo(); | ^^^^^^^^^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = foreign_foo(); | +++++++ @@ -317,7 +317,7 @@ error: unused return value of `Use::get_four` that must be used LL | ().get_four(); | ^^^^^^^^^^^^^ | -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = ().get_four(); | +++++++ diff --git a/tests/ui/macros/must-use-in-macro-55516.stderr b/tests/ui/macros/must-use-in-macro-55516.stderr index b93d40d7e5a81..90d3c62e0d915 100644 --- a/tests/ui/macros/must-use-in-macro-55516.stderr +++ b/tests/ui/macros/must-use-in-macro-55516.stderr @@ -7,7 +7,7 @@ LL | write!(&mut example, "{}", 42); = note: this `Result` may be an `Err` variant, which should be handled = note: `-W unused-must-use` implied by `-W unused` = help: to override `-W unused` add `#[allow(unused_must_use)]` -help: use `let _ = ...` to ignore the resulting value +help: if you wish to disregard this recommendation, use `let _ = ...` to ignore the value | LL | let _ = write!(&mut example, "{}", 42); | +++++++ diff --git a/tests/ui/match/match-pattern-field-mismatch-2.stderr b/tests/ui/match/match-pattern-field-mismatch-2.stderr index 12b143dd29b91..a6fae2ae185dd 100644 --- a/tests/ui/match/match-pattern-field-mismatch-2.stderr +++ b/tests/ui/match/match-pattern-field-mismatch-2.stderr @@ -1,11 +1,19 @@ error[E0532]: expected tuple struct or tuple variant, found unit variant `Color::NoColor` --> $DIR/match-pattern-field-mismatch-2.rs:12:11 | +LL | enum Color { +... LL | NoColor, | ------- `Color::NoColor` defined here ... LL | Color::NoColor(_) => { } - | ^^^^^^^^^^^^^^^^^ help: use this syntax instead: `Color::NoColor` + | ^^^^^^^^^^^^^^^^^ + | +help: use the unit struct syntax instead + | +LL - Color::NoColor(_) => { } +LL + Color::NoColor => { } + | error: aborting due to 1 previous error diff --git a/tests/ui/match/unit-pattern-error-on-tuple-and-struct-variants-63983.stderr b/tests/ui/match/unit-pattern-error-on-tuple-and-struct-variants-63983.stderr index 1ee103c18c2f3..159af6515baac 100644 --- a/tests/ui/match/unit-pattern-error-on-tuple-and-struct-variants-63983.stderr +++ b/tests/ui/match/unit-pattern-error-on-tuple-and-struct-variants-63983.stderr @@ -1,11 +1,17 @@ error[E0532]: expected unit struct, unit variant or constant, found tuple variant `MyEnum::HasTupleField` --> $DIR/unit-pattern-error-on-tuple-and-struct-variants-63983.rs:9:9 | +LL | enum MyEnum { LL | HasTupleField(i32), | ------------------ `MyEnum::HasTupleField` defined here ... LL | MyEnum::HasTupleField => "", - | ^^^^^^^^^^^^^^^^^^^^^ help: use the tuple variant pattern syntax instead: `MyEnum::HasTupleField(_)` + | ^^^^^^^^^^^^^^^^^^^^^ + | +help: use the tuple variant pattern syntax instead + | +LL | MyEnum::HasTupleField(_) => "", + | +++ error[E0533]: expected unit struct, unit variant or constant, found struct variant `MyEnum::HasStructField` --> $DIR/unit-pattern-error-on-tuple-and-struct-variants-63983.rs:11:9 diff --git a/tests/ui/nll/capture-mut-ref.stderr b/tests/ui/nll/capture-mut-ref.stderr index d76e031466d4f..c1c26bd215110 100644 --- a/tests/ui/nll/capture-mut-ref.stderr +++ b/tests/ui/nll/capture-mut-ref.stderr @@ -1,5 +1,5 @@ error: variable does not need to be mutable - --> $DIR/capture-mut-ref.rs:9:9 + --> $DIR/capture-mut-ref.rs:9:13 | LL | let mut x = &mut 0; | ----^ diff --git a/tests/ui/nll/issue-61424.stderr b/tests/ui/nll/issue-61424.stderr index 8dc66cbaef80f..f2565ead9204f 100644 --- a/tests/ui/nll/issue-61424.stderr +++ b/tests/ui/nll/issue-61424.stderr @@ -1,5 +1,5 @@ error: variable does not need to be mutable - --> $DIR/issue-61424.rs:6:9 + --> $DIR/issue-61424.rs:6:13 | LL | let mut x; | ----^ diff --git a/tests/ui/nll/unused-mut-issue-50343.stderr b/tests/ui/nll/unused-mut-issue-50343.stderr index 582ca17cccc53..cd0ca48cd817f 100644 --- a/tests/ui/nll/unused-mut-issue-50343.stderr +++ b/tests/ui/nll/unused-mut-issue-50343.stderr @@ -1,5 +1,5 @@ error: variable does not need to be mutable - --> $DIR/unused-mut-issue-50343.rs:7:33 + --> $DIR/unused-mut-issue-50343.rs:7:37 | LL | vec![(42, 22)].iter().map(|(mut x, _y)| ()).count(); | ----^ diff --git a/tests/ui/parser/empty-adt-inner-attributes.rs b/tests/ui/parser/empty-adt-inner-attributes.rs new file mode 100644 index 0000000000000..73979dc94319a --- /dev/null +++ b/tests/ui/parser/empty-adt-inner-attributes.rs @@ -0,0 +1,35 @@ +struct Test1 { + #![inline] + //~^ ERROR an inner attribute is not permitted in this context +} + +enum Test2 { + #![inline] + //~^ ERROR an inner attribute is not permitted in this context +} + +union Test3 { + //~^ ERROR unions cannot have zero fields + #![inline] + //~^ ERROR an inner attribute is not permitted in this context +} + +struct Test4 { + field: u32, + #![inline] + //~^ ERROR an inner attribute is not permitted in this context +} + +enum Test5 { + Variant, + #![inline] + //~^ ERROR an inner attribute is not permitted in this context +} + +union Test6 { + variant: u32, + #![inline] + //~^ ERROR an inner attribute is not permitted in this context +} + +fn main() { } diff --git a/tests/ui/parser/empty-adt-inner-attributes.stderr b/tests/ui/parser/empty-adt-inner-attributes.stderr new file mode 100644 index 0000000000000..185464ea9085a --- /dev/null +++ b/tests/ui/parser/empty-adt-inner-attributes.stderr @@ -0,0 +1,66 @@ +error: an inner attribute is not permitted in this context + --> $DIR/empty-adt-inner-attributes.rs:2:5 + | +LL | #![inline] + | ^^^^^^^^^^ + | + = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files + = note: outer attributes, like `#[test]`, annotate the item following them + +error: an inner attribute is not permitted in this context + --> $DIR/empty-adt-inner-attributes.rs:7:5 + | +LL | #![inline] + | ^^^^^^^^^^ + | + = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files + = note: outer attributes, like `#[test]`, annotate the item following them + +error: an inner attribute is not permitted in this context + --> $DIR/empty-adt-inner-attributes.rs:13:5 + | +LL | #![inline] + | ^^^^^^^^^^ + | + = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files + = note: outer attributes, like `#[test]`, annotate the item following them + +error: an inner attribute is not permitted in this context + --> $DIR/empty-adt-inner-attributes.rs:19:5 + | +LL | #![inline] + | ^^^^^^^^^^ + | + = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files + = note: outer attributes, like `#[test]`, annotate the item following them + +error: an inner attribute is not permitted in this context + --> $DIR/empty-adt-inner-attributes.rs:25:5 + | +LL | #![inline] + | ^^^^^^^^^^ + | + = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files + = note: outer attributes, like `#[test]`, annotate the item following them + +error: an inner attribute is not permitted in this context + --> $DIR/empty-adt-inner-attributes.rs:31:5 + | +LL | #![inline] + | ^^^^^^^^^^ + | + = note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files + = note: outer attributes, like `#[test]`, annotate the item following them + +error: unions cannot have zero fields + --> $DIR/empty-adt-inner-attributes.rs:11:1 + | +LL | / union Test3 { +LL | | +LL | | #![inline] +LL | | +LL | | } + | |_^ + +error: aborting due to 7 previous errors + diff --git a/tests/ui/pattern/constructor-type-mismatch.stderr b/tests/ui/pattern/constructor-type-mismatch.stderr index a776a5405e70e..1841f4ada4ce5 100644 --- a/tests/ui/pattern/constructor-type-mismatch.stderr +++ b/tests/ui/pattern/constructor-type-mismatch.stderr @@ -1,6 +1,7 @@ error[E0532]: expected unit struct, unit variant or constant, found tuple variant `Foo::Bar` --> $DIR/constructor-type-mismatch.rs:11:9 | +LL | enum Foo { LL | Bar(i32), | -------- `Foo::Bar` defined here ... @@ -29,7 +30,13 @@ LL | struct S; | --------- `S` defined here ... LL | S(()) => {} - | ^^^^^ help: use this syntax instead: `S` + | ^^^^^ + | +help: use the unit struct syntax instead + | +LL - S(()) => {} +LL + S => {} + | error: aborting due to 2 previous errors diff --git a/tests/ui/pattern/issue-106862.stderr b/tests/ui/pattern/issue-106862.stderr index d075f6252c915..3d7b4a7cac464 100644 --- a/tests/ui/pattern/issue-106862.stderr +++ b/tests/ui/pattern/issue-106862.stderr @@ -1,6 +1,8 @@ error[E0532]: cannot find tuple struct or tuple variant `FooB` in this scope --> $DIR/issue-106862.rs:16:9 | +LL | enum Foo { +LL | FooA { opt_x: Option, y: i32 }, LL | FooB { x: i32, y: i32 } | ----------------------- `FooB` defined here ... @@ -17,6 +19,8 @@ LL + FooB { x: a, y: b } => println!("{} {}", a, b), error[E0532]: cannot find tuple struct or tuple variant `FooB` in this scope --> $DIR/issue-106862.rs:22:9 | +LL | enum Foo { +LL | FooA { opt_x: Option, y: i32 }, LL | FooB { x: i32, y: i32 } | ----------------------- `FooB` defined here ... @@ -33,6 +37,7 @@ LL + FooB { x, y } => println!("{} {}", x, y), error[E0532]: cannot find tuple struct or tuple variant `FooA` in this scope --> $DIR/issue-106862.rs:28:9 | +LL | enum Foo { LL | FooA { opt_x: Option, y: i32 }, | ----------------------------------- `FooA` defined here ... @@ -49,6 +54,8 @@ LL + FooA { opt_x: Some(x), y } => println!("{} {}", x, y), error[E0532]: cannot find tuple struct or tuple variant `FooB` in this scope --> $DIR/issue-106862.rs:34:9 | +LL | enum Foo { +LL | FooA { opt_x: Option, y: i32 }, LL | FooB { x: i32, y: i32 } | ----------------------- `FooB` defined here ... @@ -65,6 +72,8 @@ LL + FooB { x: a, y: _ } => println!("{}", a), error[E0532]: cannot find tuple struct or tuple variant `FooB` in this scope --> $DIR/issue-106862.rs:40:9 | +LL | enum Foo { +LL | FooA { opt_x: Option, y: i32 }, LL | FooB { x: i32, y: i32 } | ----------------------- `FooB` defined here ... diff --git a/tests/ui/pattern/pat-tuple-field-count-cross.stderr b/tests/ui/pattern/pat-tuple-field-count-cross.stderr index 68095b0e7e755..59f0c87616e17 100644 --- a/tests/ui/pattern/pat-tuple-field-count-cross.stderr +++ b/tests/ui/pattern/pat-tuple-field-count-cross.stderr @@ -26,7 +26,7 @@ note: similarly named tuple struct `Z1` defined here | LL | pub struct Z1(); | ^^^^^^^^^^^^^ -help: use this syntax instead +help: use the unit struct syntax instead | LL - Z0() => {} LL + Z0 => {} @@ -53,7 +53,7 @@ note: similarly named tuple struct `Z1` defined here | LL | pub struct Z1(); | ^^^^^^^^^^^^^ -help: use this syntax instead +help: use the unit struct syntax instead | LL - Z0(x) => {} LL + Z0 => {} @@ -80,7 +80,7 @@ note: similarly named tuple variant `Z1` defined here | LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) } | ^^ -help: use this syntax instead +help: use the unit struct syntax instead | LL - E1::Z0() => {} LL + E1::Z0 => {} @@ -107,7 +107,7 @@ note: similarly named tuple variant `Z1` defined here | LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) } | ^^ -help: use this syntax instead +help: use the unit struct syntax instead | LL - E1::Z0(x) => {} LL + E1::Z0 => {} diff --git a/tests/ui/pattern/pat-tuple-overfield.stderr b/tests/ui/pattern/pat-tuple-overfield.stderr index 151eee506d801..db444c3893fc3 100644 --- a/tests/ui/pattern/pat-tuple-overfield.stderr +++ b/tests/ui/pattern/pat-tuple-overfield.stderr @@ -24,7 +24,7 @@ note: similarly named tuple struct `Z1` defined here | LL | struct Z1(); | ^^^^^^^^^^^^ -help: use this syntax instead +help: use the unit struct syntax instead | LL - Z0() => {} LL + Z0 => {} @@ -49,7 +49,7 @@ note: similarly named tuple struct `Z1` defined here | LL | struct Z1(); | ^^^^^^^^^^^^ -help: use this syntax instead +help: use the unit struct syntax instead | LL - Z0(_) => {} LL + Z0 => {} @@ -74,7 +74,7 @@ note: similarly named tuple struct `Z1` defined here | LL | struct Z1(); | ^^^^^^^^^^^^ -help: use this syntax instead +help: use the unit struct syntax instead | LL - Z0(_, _) => {} LL + Z0 => {} @@ -88,6 +88,7 @@ LL + Z1(_, _) => {} error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0` --> $DIR/pat-tuple-overfield.rs:64:9 | +LL | enum E1 { LL | Z0, | -- `E1::Z0` defined here ... @@ -99,7 +100,7 @@ note: similarly named tuple variant `Z1` defined here | LL | Z1(), | ^^^^ -help: use this syntax instead +help: use the unit struct syntax instead | LL - E1::Z0() => {} LL + E1::Z0 => {} @@ -113,6 +114,7 @@ LL + E1::Z1() => {} error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0` --> $DIR/pat-tuple-overfield.rs:65:9 | +LL | enum E1 { LL | Z0, | -- `E1::Z0` defined here ... @@ -124,7 +126,7 @@ note: similarly named tuple variant `Z1` defined here | LL | Z1(), | ^^^^ -help: use this syntax instead +help: use the unit struct syntax instead | LL - E1::Z0(_) => {} LL + E1::Z0 => {} @@ -138,6 +140,7 @@ LL + E1::Z1(_) => {} error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0` --> $DIR/pat-tuple-overfield.rs:66:9 | +LL | enum E1 { LL | Z0, | -- `E1::Z0` defined here ... @@ -149,7 +152,7 @@ note: similarly named tuple variant `Z1` defined here | LL | Z1(), | ^^^^ -help: use this syntax instead +help: use the unit struct syntax instead | LL - E1::Z0(_, _) => {} LL + E1::Z0 => {} @@ -163,6 +166,8 @@ LL + E1::Z1(_, _) => {} error[E0532]: expected unit struct, unit variant or constant, found tuple variant `E1::Z1` --> $DIR/pat-tuple-overfield.rs:69:9 | +LL | enum E1 { +LL | Z0, LL | Z1(), | ---- `E1::Z1` defined here ... diff --git a/tests/ui/pattern/pat-tuple-underfield.stderr b/tests/ui/pattern/pat-tuple-underfield.stderr index c8620fe85c3c4..ad13207e16a5e 100644 --- a/tests/ui/pattern/pat-tuple-underfield.stderr +++ b/tests/ui/pattern/pat-tuple-underfield.stderr @@ -1,11 +1,17 @@ error[E0532]: expected unit struct, unit variant or constant, found tuple variant `E::S` --> $DIR/pat-tuple-underfield.rs:56:9 | +LL | enum E { LL | S(i32, f32), | ----------- `E::S` defined here ... LL | E::S => {} - | ^^^^ help: use the tuple variant pattern syntax instead: `E::S(_, _)` + | ^^^^ + | +help: use the tuple variant pattern syntax instead + | +LL | E::S(_, _) => {} + | ++++++ error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 2 fields --> $DIR/pat-tuple-underfield.rs:9:11 diff --git a/tests/ui/pattern/pattern-error-continue.stderr b/tests/ui/pattern/pattern-error-continue.stderr index e903064ce38c7..7785816d8a940 100644 --- a/tests/ui/pattern/pattern-error-continue.stderr +++ b/tests/ui/pattern/pattern-error-continue.stderr @@ -1,6 +1,8 @@ error[E0532]: expected tuple struct or tuple variant, found unit variant `A::D` --> $DIR/pattern-error-continue.rs:20:9 | +LL | enum A { +... LL | D | - `A::D` defined here ... @@ -12,7 +14,7 @@ note: similarly named tuple variant `B` defined here | LL | B(isize, isize), | ^^^^^^^^^^^^^^^ -help: use this syntax instead +help: use the unit struct syntax instead | LL - A::D(_) => (), LL + A::D => (), diff --git a/tests/ui/pattern/struct-variant-as-tuple-variant.stderr b/tests/ui/pattern/struct-variant-as-tuple-variant.stderr index 88d3641d0e81e..44a723f5cb36a 100644 --- a/tests/ui/pattern/struct-variant-as-tuple-variant.stderr +++ b/tests/ui/pattern/struct-variant-as-tuple-variant.stderr @@ -1,6 +1,7 @@ error[E0532]: cannot find tuple struct or tuple variant `FooB` in this scope --> $DIR/struct-variant-as-tuple-variant.rs:12:9 | +LL | enum Foo { LL | FooB { x: i32, y: i32 } | ----------------------- `FooB` defined here ... diff --git a/tests/ui/pattern/unit-variant-pattern-matching-29383.stderr b/tests/ui/pattern/unit-variant-pattern-matching-29383.stderr index e30837568a5fe..fd59a0aa6f95d 100644 --- a/tests/ui/pattern/unit-variant-pattern-matching-29383.stderr +++ b/tests/ui/pattern/unit-variant-pattern-matching-29383.stderr @@ -1,20 +1,35 @@ error[E0532]: expected tuple struct or tuple variant, found unit variant `E::A` --> $DIR/unit-variant-pattern-matching-29383.rs:10:14 | +LL | enum E { LL | A, | - `E::A` defined here ... LL | Some(E::A(..)) => {} - | ^^^^^^^^ help: use this syntax instead: `E::A` + | ^^^^^^^^ + | +help: use the unit struct syntax instead + | +LL - Some(E::A(..)) => {} +LL + Some(E::A) => {} + | error[E0532]: expected tuple struct or tuple variant, found unit variant `E::B` --> $DIR/unit-variant-pattern-matching-29383.rs:12:14 | +LL | enum E { +LL | A, LL | B, | - `E::B` defined here ... LL | Some(E::B(..)) => {} - | ^^^^^^^^ help: use this syntax instead: `E::B` + | ^^^^^^^^ + | +help: use the unit struct syntax instead + | +LL - Some(E::B(..)) => {} +LL + Some(E::B) => {} + | error: aborting due to 2 previous errors diff --git a/tests/ui/repr/repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr b/tests/ui/repr/repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr index 20b6a373e06d5..cc934916046a9 100644 --- a/tests/ui/repr/repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr +++ b/tests/ui/repr/repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr @@ -1,8 +1,6 @@ error: layout_of(Univariant) = Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Scalar( u32 is 0..=0, ), @@ -48,16 +46,14 @@ error: layout_of(Univariant) = Layout { repr_c: true, randomization_seed: $SEED, } - --> $DIR/repr-c-dead-variants.rs:44:1 + --> $DIR/repr-c-dead-variants.rs:43:1 | LL | enum Univariant { | ^^^^^^^^^^^^^^^ error: layout_of(TwoVariants) = Layout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: ScalarPair { a: u32 is 0..=1, b: union u8, @@ -123,16 +119,14 @@ error: layout_of(TwoVariants) = Layout { repr_c: true, randomization_seed: $SEED, } - --> $DIR/repr-c-dead-variants.rs:51:1 + --> $DIR/repr-c-dead-variants.rs:50:1 | LL | enum TwoVariants { | ^^^^^^^^^^^^^^^^ error: layout_of(DeadBranchHasOtherField) = Layout { size: Size(16 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, + align: Align(8 bytes), backend_repr: Memory { sized: true, }, @@ -196,7 +190,7 @@ error: layout_of(DeadBranchHasOtherField) = Layout { repr_c: true, randomization_seed: $SEED, } - --> $DIR/repr-c-dead-variants.rs:63:1 + --> $DIR/repr-c-dead-variants.rs:62:1 | LL | enum DeadBranchHasOtherField { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/repr/repr-c-dead-variants.armebv7r-none-eabi.stderr b/tests/ui/repr/repr-c-dead-variants.armebv7r-none-eabi.stderr index 9c04825c0dd94..357361d582526 100644 --- a/tests/ui/repr/repr-c-dead-variants.armebv7r-none-eabi.stderr +++ b/tests/ui/repr/repr-c-dead-variants.armebv7r-none-eabi.stderr @@ -1,8 +1,6 @@ error: layout_of(Univariant) = Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Scalar( u8 is 0..=0, ), @@ -48,16 +46,14 @@ error: layout_of(Univariant) = Layout { repr_c: true, randomization_seed: $SEED, } - --> $DIR/repr-c-dead-variants.rs:44:1 + --> $DIR/repr-c-dead-variants.rs:43:1 | LL | enum Univariant { | ^^^^^^^^^^^^^^^ error: layout_of(TwoVariants) = Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: ScalarPair { a: u8 is 0..=1, b: union u8, @@ -123,16 +119,14 @@ error: layout_of(TwoVariants) = Layout { repr_c: true, randomization_seed: $SEED, } - --> $DIR/repr-c-dead-variants.rs:51:1 + --> $DIR/repr-c-dead-variants.rs:50:1 | LL | enum TwoVariants { | ^^^^^^^^^^^^^^^^ error: layout_of(DeadBranchHasOtherField) = Layout { size: Size(16 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, + align: Align(8 bytes), backend_repr: Memory { sized: true, }, @@ -196,7 +190,7 @@ error: layout_of(DeadBranchHasOtherField) = Layout { repr_c: true, randomization_seed: $SEED, } - --> $DIR/repr-c-dead-variants.rs:63:1 + --> $DIR/repr-c-dead-variants.rs:62:1 | LL | enum DeadBranchHasOtherField { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/repr/repr-c-dead-variants.i686-pc-windows-msvc.stderr b/tests/ui/repr/repr-c-dead-variants.i686-pc-windows-msvc.stderr index 20b6a373e06d5..cc934916046a9 100644 --- a/tests/ui/repr/repr-c-dead-variants.i686-pc-windows-msvc.stderr +++ b/tests/ui/repr/repr-c-dead-variants.i686-pc-windows-msvc.stderr @@ -1,8 +1,6 @@ error: layout_of(Univariant) = Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Scalar( u32 is 0..=0, ), @@ -48,16 +46,14 @@ error: layout_of(Univariant) = Layout { repr_c: true, randomization_seed: $SEED, } - --> $DIR/repr-c-dead-variants.rs:44:1 + --> $DIR/repr-c-dead-variants.rs:43:1 | LL | enum Univariant { | ^^^^^^^^^^^^^^^ error: layout_of(TwoVariants) = Layout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: ScalarPair { a: u32 is 0..=1, b: union u8, @@ -123,16 +119,14 @@ error: layout_of(TwoVariants) = Layout { repr_c: true, randomization_seed: $SEED, } - --> $DIR/repr-c-dead-variants.rs:51:1 + --> $DIR/repr-c-dead-variants.rs:50:1 | LL | enum TwoVariants { | ^^^^^^^^^^^^^^^^ error: layout_of(DeadBranchHasOtherField) = Layout { size: Size(16 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, + align: Align(8 bytes), backend_repr: Memory { sized: true, }, @@ -196,7 +190,7 @@ error: layout_of(DeadBranchHasOtherField) = Layout { repr_c: true, randomization_seed: $SEED, } - --> $DIR/repr-c-dead-variants.rs:63:1 + --> $DIR/repr-c-dead-variants.rs:62:1 | LL | enum DeadBranchHasOtherField { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/repr/repr-c-dead-variants.rs b/tests/ui/repr/repr-c-dead-variants.rs index 6f379fbb9e1d1..6a1626f6dd9bc 100644 --- a/tests/ui/repr/repr-c-dead-variants.rs +++ b/tests/ui/repr/repr-c-dead-variants.rs @@ -10,7 +10,6 @@ use minicore::*; // See also: repr-c-int-dead-variants.rs //@ add-minicore -//@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$SOME_ALIGN" //@ normalize-stderr: "randomization_seed: \d+" -> "randomization_seed: $$SEED" // This test depends on the value of the `c_enum_min_bits` target option. diff --git a/tests/ui/repr/repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr b/tests/ui/repr/repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr index 20b6a373e06d5..cc934916046a9 100644 --- a/tests/ui/repr/repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr +++ b/tests/ui/repr/repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr @@ -1,8 +1,6 @@ error: layout_of(Univariant) = Layout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: Scalar( u32 is 0..=0, ), @@ -48,16 +46,14 @@ error: layout_of(Univariant) = Layout { repr_c: true, randomization_seed: $SEED, } - --> $DIR/repr-c-dead-variants.rs:44:1 + --> $DIR/repr-c-dead-variants.rs:43:1 | LL | enum Univariant { | ^^^^^^^^^^^^^^^ error: layout_of(TwoVariants) = Layout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, + align: Align(4 bytes), backend_repr: ScalarPair { a: u32 is 0..=1, b: union u8, @@ -123,16 +119,14 @@ error: layout_of(TwoVariants) = Layout { repr_c: true, randomization_seed: $SEED, } - --> $DIR/repr-c-dead-variants.rs:51:1 + --> $DIR/repr-c-dead-variants.rs:50:1 | LL | enum TwoVariants { | ^^^^^^^^^^^^^^^^ error: layout_of(DeadBranchHasOtherField) = Layout { size: Size(16 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, + align: Align(8 bytes), backend_repr: Memory { sized: true, }, @@ -196,7 +190,7 @@ error: layout_of(DeadBranchHasOtherField) = Layout { repr_c: true, randomization_seed: $SEED, } - --> $DIR/repr-c-dead-variants.rs:63:1 + --> $DIR/repr-c-dead-variants.rs:62:1 | LL | enum DeadBranchHasOtherField { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/repr/repr-c-int-dead-variants.rs b/tests/ui/repr/repr-c-int-dead-variants.rs index 5a9d557c057d2..6de32564dd91b 100644 --- a/tests/ui/repr/repr-c-int-dead-variants.rs +++ b/tests/ui/repr/repr-c-int-dead-variants.rs @@ -3,7 +3,6 @@ // See also: repr-c-dead-variants.rs -//@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$SOME_ALIGN" //@ normalize-stderr: "randomization_seed: \d+" -> "randomization_seed: $$SEED" // A simple uninhabited type. diff --git a/tests/ui/repr/repr-c-int-dead-variants.stderr b/tests/ui/repr/repr-c-int-dead-variants.stderr index 11889120ac3d1..2d31bb75c61ba 100644 --- a/tests/ui/repr/repr-c-int-dead-variants.stderr +++ b/tests/ui/repr/repr-c-int-dead-variants.stderr @@ -1,8 +1,6 @@ error: layout_of(UnivariantU8) = Layout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: Scalar( u8 is 0..=0, ), @@ -48,16 +46,14 @@ error: layout_of(UnivariantU8) = Layout { repr_c: true, randomization_seed: $SEED, } - --> $DIR/repr-c-int-dead-variants.rs:15:1 + --> $DIR/repr-c-int-dead-variants.rs:14:1 | LL | enum UnivariantU8 { | ^^^^^^^^^^^^^^^^^ error: layout_of(TwoVariantsU8) = Layout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, + align: Align(1 bytes), backend_repr: ScalarPair { a: u8 is 0..=1, b: union u8, @@ -123,16 +119,14 @@ error: layout_of(TwoVariantsU8) = Layout { repr_c: true, randomization_seed: $SEED, } - --> $DIR/repr-c-int-dead-variants.rs:22:1 + --> $DIR/repr-c-int-dead-variants.rs:21:1 | LL | enum TwoVariantsU8 { | ^^^^^^^^^^^^^^^^^^ error: layout_of(DeadBranchHasOtherFieldU8) = Layout { size: Size(16 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, + align: Align(8 bytes), backend_repr: Memory { sized: true, }, @@ -196,7 +190,7 @@ error: layout_of(DeadBranchHasOtherFieldU8) = Layout { repr_c: true, randomization_seed: $SEED, } - --> $DIR/repr-c-int-dead-variants.rs:34:1 + --> $DIR/repr-c-int-dead-variants.rs:33:1 | LL | enum DeadBranchHasOtherFieldU8 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/resolve/empty-struct-tuple-pat.stderr b/tests/ui/resolve/empty-struct-tuple-pat.stderr index 381a579b24bfb..864bc218c4d90 100644 --- a/tests/ui/resolve/empty-struct-tuple-pat.stderr +++ b/tests/ui/resolve/empty-struct-tuple-pat.stderr @@ -25,11 +25,17 @@ LL | XEmpty6 => () error[E0532]: expected unit struct, unit variant or constant, found tuple variant `E::Empty4` --> $DIR/empty-struct-tuple-pat.rs:29:9 | +LL | enum E { LL | Empty4() | -------- `E::Empty4` defined here ... LL | E::Empty4 => () - | ^^^^^^^^^ help: use the tuple variant pattern syntax instead: `E::Empty4()` + | ^^^^^^^^^ + | +help: use the tuple variant pattern syntax instead + | +LL | E::Empty4() => () + | ++ error[E0532]: expected unit struct, unit variant or constant, found tuple variant `XE::XEmpty5` --> $DIR/empty-struct-tuple-pat.rs:33:9 @@ -37,8 +43,10 @@ error[E0532]: expected unit struct, unit variant or constant, found tuple varian LL | XE::XEmpty5 => (), | ^^^^^^^^^^^ | - ::: $DIR/auxiliary/empty-struct.rs:8:5 + ::: $DIR/auxiliary/empty-struct.rs:5 | +LL | pub enum XE { +... LL | XEmpty5(), | ------- `XE::XEmpty5` defined here | diff --git a/tests/ui/resolve/empty-struct-unit-pat.stderr b/tests/ui/resolve/empty-struct-unit-pat.stderr index 6998baba5c8f8..10bc8a33a7dfd 100644 --- a/tests/ui/resolve/empty-struct-unit-pat.stderr +++ b/tests/ui/resolve/empty-struct-unit-pat.stderr @@ -12,7 +12,7 @@ note: similarly named tuple struct `XEmpty6` defined here | LL | pub struct XEmpty6(); | ^^^^^^^^^^^^^^^^^^ -help: use this syntax instead +help: use the unit struct syntax instead | LL - Empty2() => () LL + Empty2 => () @@ -39,7 +39,7 @@ note: similarly named tuple struct `XEmpty6` defined here | LL | pub struct XEmpty6(); | ^^^^^^^^^^^^^^^^^^ -help: use this syntax instead +help: use the unit struct syntax instead | LL - XEmpty2() => () LL + XEmpty2 => () @@ -64,7 +64,7 @@ note: similarly named tuple struct `XEmpty6` defined here | LL | pub struct XEmpty6(); | ^^^^^^^^^^^^^^^^^^ -help: use this syntax instead +help: use the unit struct syntax instead | LL - Empty2(..) => () LL + Empty2 => () @@ -91,7 +91,7 @@ note: similarly named tuple struct `XEmpty6` defined here | LL | pub struct XEmpty6(); | ^^^^^^^^^^^^^^^^^^ -help: use this syntax instead +help: use the unit struct syntax instead | LL - XEmpty2(..) => () LL + XEmpty2 => () @@ -105,11 +105,18 @@ LL + XEmpty6(..) => () error[E0532]: expected tuple struct or tuple variant, found unit variant `E::Empty4` --> $DIR/empty-struct-unit-pat.rs:37:9 | +LL | enum E { LL | Empty4 | ------ `E::Empty4` defined here ... LL | E::Empty4() => () - | ^^^^^^^^^^^ help: use this syntax instead: `E::Empty4` + | ^^^^^^^^^^^ + | +help: use the unit struct syntax instead + | +LL - E::Empty4() => () +LL + E::Empty4 => () + | error[E0532]: expected tuple struct or tuple variant, found unit variant `XE::XEmpty4` --> $DIR/empty-struct-unit-pat.rs:41:9 @@ -117,8 +124,10 @@ error[E0532]: expected tuple struct or tuple variant, found unit variant `XE::XE LL | XE::XEmpty4() => (), | ^^^^^^^^^^^^^ | - ::: $DIR/auxiliary/empty-struct.rs:7:5 + ::: $DIR/auxiliary/empty-struct.rs:5 | +LL | pub enum XE { +LL | XEmpty3 {}, LL | XEmpty4, | ------- `XE::XEmpty4` defined here | @@ -127,7 +136,7 @@ note: similarly named tuple variant `XEmpty5` defined here | LL | XEmpty5(), | ^^^^^^^ -help: use this syntax instead +help: use the unit struct syntax instead | LL - XE::XEmpty4() => (), LL + XE::XEmpty4 => (), @@ -141,11 +150,18 @@ LL + XE::XEmpty5() => (), error[E0532]: expected tuple struct or tuple variant, found unit variant `E::Empty4` --> $DIR/empty-struct-unit-pat.rs:46:9 | +LL | enum E { LL | Empty4 | ------ `E::Empty4` defined here ... LL | E::Empty4(..) => () - | ^^^^^^^^^^^^^ help: use this syntax instead: `E::Empty4` + | ^^^^^^^^^^^^^ + | +help: use the unit struct syntax instead + | +LL - E::Empty4(..) => () +LL + E::Empty4 => () + | error[E0532]: expected tuple struct or tuple variant, found unit variant `XE::XEmpty4` --> $DIR/empty-struct-unit-pat.rs:50:9 @@ -153,8 +169,10 @@ error[E0532]: expected tuple struct or tuple variant, found unit variant `XE::XE LL | XE::XEmpty4(..) => (), | ^^^^^^^^^^^^^^^ | - ::: $DIR/auxiliary/empty-struct.rs:7:5 + ::: $DIR/auxiliary/empty-struct.rs:5 | +LL | pub enum XE { +LL | XEmpty3 {}, LL | XEmpty4, | ------- `XE::XEmpty4` defined here | @@ -163,7 +181,7 @@ note: similarly named tuple variant `XEmpty5` defined here | LL | XEmpty5(), | ^^^^^^^ -help: use this syntax instead +help: use the unit struct syntax instead | LL - XE::XEmpty4(..) => (), LL + XE::XEmpty4 => (), diff --git a/tests/ui/suggestions/incorrect-variant-literal.svg b/tests/ui/suggestions/incorrect-variant-literal.svg index 54eaee2a2e906..6dee6eaf9b1c4 100644 --- a/tests/ui/suggestions/incorrect-variant-literal.svg +++ b/tests/ui/suggestions/incorrect-variant-literal.svg @@ -1,4 +1,4 @@ - +