authorbors <bors@rust-lang.org> 2026-01-14 03:26:31 UTC
committerbors <bors@rust-lang.org> 2026-01-14 03:26:31 UTC
log4931e09e3ac3182d2a00f38cccfdf68e8e385e1c
tree9bbc5ceae114b09da0e5dde3902cfb3bd8779c3b
parentfcac501a73cdde54de46a0683567f1a890730555
parent3adbd3ae4e12dcd0a3f0f68e887fea71f4ba00d5

Auto merge of #151087 - GuillaumeGomez:rollup-vIdiReJ, r=GuillaumeGomez

Rollup of 13 pull requests Successful merges: - rust-lang/rust#150587 (triagebot: add A-rustdoc-js autolabel) - rust-lang/rust#150677 (Improve std::path::Path::join documentation) - rust-lang/rust#150737 (diagnostics: make implicit Sized bounds explicit in E0277) - rust-lang/rust#150771 (Remove legacy homu `try` and `auto` branch mentions) - rust-lang/rust#150840 (Make `--print=check-cfg` output compatible `--check-cfg` arguments) - rust-lang/rust#150915 (Regression test for type params on eii) - rust-lang/rust#151017 (Port the rustc dump attributes to the attribute parser) - rust-lang/rust#151019 (Make `Type::of` support unsized types) - rust-lang/rust#151031 (Support arrays in type reflection) - rust-lang/rust#151043 (armv7-unknown-linux-uclibceabihf.md: Fix bootstrap.toml syntax) - rust-lang/rust#151052 (ui: add regression test for macro resolution ICE (issue rust-lang/rust#150711)) - rust-lang/rust#151053 (Reduce flakyness for `tests/rustdoc-gui/notable-trait.goml`) - rust-lang/rust#151055 (Emit error instead of delayed bug when meeting mismatch type for const array) r? @ghost

52 files changed, 728 insertions(+), 175 deletions(-)

.github/workflows/ci.yml+9-10
......@@ -11,11 +11,9 @@ name: CI
1111on:
1212 push:
1313 branches:
14 - auto
15 - try
16 - try-perf
17 - automation/bors/try
1814 - automation/bors/auto
15 - automation/bors/try
16 - try-perf
1917 pull_request:
2018 branches:
2119 - "**"
......@@ -33,9 +31,10 @@ defaults:
3331
3432concurrency:
3533 # For a given workflow, if we push to the same branch, cancel all previous builds on that branch.
36 # We add an exception for try builds (try branch) and unrolled rollup builds (try-perf), which
37 # are all triggered on the same branch, but which should be able to run concurrently.
38 group: ${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try') && github.sha) || github.ref }}
34 # We add an exception for try builds (automation/bors/try branch) and unrolled rollup builds
35 # (try-perf), which are all triggered on the same branch, but which should be able to run
36 # concurrently.
37 group: ${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try') && github.sha) || github.ref }}
3938 cancel-in-progress: true
4039env:
4140 TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate"
......@@ -57,7 +56,7 @@ jobs:
5756 - name: Test citool
5857 # Only test citool on the auto branch, to reduce latency of the calculate matrix job
5958 # on PR/try builds.
60 if: ${{ github.ref == 'refs/heads/auto' || github.ref == 'refs/heads/automation/bors/auto' }}
59 if: ${{ github.ref == 'refs/heads/automation/bors/auto' }}
6160 run: |
6261 cd src/ci/citool
6362 CARGO_INCREMENTAL=0 cargo test
......@@ -80,7 +79,7 @@ jobs:
8079 # access the environment.
8180 #
8281 # We only enable the environment for the rust-lang/rust repository, so that CI works on forks.
83 environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/auto' || github.ref == 'refs/heads/automation/bors/auto')) && 'bors') || '' }}
82 environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/automation/bors/auto')) && 'bors') || '' }}
8483 env:
8584 CI_JOB_NAME: ${{ matrix.name }}
8685 CI_JOB_DOC_URL: ${{ matrix.doc_url }}
......@@ -314,7 +313,7 @@ jobs:
314313 needs: [ calculate_matrix, job ]
315314 # !cancelled() executes the job regardless of whether the previous jobs passed or failed
316315 if: ${{ !cancelled() && contains(fromJSON('["auto", "try"]'), needs.calculate_matrix.outputs.run_type) }}
317 environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/auto' || github.ref == 'refs/heads/automation/bors/auto')) && 'bors') || '' }}
316 environment: ${{ ((github.repository == 'rust-lang/rust' && (github.ref == 'refs/heads/try-perf' || github.ref == 'refs/heads/automation/bors/try' || github.ref == 'refs/heads/automation/bors/auto')) && 'bors') || '' }}
318317 steps:
319318 - name: checkout the source code
320319 uses: actions/checkout@v5
compiler/rustc_attr_parsing/src/attributes/mod.rs+1
......@@ -57,6 +57,7 @@ pub(crate) mod pin_v2;
5757pub(crate) mod proc_macro_attrs;
5858pub(crate) mod prototype;
5959pub(crate) mod repr;
60pub(crate) mod rustc_dump;
6061pub(crate) mod rustc_internal;
6162pub(crate) mod semantics;
6263pub(crate) mod stability;
compiler/rustc_attr_parsing/src/attributes/rustc_dump.rs created+62
......@@ -0,0 +1,62 @@
1use rustc_hir::Target;
2use rustc_hir::attrs::AttributeKind;
3use rustc_span::{Span, Symbol, sym};
4
5use crate::attributes::prelude::Allow;
6use crate::attributes::{NoArgsAttributeParser, OnDuplicate};
7use crate::context::Stage;
8use crate::target_checking::AllowedTargets;
9
10pub(crate) struct RustcDumpUserArgs;
11
12impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpUserArgs {
13 const PATH: &[Symbol] = &[sym::rustc_dump_user_args];
14 const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
15 const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Fn)]);
16 const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpUserArgs;
17}
18
19pub(crate) struct RustcDumpDefParents;
20
21impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpDefParents {
22 const PATH: &[Symbol] = &[sym::rustc_dump_def_parents];
23 const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
24 const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::Fn)]);
25 const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpDefParents;
26}
27
28pub(crate) struct RustcDumpItemBounds;
29
30impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpItemBounds {
31 const PATH: &[Symbol] = &[sym::rustc_dump_item_bounds];
32 const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
33 const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[Allow(Target::AssocTy)]);
34 const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpItemBounds;
35}
36
37pub(crate) struct RustcDumpPredicates;
38
39impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpPredicates {
40 const PATH: &[Symbol] = &[sym::rustc_dump_predicates];
41 const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
42 const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
43 Allow(Target::Struct),
44 Allow(Target::Enum),
45 Allow(Target::Union),
46 Allow(Target::Trait),
47 Allow(Target::AssocTy),
48 ]);
49 const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpPredicates;
50}
51
52pub(crate) struct RustcDumpVtable;
53
54impl<S: Stage> NoArgsAttributeParser<S> for RustcDumpVtable {
55 const PATH: &[Symbol] = &[sym::rustc_dump_vtable];
56 const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
57 const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
58 Allow(Target::Impl { of_trait: true }),
59 Allow(Target::TyAlias),
60 ]);
61 const CREATE: fn(Span) -> AttributeKind = AttributeKind::RustcDumpVtable;
62}
compiler/rustc_attr_parsing/src/context.rs+9
......@@ -63,6 +63,10 @@ use crate::attributes::proc_macro_attrs::{
6363};
6464use crate::attributes::prototype::CustomMirParser;
6565use crate::attributes::repr::{AlignParser, AlignStaticParser, ReprParser};
66use crate::attributes::rustc_dump::{
67 RustcDumpDefParents, RustcDumpItemBounds, RustcDumpPredicates, RustcDumpUserArgs,
68 RustcDumpVtable,
69};
6670use crate::attributes::rustc_internal::{
6771 RustcHasIncoherentInherentImplsParser, RustcLayoutScalarValidRangeEndParser,
6872 RustcLayoutScalarValidRangeStartParser, RustcLegacyConstGenericsParser,
......@@ -267,6 +271,11 @@ attribute_parsers!(
267271 Single<WithoutArgs<ProcMacroParser>>,
268272 Single<WithoutArgs<PubTransparentParser>>,
269273 Single<WithoutArgs<RustcCoherenceIsCoreParser>>,
274 Single<WithoutArgs<RustcDumpDefParents>>,
275 Single<WithoutArgs<RustcDumpItemBounds>>,
276 Single<WithoutArgs<RustcDumpPredicates>>,
277 Single<WithoutArgs<RustcDumpUserArgs>>,
278 Single<WithoutArgs<RustcDumpVtable>>,
270279 Single<WithoutArgs<RustcHasIncoherentInherentImplsParser>>,
271280 Single<WithoutArgs<RustcLintDiagnosticsParser>>,
272281 Single<WithoutArgs<RustcLintOptTyParser>>,
compiler/rustc_const_eval/src/const_eval/type_info.rs+33-2
......@@ -3,7 +3,7 @@ use rustc_hir::LangItem;
33use rustc_middle::mir::interpret::CtfeProvenance;
44use rustc_middle::span_bug;
55use rustc_middle::ty::layout::TyAndLayout;
6use rustc_middle::ty::{self, ScalarInt, Ty};
6use rustc_middle::ty::{self, Const, ScalarInt, Ty};
77use rustc_span::{Symbol, sym};
88
99use crate::const_eval::CompileTimeMachine;
......@@ -56,6 +56,14 @@ impl<'tcx> InterpCx<'tcx, CompileTimeMachine<'tcx>> {
5656 self.write_tuple_fields(tuple_place, fields, ty)?;
5757 variant
5858 }
59 ty::Array(ty, len) => {
60 let (variant, variant_place) = downcast(sym::Array)?;
61 let array_place = self.project_field(&variant_place, FieldIdx::ZERO)?;
62
63 self.write_array_type_info(array_place, *ty, *len)?;
64
65 variant
66 }
5967 // For now just merge all primitives into one `Leaf` variant with no data
6068 ty::Uint(_) | ty::Int(_) | ty::Float(_) | ty::Char | ty::Bool => {
6169 downcast(sym::Leaf)?.0
......@@ -63,7 +71,6 @@ impl<'tcx> InterpCx<'tcx, CompileTimeMachine<'tcx>> {
6371 ty::Adt(_, _)
6472 | ty::Foreign(_)
6573 | ty::Str
66 | ty::Array(_, _)
6774 | ty::Pat(_, _)
6875 | ty::Slice(_)
6976 | ty::RawPtr(..)
......@@ -172,4 +179,28 @@ impl<'tcx> InterpCx<'tcx, CompileTimeMachine<'tcx>> {
172179 }
173180 interp_ok(())
174181 }
182
183 pub(crate) fn write_array_type_info(
184 &mut self,
185 place: impl Writeable<'tcx, CtfeProvenance>,
186 ty: Ty<'tcx>,
187 len: Const<'tcx>,
188 ) -> InterpResult<'tcx> {
189 // Iterate over all fields of `type_info::Array`.
190 for (field_idx, field) in
191 place.layout().ty.ty_adt_def().unwrap().non_enum_variant().fields.iter_enumerated()
192 {
193 let field_place = self.project_field(&place, field_idx)?;
194
195 match field.name {
196 // Write the `TypeId` of the array's elements to the `element_ty` field.
197 sym::element_ty => self.write_type_id(ty, &field_place)?,
198 // Write the length of the array to the `len` field.
199 sym::len => self.write_scalar(len.to_leaf(), &field_place)?,
200 other => span_bug!(self.tcx.def_span(field.did), "unimplemented field {other}"),
201 }
202 }
203
204 interp_ok(())
205 }
175206}
compiler/rustc_driver_impl/src/lib.rs+20-15
......@@ -765,30 +765,35 @@ fn print_crate_info(
765765 for (name, expected_values) in &sess.psess.check_config.expecteds {
766766 use crate::config::ExpectedValues;
767767 match expected_values {
768 ExpectedValues::Any => check_cfgs.push(format!("{name}=any()")),
768 ExpectedValues::Any => {
769 check_cfgs.push(format!("cfg({name}, values(any()))"))
770 }
769771 ExpectedValues::Some(values) => {
770 if !values.is_empty() {
771 check_cfgs.extend(values.iter().map(|value| {
772 let mut values: Vec<_> = values
773 .iter()
774 .map(|value| {
772775 if let Some(value) = value {
773 format!("{name}=\"{value}\"")
776 format!("\"{value}\"")
774777 } else {
775 name.to_string()
778 "none()".to_string()
776779 }
777 }))
778 } else {
779 check_cfgs.push(format!("{name}="))
780 }
780 })
781 .collect();
782
783 values.sort_unstable();
784
785 let values = values.join(", ");
786
787 check_cfgs.push(format!("cfg({name}, values({values}))"))
781788 }
782789 }
783790 }
784791
785792 check_cfgs.sort_unstable();
786 if !sess.psess.check_config.exhaustive_names {
787 if !sess.psess.check_config.exhaustive_values {
788 println_info!("any()=any()");
789 } else {
790 println_info!("any()");
791 }
793 if !sess.psess.check_config.exhaustive_names
794 && sess.psess.check_config.exhaustive_values
795 {
796 println_info!("cfg(any())");
792797 }
793798 for check_cfg in check_cfgs {
794799 println_info!("{check_cfg}");
compiler/rustc_hir/src/attrs/data_structures.rs+15
......@@ -906,6 +906,21 @@ pub enum AttributeKind {
906906 /// Represents `#[rustc_coherence_is_core]`
907907 RustcCoherenceIsCore(Span),
908908
909 /// Represents `#[rustc_dump_def_parents]`
910 RustcDumpDefParents,
911
912 /// Represents `#[rustc_dump_item_bounds]`
913 RustcDumpItemBounds,
914
915 /// Represents `#[rustc_dump_predicates]`
916 RustcDumpPredicates,
917
918 /// Represents `#[rustc_dump_user_args]`
919 RustcDumpUserArgs,
920
921 /// Represents `#[rustc_dump_vtable]`
922 RustcDumpVtable(Span),
923
909924 /// Represents `#[rustc_has_incoherent_inherent_impls]`
910925 RustcHasIncoherentInherentImpls,
911926
compiler/rustc_hir/src/attrs/encode_cross_crate.rs+5
......@@ -97,6 +97,11 @@ impl AttributeKind {
9797 Repr { .. } => No,
9898 RustcBuiltinMacro { .. } => Yes,
9999 RustcCoherenceIsCore(..) => No,
100 RustcDumpDefParents => No,
101 RustcDumpItemBounds => No,
102 RustcDumpPredicates => No,
103 RustcDumpUserArgs => No,
104 RustcDumpVtable(..) => No,
100105 RustcHasIncoherentInherentImpls => Yes,
101106 RustcLayoutScalarValidRangeEnd(..) => Yes,
102107 RustcLayoutScalarValidRangeStart(..) => Yes,
compiler/rustc_hir_analysis/messages.ftl+2-1
......@@ -166,8 +166,9 @@ hir_analysis_duplicate_precise_capture = cannot capture parameter `{$name}` twic
166166 .label = parameter captured again here
167167
168168hir_analysis_eii_with_generics =
169 #[{$eii_name}] cannot have generic parameters other than lifetimes
169 `{$impl_name}` cannot have generic parameters other than lifetimes
170170 .label = required by this attribute
171 .help = `#[{$eii_name}]` marks the implementation of an "externally implementable item"
171172
172173hir_analysis_empty_specialization = specialization impl does not specialize any associated items
173174 .note = impl is a specialization of this impl
compiler/rustc_hir_analysis/src/check/check.rs+8-1
......@@ -974,12 +974,19 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(),
974974 (0, _) => ("const", "consts", None),
975975 _ => ("type or const", "types or consts", None),
976976 };
977 let name =
978 if find_attr!(tcx.get_all_attrs(def_id), AttributeKind::EiiForeignItem) {
979 "externally implementable items"
980 } else {
981 "foreign items"
982 };
983
977984 let span = tcx.def_span(def_id);
978985 struct_span_code_err!(
979986 tcx.dcx(),
980987 span,
981988 E0044,
982 "foreign items may not have {kinds} parameters",
989 "{name} may not have {kinds} parameters",
983990 )
984991 .with_span_label(span, format!("can't have {kinds} parameters"))
985992 .with_help(
compiler/rustc_hir_analysis/src/check/compare_eii.rs+15-2
......@@ -8,8 +8,9 @@ use std::iter;
88
99use rustc_data_structures::fx::FxIndexSet;
1010use rustc_errors::{Applicability, E0806, struct_span_code_err};
11use rustc_hir::attrs::{AttributeKind, EiiImplResolution};
1112use rustc_hir::def_id::{DefId, LocalDefId};
12use rustc_hir::{self as hir, FnSig, HirId, ItemKind};
13use rustc_hir::{self as hir, FnSig, HirId, ItemKind, find_attr};
1314use rustc_infer::infer::{self, InferCtxt, TyCtxtInferExt};
1415use rustc_infer::traits::{ObligationCause, ObligationCauseCode};
1516use rustc_middle::ty::error::{ExpectedFound, TypeError};
......@@ -169,11 +170,23 @@ fn check_no_generics<'tcx>(
169170 eii_attr_span: Span,
170171) -> Result<(), ErrorGuaranteed> {
171172 let generics = tcx.generics_of(external_impl);
172 if generics.own_requires_monomorphization() {
173 if generics.own_requires_monomorphization()
174 // When an EII implementation is automatically generated by the `#[eii]` macro,
175 // it will directly refer to the foreign item, not through a macro.
176 // We don't want to emit this error if it's an implementation that's generated by the `#[eii]` macro,
177 // since in that case it looks like a duplicate error: the declaration of the EII already can't contain generics.
178 // So, we check here if at least one of the eii impls has ImplResolution::Macro, which indicates it's
179 // not generated as part of the declaration.
180 && find_attr!(
181 tcx.get_all_attrs(external_impl),
182 AttributeKind::EiiImpls(impls) if impls.iter().any(|i| matches!(i.resolution, EiiImplResolution::Macro(_)))
183 )
184 {
173185 tcx.dcx().emit_err(EiiWithGenerics {
174186 span: tcx.def_span(external_impl),
175187 attr: eii_attr_span,
176188 eii_name,
189 impl_name: tcx.item_name(external_impl),
177190 });
178191 }
179192
compiler/rustc_hir_analysis/src/collect/dump.rs+15-13
......@@ -1,6 +1,7 @@
11use rustc_hir as hir;
2use rustc_hir::attrs::AttributeKind;
23use rustc_hir::def_id::{CRATE_DEF_ID, LocalDefId};
3use rustc_hir::intravisit;
4use rustc_hir::{find_attr, intravisit};
45use rustc_middle::hir::nested_filter;
56use rustc_middle::ty::{self, TyCtxt, TypeVisitableExt};
67use rustc_span::sym;
......@@ -28,7 +29,7 @@ pub(crate) fn opaque_hidden_types(tcx: TyCtxt<'_>) {
2829
2930pub(crate) fn predicates_and_item_bounds(tcx: TyCtxt<'_>) {
3031 for id in tcx.hir_crate_items(()).owners() {
31 if tcx.has_attr(id, sym::rustc_dump_predicates) {
32 if find_attr!(tcx.get_all_attrs(id), AttributeKind::RustcDumpPredicates) {
3233 let preds = tcx.predicates_of(id).instantiate_identity(tcx).predicates;
3334 let span = tcx.def_span(id);
3435
......@@ -38,7 +39,7 @@ pub(crate) fn predicates_and_item_bounds(tcx: TyCtxt<'_>) {
3839 }
3940 diag.emit();
4041 }
41 if tcx.has_attr(id, sym::rustc_dump_item_bounds) {
42 if find_attr!(tcx.get_all_attrs(id), AttributeKind::RustcDumpItemBounds) {
4243 let bounds = tcx.item_bounds(id).instantiate_identity();
4344 let span = tcx.def_span(id);
4445
......@@ -54,7 +55,7 @@ pub(crate) fn predicates_and_item_bounds(tcx: TyCtxt<'_>) {
5455pub(crate) fn def_parents(tcx: TyCtxt<'_>) {
5556 for iid in tcx.hir_free_items() {
5657 let did = iid.owner_id.def_id;
57 if tcx.has_attr(did, sym::rustc_dump_def_parents) {
58 if find_attr!(tcx.get_all_attrs(did), AttributeKind::RustcDumpDefParents) {
5859 struct AnonConstFinder<'tcx> {
5960 tcx: TyCtxt<'tcx>,
6061 anon_consts: Vec<LocalDefId>,
......@@ -102,7 +103,9 @@ pub(crate) fn vtables<'tcx>(tcx: TyCtxt<'tcx>) {
102103 for id in tcx.hir_free_items() {
103104 let def_id = id.owner_id.def_id;
104105
105 let Some(attr) = tcx.get_attr(def_id, sym::rustc_dump_vtable) else {
106 let Some(&attr_span) =
107 find_attr!(tcx.get_all_attrs(def_id), AttributeKind::RustcDumpVtable(span) => span)
108 else {
106109 continue;
107110 };
108111
......@@ -111,14 +114,14 @@ pub(crate) fn vtables<'tcx>(tcx: TyCtxt<'tcx>) {
111114 let trait_ref = tcx.impl_trait_ref(def_id).instantiate_identity();
112115 if trait_ref.has_non_region_param() {
113116 tcx.dcx().span_err(
114 attr.span(),
117 attr_span,
115118 "`rustc_dump_vtable` must be applied to non-generic impl",
116119 );
117120 continue;
118121 }
119122 if !tcx.is_dyn_compatible(trait_ref.def_id) {
120123 tcx.dcx().span_err(
121 attr.span(),
124 attr_span,
122125 "`rustc_dump_vtable` must be applied to dyn-compatible trait",
123126 );
124127 continue;
......@@ -127,7 +130,7 @@ pub(crate) fn vtables<'tcx>(tcx: TyCtxt<'tcx>) {
127130 .try_normalize_erasing_regions(ty::TypingEnv::fully_monomorphized(), trait_ref)
128131 else {
129132 tcx.dcx().span_err(
130 attr.span(),
133 attr_span,
131134 "`rustc_dump_vtable` applied to impl header that cannot be normalized",
132135 );
133136 continue;
......@@ -138,7 +141,7 @@ pub(crate) fn vtables<'tcx>(tcx: TyCtxt<'tcx>) {
138141 let ty = tcx.type_of(def_id).instantiate_identity();
139142 if ty.has_non_region_param() {
140143 tcx.dcx().span_err(
141 attr.span(),
144 attr_span,
142145 "`rustc_dump_vtable` must be applied to non-generic type",
143146 );
144147 continue;
......@@ -147,14 +150,13 @@ pub(crate) fn vtables<'tcx>(tcx: TyCtxt<'tcx>) {
147150 tcx.try_normalize_erasing_regions(ty::TypingEnv::fully_monomorphized(), ty)
148151 else {
149152 tcx.dcx().span_err(
150 attr.span(),
153 attr_span,
151154 "`rustc_dump_vtable` applied to type alias that cannot be normalized",
152155 );
153156 continue;
154157 };
155158 let ty::Dynamic(data, _) = *ty.kind() else {
156 tcx.dcx()
157 .span_err(attr.span(), "`rustc_dump_vtable` to type alias of dyn type");
159 tcx.dcx().span_err(attr_span, "`rustc_dump_vtable` to type alias of dyn type");
158160 continue;
159161 };
160162 if let Some(principal) = data.principal() {
......@@ -167,7 +169,7 @@ pub(crate) fn vtables<'tcx>(tcx: TyCtxt<'tcx>) {
167169 }
168170 _ => {
169171 tcx.dcx().span_err(
170 attr.span(),
172 attr_span,
171173 "`rustc_dump_vtable` only applies to impl, or type alias of dyn type",
172174 );
173175 continue;
compiler/rustc_hir_analysis/src/errors.rs+2
......@@ -1655,10 +1655,12 @@ pub(crate) struct LifetimesOrBoundsMismatchOnEii {
16551655
16561656#[derive(Diagnostic)]
16571657#[diag(hir_analysis_eii_with_generics)]
1658#[help]
16581659pub(crate) struct EiiWithGenerics {
16591660 #[primary_span]
16601661 pub span: Span,
16611662 #[label]
16621663 pub attr: Span,
16631664 pub eii_name: Symbol,
1665 pub impl_name: Symbol,
16641666}
compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs+4-5
......@@ -2415,11 +2415,10 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
24152415 };
24162416
24172417 let ty::Array(elem_ty, _) = ty.kind() else {
2418 return Const::new_error_with_message(
2419 tcx,
2420 array_expr.span,
2421 "const array must have an array type",
2422 );
2418 let e = tcx
2419 .dcx()
2420 .span_err(array_expr.span, format!("expected `{}`, found const array", ty));
2421 return Const::new_error(tcx, e);
24232422 };
24242423
24252424 let elems = array_expr
compiler/rustc_hir_typeck/src/writeback.rs+5-4
......@@ -14,9 +14,10 @@ use std::ops::ControlFlow;
1414use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
1515use rustc_data_structures::unord::ExtendUnord;
1616use rustc_errors::{E0720, ErrorGuaranteed};
17use rustc_hir::attrs::AttributeKind;
1718use rustc_hir::def_id::LocalDefId;
1819use rustc_hir::intravisit::{self, InferKind, Visitor};
19use rustc_hir::{self as hir, AmbigArg, HirId};
20use rustc_hir::{self as hir, AmbigArg, HirId, find_attr};
2021use rustc_infer::traits::solve::Goal;
2122use rustc_middle::traits::ObligationCause;
2223use rustc_middle::ty::adjustment::{Adjust, Adjustment, PointerCoercion};
......@@ -25,7 +26,7 @@ use rustc_middle::ty::{
2526 TypeSuperFoldable, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor,
2627 fold_regions,
2728};
28use rustc_span::{Span, sym};
29use rustc_span::Span;
2930use rustc_trait_selection::error_reporting::infer::need_type_info::TypeAnnotationNeeded;
3031use rustc_trait_selection::opaque_types::opaque_type_has_defining_use_args;
3132use rustc_trait_selection::solve;
......@@ -45,8 +46,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
4546
4647 // This attribute causes us to dump some writeback information
4748 // in the form of errors, which is used for unit tests.
48 let rustc_dump_user_args =
49 self.has_rustc_attrs && self.tcx.has_attr(item_def_id, sym::rustc_dump_user_args);
49 let rustc_dump_user_args = self.has_rustc_attrs
50 && find_attr!(self.tcx.get_all_attrs(item_def_id), AttributeKind::RustcDumpUserArgs);
5051
5152 let mut wbcx = WritebackCx::new(self, body, rustc_dump_user_args);
5253 for param in body.params {
compiler/rustc_passes/src/check_attr.rs+5-5
......@@ -309,6 +309,11 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
309309 | AttributeKind::CfiEncoding { .. }
310310 | AttributeKind::RustcHasIncoherentInherentImpls
311311 | AttributeKind::MustNotSupend { .. }
312 | AttributeKind::RustcDumpUserArgs
313 | AttributeKind::RustcDumpItemBounds
314 | AttributeKind::RustcDumpPredicates
315 | AttributeKind::RustcDumpDefParents
316 | AttributeKind::RustcDumpVtable(..)
312317 ) => { /* do nothing */ }
313318 Attribute::Unparsed(attr_item) => {
314319 style = Some(attr_item.style);
......@@ -368,25 +373,20 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
368373 | sym::rustc_abi
369374 | sym::rustc_layout
370375 | sym::rustc_proc_macro_decls
371 | sym::rustc_dump_def_parents
372376 | sym::rustc_never_type_options
373377 | sym::rustc_autodiff
374378 | sym::rustc_capture_analysis
375379 | sym::rustc_regions
376380 | sym::rustc_strict_coherence
377 | sym::rustc_dump_predicates
378381 | sym::rustc_variance
379382 | sym::rustc_variance_of_opaques
380383 | sym::rustc_hidden_type_of_opaques
381384 | sym::rustc_mir
382 | sym::rustc_dump_user_args
383385 | sym::rustc_effective_visibility
384386 | sym::rustc_outlives
385387 | sym::rustc_symbol_name
386388 | sym::rustc_evaluate_where_clauses
387 | sym::rustc_dump_vtable
388389 | sym::rustc_delayed_bug_from_inside_query
389 | sym::rustc_dump_item_bounds
390390 | sym::rustc_def_path
391391 | sym::rustc_partition_reused
392392 | sym::rustc_partition_codegened
compiler/rustc_span/src/symbol.rs+2
......@@ -162,6 +162,7 @@ symbols! {
162162 Arc,
163163 ArcWeak,
164164 Argument,
165 Array,
165166 ArrayIntoIter,
166167 AsMut,
167168 AsRef,
......@@ -939,6 +940,7 @@ symbols! {
939940 eii_impl,
940941 eii_internals,
941942 eii_shared_macro,
943 element_ty,
942944 emit,
943945 emit_enum,
944946 emit_enum_variant,
compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs+47-10
......@@ -1391,25 +1391,45 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
13911391 // return early in the caller.
13921392
13931393 let mut label = || {
1394 // Special case `Sized` as `old_pred` will be the trait itself instead of
1395 // `Sized` when the trait bound is the source of the error.
1396 let is_sized = match obligation.predicate.kind().skip_binder() {
1397 ty::PredicateKind::Clause(ty::ClauseKind::Trait(trait_pred)) => {
1398 self.tcx.is_lang_item(trait_pred.def_id(), LangItem::Sized)
1399 }
1400 _ => false,
1401 };
1402
13941403 let msg = format!(
13951404 "the trait bound `{}` is not satisfied",
13961405 self.tcx.short_string(old_pred, err.long_ty_path()),
13971406 );
1398 let self_ty_str =
1399 self.tcx.short_string(old_pred.self_ty().skip_binder(), err.long_ty_path());
1407 let self_ty_str = self.tcx.short_string(old_pred.self_ty(), err.long_ty_path());
14001408 let trait_path = self
14011409 .tcx
14021410 .short_string(old_pred.print_modifiers_and_trait_path(), err.long_ty_path());
14031411
14041412 if has_custom_message {
1413 let msg = if is_sized {
1414 "the trait bound `Sized` is not satisfied".into()
1415 } else {
1416 msg
1417 };
14051418 err.note(msg);
14061419 } else {
14071420 err.messages = vec![(rustc_errors::DiagMessage::from(msg), Style::NoStyle)];
14081421 }
1409 err.span_label(
1410 span,
1411 format!("the trait `{trait_path}` is not implemented for `{self_ty_str}`"),
1412 );
1422 if is_sized {
1423 err.span_label(
1424 span,
1425 format!("the trait `Sized` is not implemented for `{self_ty_str}`"),
1426 );
1427 } else {
1428 err.span_label(
1429 span,
1430 format!("the trait `{trait_path}` is not implemented for `{self_ty_str}`"),
1431 );
1432 }
14131433 };
14141434
14151435 let mut sugg_prefixes = vec![];
......@@ -3578,10 +3598,27 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
35783598 "unsatisfied trait bound introduced in this `derive` macro",
35793599 );
35803600 } else if !data.span.is_dummy() && !data.span.overlaps(self_ty.span) {
3581 spans.push_span_label(
3582 data.span,
3583 "unsatisfied trait bound introduced here",
3584 );
3601 // `Sized` may be an explicit or implicit trait bound. If it is
3602 // implicit, mention it as such.
3603 if let Some(pred) = predicate.as_trait_clause()
3604 && self.tcx.is_lang_item(pred.def_id(), LangItem::Sized)
3605 && self
3606 .tcx
3607 .generics_of(data.impl_or_alias_def_id)
3608 .own_params
3609 .iter()
3610 .any(|param| self.tcx.def_span(param.def_id) == data.span)
3611 {
3612 spans.push_span_label(
3613 data.span,
3614 "unsatisfied trait bound implicitly introduced here",
3615 );
3616 } else {
3617 spans.push_span_label(
3618 data.span,
3619 "unsatisfied trait bound introduced here",
3620 );
3621 }
35853622 }
35863623 err.span_note(spans, msg);
35873624 point_at_assoc_type_restriction(
library/core/src/mem/type_info.rs+14-1
......@@ -31,7 +31,7 @@ impl Type {
3131 #[unstable(feature = "type_info", issue = "146922")]
3232 #[rustc_const_unstable(feature = "type_info", issue = "146922")]
3333 // FIXME(reflection): don't require the 'static bound
34 pub const fn of<T: 'static>() -> Self {
34 pub const fn of<T: ?Sized + 'static>() -> Self {
3535 const { TypeId::of::<T>().info() }
3636 }
3737}
......@@ -43,6 +43,8 @@ impl Type {
4343pub enum TypeKind {
4444 /// Tuples.
4545 Tuple(Tuple),
46 /// Arrays.
47 Array(Array),
4648 /// Primitives
4749 /// FIXME(#146922): disambiguate further
4850 Leaf,
......@@ -69,3 +71,14 @@ pub struct Field {
6971 /// Offset in bytes from the parent type
7072 pub offset: usize,
7173}
74
75/// Compile-time type information about arrays.
76#[derive(Debug)]
77#[non_exhaustive]
78#[unstable(feature = "type_info", issue = "146922")]
79pub struct Array {
80 /// The type of each element in the array.
81 pub element_ty: TypeId,
82 /// The length of the array.
83 pub len: usize,
84}
library/coretests/tests/lib.rs+1
......@@ -115,6 +115,7 @@
115115#![feature(try_blocks)]
116116#![feature(try_find)]
117117#![feature(try_trait_v2)]
118#![feature(type_info)]
118119#![feature(uint_bit_width)]
119120#![feature(uint_gather_scatter_bits)]
120121#![feature(unsize)]
library/coretests/tests/mem.rs+2
......@@ -1,3 +1,5 @@
1mod type_info;
2
13use core::mem::*;
24use core::{array, ptr};
35use std::cell::Cell;
library/coretests/tests/mem/type_info.rs created+56
......@@ -0,0 +1,56 @@
1use std::any::TypeId;
2use std::mem::type_info::{Type, TypeKind};
3
4#[test]
5fn test_arrays() {
6 // Normal array.
7 match const { Type::of::<[u16; 4]>() }.kind {
8 TypeKind::Array(array) => {
9 assert_eq!(array.element_ty, TypeId::of::<u16>());
10 assert_eq!(array.len, 4);
11 }
12 _ => unreachable!(),
13 }
14
15 // Zero-length array.
16 match const { Type::of::<[bool; 0]>() }.kind {
17 TypeKind::Array(array) => {
18 assert_eq!(array.element_ty, TypeId::of::<bool>());
19 assert_eq!(array.len, 0);
20 }
21 _ => unreachable!(),
22 }
23}
24
25#[test]
26fn test_tuples() {
27 fn assert_tuple_arity<T: 'static, const N: usize>() {
28 match const { Type::of::<T>() }.kind {
29 TypeKind::Tuple(tup) => {
30 assert_eq!(tup.fields.len(), N);
31 }
32 _ => unreachable!(),
33 }
34 }
35
36 assert_tuple_arity::<(), 0>();
37 assert_tuple_arity::<(u8,), 1>();
38 assert_tuple_arity::<(u8, u8), 2>();
39
40 const {
41 match Type::of::<(u8, u8)>().kind {
42 TypeKind::Tuple(tup) => {
43 let [a, b] = tup.fields else { unreachable!() };
44
45 assert!(a.offset == 0);
46 assert!(b.offset == 1);
47
48 match (a.ty.info().kind, b.ty.info().kind) {
49 (TypeKind::Leaf, TypeKind::Leaf) => {}
50 _ => unreachable!(),
51 }
52 }
53 _ => unreachable!(),
54 }
55 }
56}
library/std/src/path.rs+9
......@@ -2972,6 +2972,15 @@ impl Path {
29722972 ///
29732973 /// If `path` is absolute, it replaces the current path.
29742974 ///
2975 /// On Windows:
2976 ///
2977 /// * if `path` has a root but no prefix (e.g., `\windows`), it
2978 /// replaces and returns everything except for the prefix (if any) of `self`.
2979 /// * if `path` has a prefix but no root, `self` is ignored and `path` is returned.
2980 /// * if `self` has a verbatim prefix (e.g. `\\?\C:\windows`)
2981 /// and `path` is not empty, the new path is normalized: all references
2982 /// to `.` and `..` are removed.
2983 ///
29752984 /// See [`PathBuf::push`] for more details on what it means to adjoin a path.
29762985 ///
29772986 /// # Examples
src/ci/citool/src/main.rs+2-4
......@@ -41,14 +41,12 @@ impl GitHubContext {
4141 match (self.event_name.as_str(), self.branch_ref.as_str()) {
4242 ("pull_request", _) => Some(RunType::PullRequest),
4343 ("push", "refs/heads/try-perf") => Some(RunType::TryJob { job_patterns: None }),
44 ("push", "refs/heads/try" | "refs/heads/automation/bors/try") => {
44 ("push", "refs/heads/automation/bors/try") => {
4545 let patterns = self.get_try_job_patterns();
4646 let patterns = if !patterns.is_empty() { Some(patterns) } else { None };
4747 Some(RunType::TryJob { job_patterns: patterns })
4848 }
49 ("push", "refs/heads/auto" | "refs/heads/automation/bors/auto") => {
50 Some(RunType::AutoJob)
51 }
49 ("push", "refs/heads/automation/bors/auto") => Some(RunType::AutoJob),
5250 ("push", "refs/heads/main") => Some(RunType::MainJob),
5351 _ => None,
5452 }
src/ci/citool/tests/jobs.rs+3-3
......@@ -4,7 +4,7 @@ const TEST_JOBS_YML_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/tes
44
55#[test]
66fn auto_jobs() {
7 let stdout = get_matrix("push", "commit", "refs/heads/auto");
7 let stdout = get_matrix("push", "commit", "refs/heads/automation/bors/auto");
88 insta::assert_snapshot!(stdout, @r#"
99 jobs=[{"name":"aarch64-gnu","full_name":"auto - aarch64-gnu","os":"ubuntu-22.04-arm","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","TOOLSTATE_PUBLISH":1},"free_disk":true},{"name":"x86_64-gnu-llvm-18-1","full_name":"auto - x86_64-gnu-llvm-18-1","os":"ubuntu-24.04","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","DOCKER_SCRIPT":"stage_2_test_set1.sh","IMAGE":"x86_64-gnu-llvm-18","READ_ONLY_SRC":"0","RUST_BACKTRACE":1,"TOOLSTATE_PUBLISH":1},"free_disk":true},{"name":"aarch64-apple","full_name":"auto - aarch64-apple","os":"macos-14","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","MACOSX_DEPLOYMENT_TARGET":11.0,"MACOSX_STD_DEPLOYMENT_TARGET":11.0,"NO_DEBUG_ASSERTIONS":1,"NO_LLVM_ASSERTIONS":1,"NO_OVERFLOW_CHECKS":1,"RUSTC_RETRY_LINKER_ON_SEGFAULT":1,"RUST_CONFIGURE_ARGS":"--enable-sanitizers --enable-profiler --set rust.jemalloc","SCRIPT":"./x.py --stage 2 test --host=aarch64-apple-darwin --target=aarch64-apple-darwin","SELECT_XCODE":"/Applications/Xcode_15.4.app","TOOLSTATE_PUBLISH":1,"USE_XCODE_CLANG":1}},{"name":"dist-i686-msvc","full_name":"auto - dist-i686-msvc","os":"windows-2022","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","CODEGEN_BACKENDS":"llvm,cranelift","DEPLOY_BUCKET":"rust-lang-ci2","DIST_REQUIRE_ALL_TOOLS":1,"RUST_CONFIGURE_ARGS":"--build=i686-pc-windows-msvc --host=i686-pc-windows-msvc --target=i686-pc-windows-msvc,i586-pc-windows-msvc --enable-full-tools --enable-profiler","SCRIPT":"python x.py dist bootstrap --include-default-paths","TOOLSTATE_PUBLISH":1}},{"name":"pr-check-1","full_name":"auto - pr-check-1","os":"ubuntu-24.04","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","TOOLSTATE_PUBLISH":1},"continue_on_error":false,"free_disk":true},{"name":"pr-check-2","full_name":"auto - pr-check-2","os":"ubuntu-24.04","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","TOOLSTATE_PUBLISH":1},"continue_on_error":false,"free_disk":true},{"name":"tidy","full_name":"auto - tidy","os":"ubuntu-24.04","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","TOOLSTATE_PUBLISH":1},"continue_on_error":false,"free_disk":true,"doc_url":"https://foo.bar"}]
1010 run_type=auto
......@@ -13,7 +13,7 @@ fn auto_jobs() {
1313
1414#[test]
1515fn try_jobs() {
16 let stdout = get_matrix("push", "commit", "refs/heads/try");
16 let stdout = get_matrix("push", "commit", "refs/heads/automation/bors/try");
1717 insta::assert_snapshot!(stdout, @r###"
1818 jobs=[{"name":"dist-x86_64-linux","full_name":"try - dist-x86_64-linux","os":"ubuntu-22.04-16core-64gb","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","CODEGEN_BACKENDS":"llvm,cranelift","DEPLOY_BUCKET":"rust-lang-ci2","DIST_TRY_BUILD":1,"TOOLSTATE_PUBLISH":1}}]
1919 run_type=try
......@@ -28,7 +28,7 @@ fn try_custom_jobs() {
2828
2929try-job: aarch64-gnu
3030try-job: dist-i686-msvc"#,
31 "refs/heads/try",
31 "refs/heads/automation/bors/try",
3232 );
3333 insta::assert_snapshot!(stdout, @r###"
3434 jobs=[{"name":"aarch64-gnu","full_name":"try - aarch64-gnu","os":"ubuntu-22.04-arm","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","DEPLOY_BUCKET":"rust-lang-ci2","TOOLSTATE_PUBLISH":1},"free_disk":true},{"name":"dist-i686-msvc","full_name":"try - dist-i686-msvc","os":"windows-2022","env":{"ARTIFACTS_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZN24CBO55","AWS_REGION":"us-west-1","CACHES_AWS_ACCESS_KEY_ID":"AKIA46X5W6CZI5DHEBFL","CODEGEN_BACKENDS":"llvm,cranelift","DEPLOY_BUCKET":"rust-lang-ci2","DIST_REQUIRE_ALL_TOOLS":1,"RUST_CONFIGURE_ARGS":"--build=i686-pc-windows-msvc --host=i686-pc-windows-msvc --target=i686-pc-windows-msvc,i586-pc-windows-msvc --enable-full-tools --enable-profiler","SCRIPT":"python x.py dist bootstrap --include-default-paths","TOOLSTATE_PUBLISH":1}}]
src/ci/scripts/verify-channel.sh+1-2
......@@ -8,8 +8,7 @@ IFS=$'\n\t'
88
99source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
1010
11if isCiBranch auto || isCiBranch try || isCiBranch try-perf || \
12 isCiBranch automation/bors/try || isCiBranch automation/bors/auto; then
11if isCiBranch try-perf || isCiBranch automation/bors/try || isCiBranch automation/bors/auto; then
1312 echo "channel verification is only executed on PR builds"
1413 exit
1514fi
src/doc/rustc/src/platform-support/armv7-unknown-linux-uclibceabihf.md+2-2
......@@ -21,7 +21,7 @@ This target is cross compiled, and requires a cross toolchain. You can find sui
2121
2222Compiling rust for this target has been tested on `x86_64` linux hosts. Other host types have not been tested, but may work, if you can find a suitable cross compilation toolchain for them.
2323
24If you don't already have a suitable toolchain, download one [here](https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--uclibc--bleeding-edge-2021.11-1.tar.bz2), and unpack it into a directory.
24If you don't already have a suitable toolchain, download one [here](https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--uclibc--bleeding-edge-2025.08-1.tar.xz), and unpack it into a directory.
2525
2626### Configure rust
2727
......@@ -30,7 +30,7 @@ The target can be built by enabling it for a `rustc` build, by placing the follo
3030```toml
3131[build]
3232target = ["armv7-unknown-linux-uclibceabihf"]
33stage = 2
33build-stage = 2
3434
3535[target.armv7-unknown-linux-uclibceabihf]
3636# ADJUST THIS PATH TO POINT AT YOUR TOOLCHAIN
src/doc/unstable-book/src/compiler-flags/print-check-cfg.md+17-12
......@@ -9,18 +9,20 @@ This option of the `--print` flag print the list of all the expected cfgs.
99This is related to the [`--check-cfg` flag][check-cfg] which allows specifying arbitrary expected
1010names and values.
1111
12This print option works similarly to `--print=cfg` (modulo check-cfg specifics).
13
14| `--check-cfg` | `--print=check-cfg` |
15|-----------------------------------|-----------------------------|
16| `cfg(foo)` | `foo` |
17| `cfg(foo, values("bar"))` | `foo="bar"` |
18| `cfg(foo, values(none(), "bar"))` | `foo` & `foo="bar"` |
19| | *check-cfg specific syntax* |
20| `cfg(foo, values(any())` | `foo=any()` |
21| `cfg(foo, values())` | `foo=` |
22| `cfg(any())` | `any()` |
23| *none* | `any()=any()` |
12This print option outputs compatible `--check-cfg` arguments with a reduced syntax where all the
13expected values are on the same line and `values(...)` is always explicit.
14
15| `--check-cfg` | `--print=check-cfg` |
16|-----------------------------------|-----------------------------------|
17| `cfg(foo)` | `cfg(foo, values(none())) |
18| `cfg(foo, values("bar"))` | `cfg(foo, values("bar"))` |
19| `cfg(foo, values(none(), "bar"))` | `cfg(foo, values(none(), "bar"))` |
20| `cfg(foo, values(any())` | `cfg(foo, values(any())` |
21| `cfg(foo, values())` | `cfg(foo, values())` |
22| `cfg(any())` | `cfg(any())` |
23| *nothing* | *nothing* |
24
25The print option includes well known cfgs.
2426
2527To be used like this:
2628
......@@ -28,4 +30,7 @@ To be used like this:
2830rustc --print=check-cfg -Zunstable-options lib.rs
2931```
3032
33> **Note:** Users should be resilient when parsing, in particular against new predicates that
34may be added in the future.
35
3136[check-cfg]: https://doc.rust-lang.org/nightly/rustc/check-cfg.html
src/tools/compiletest/src/common.rs+17-1
......@@ -1070,11 +1070,27 @@ fn builtin_cfg_names(config: &Config) -> HashSet<String> {
10701070 Default::default(),
10711071 )
10721072 .lines()
1073 .map(|l| if let Some((name, _)) = l.split_once('=') { name.to_string() } else { l.to_string() })
1073 .map(|l| extract_cfg_name(&l).unwrap().to_string())
10741074 .chain(std::iter::once(String::from("test")))
10751075 .collect()
10761076}
10771077
1078/// Extract the cfg name from `cfg(name, values(...))` lines
1079fn extract_cfg_name(check_cfg_line: &str) -> Result<&str, &'static str> {
1080 let trimmed = check_cfg_line.trim();
1081
1082 #[rustfmt::skip]
1083 let inner = trimmed
1084 .strip_prefix("cfg(")
1085 .ok_or("missing cfg(")?
1086 .strip_suffix(")")
1087 .ok_or("missing )")?;
1088
1089 let first_comma = inner.find(',').ok_or("no comma found")?;
1090
1091 Ok(inner[..first_comma].trim())
1092}
1093
10781094pub const KNOWN_CRATE_TYPES: &[&str] =
10791095 &["bin", "cdylib", "dylib", "lib", "proc-macro", "rlib", "staticlib"];
10801096
tests/run-make/print-check-cfg/rmake.rs+36-30
......@@ -14,51 +14,55 @@ struct CheckCfg {
1414
1515enum Contains {
1616 Some { contains: &'static [&'static str], doesnt_contain: &'static [&'static str] },
17 Only(&'static str),
17 Nothing,
1818}
1919
2020fn main() {
21 check(CheckCfg { args: &[], contains: Contains::Only("any()=any()") });
21 check(CheckCfg { args: &[], contains: Contains::Nothing });
2222 check(CheckCfg {
2323 args: &["--check-cfg=cfg()"],
2424 contains: Contains::Some {
25 contains: &["unix", "miri"],
26 doesnt_contain: &["any()", "any()=any()"],
25 contains: &["cfg(unix, values(none()))", "cfg(miri, values(none()))"],
26 doesnt_contain: &["cfg(any())"],
2727 },
2828 });
2929 check(CheckCfg {
3030 args: &["--check-cfg=cfg(any())"],
3131 contains: Contains::Some {
32 contains: &["any()", "unix", r#"target_feature="crt-static""#],
32 contains: &["cfg(any())", "cfg(unix, values(none()))"],
3333 doesnt_contain: &["any()=any()"],
3434 },
3535 });
3636 check(CheckCfg {
3737 args: &["--check-cfg=cfg(feature)"],
3838 contains: Contains::Some {
39 contains: &["unix", "miri", "feature"],
40 doesnt_contain: &["any()", "any()=any()", "feature=none()", "feature="],
39 contains: &[
40 "cfg(unix, values(none()))",
41 "cfg(miri, values(none()))",
42 "cfg(feature, values(none()))",
43 ],
44 doesnt_contain: &["cfg(any())", "cfg(feature)"],
4145 },
4246 });
4347 check(CheckCfg {
4448 args: &[r#"--check-cfg=cfg(feature, values(none(), "", "test", "lol"))"#],
4549 contains: Contains::Some {
46 contains: &["feature", "feature=\"\"", "feature=\"test\"", "feature=\"lol\""],
47 doesnt_contain: &["any()", "any()=any()", "feature=none()", "feature="],
50 contains: &[r#"cfg(feature, values("", "lol", "test", none()))"#],
51 doesnt_contain: &["cfg(any())", "cfg(feature, values(none()))", "cfg(feature)"],
4852 },
4953 });
5054 check(CheckCfg {
5155 args: &["--check-cfg=cfg(feature, values())"],
5256 contains: Contains::Some {
53 contains: &["feature="],
54 doesnt_contain: &["any()", "any()=any()", "feature=none()", "feature"],
57 contains: &["cfg(feature, values())"],
58 doesnt_contain: &["cfg(any())", "cfg(feature, values(none()))", "cfg(feature)"],
5559 },
5660 });
5761 check(CheckCfg {
5862 args: &["--check-cfg=cfg(feature, values())", "--check-cfg=cfg(feature, values(none()))"],
5963 contains: Contains::Some {
60 contains: &["feature"],
61 doesnt_contain: &["any()", "any()=any()", "feature=none()", "feature="],
64 contains: &["cfg(feature, values(none()))"],
65 doesnt_contain: &["cfg(any())", "cfg(feature, values())"],
6266 },
6367 });
6468 check(CheckCfg {
......@@ -67,8 +71,8 @@ fn main() {
6771 r#"--check-cfg=cfg(feature, values("tmp"))"#,
6872 ],
6973 contains: Contains::Some {
70 contains: &["unix", "miri", "feature=any()"],
71 doesnt_contain: &["any()", "any()=any()", "feature", "feature=", "feature=\"tmp\""],
74 contains: &["cfg(feature, values(any()))"],
75 doesnt_contain: &["cfg(any())", r#"cfg(feature, values("tmp"))"#],
7276 },
7377 });
7478 check(CheckCfg {
......@@ -78,8 +82,12 @@ fn main() {
7882 r#"--check-cfg=cfg(feature, values("tmp"))"#,
7983 ],
8084 contains: Contains::Some {
81 contains: &["has_foo", "has_bar", "feature=\"tmp\""],
82 doesnt_contain: &["any()", "any()=any()", "feature"],
85 contains: &[
86 "cfg(has_foo, values(none()))",
87 "cfg(has_bar, values(none()))",
88 r#"cfg(feature, values("tmp"))"#,
89 ],
90 doesnt_contain: &["cfg(any())", "cfg(feature)"],
8391 },
8492 });
8593}
......@@ -94,16 +102,15 @@ fn check(CheckCfg { args, contains }: CheckCfg) {
94102
95103 for l in stdout.lines() {
96104 assert!(l == l.trim());
97 if let Some((left, right)) = l.split_once('=') {
98 if right != "any()" && right != "" {
99 assert!(right.starts_with("\""));
100 assert!(right.ends_with("\""));
101 }
102 assert!(!left.contains("\""));
103 } else {
104 assert!(!l.contains("\""));
105 }
106 assert!(found.insert(l.to_string()), "{}", &l);
105 assert!(l.starts_with("cfg("), "{l}");
106 assert!(l.ends_with(")"), "{l}");
107 assert_eq!(
108 l.chars().filter(|c| *c == '(').count(),
109 l.chars().filter(|c| *c == ')').count(),
110 "{l}"
111 );
112 assert!(l.chars().filter(|c| *c == '"').count() % 2 == 0, "{l}");
113 assert!(found.insert(l.to_string()), "{l}");
107114 }
108115
109116 match contains {
......@@ -131,9 +138,8 @@ fn check(CheckCfg { args, contains }: CheckCfg) {
131138 );
132139 }
133140 }
134 Contains::Only(only) => {
135 assert!(found.contains(&only.to_string()), "{:?} != {:?}", &only, &found);
136 assert!(found.len() == 1, "len: {}, instead of 1", found.len());
141 Contains::Nothing => {
142 assert!(found.len() == 0, "len: {}, instead of 0", found.len());
137143 }
138144 }
139145}
tests/rustdoc-gui/notable-trait.goml+2-2
......@@ -250,7 +250,7 @@ set-window-size: (1100, 600)
250250reload:
251251assert-count: ("//*[@class='tooltip popover']", 0)
252252click: "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']"
253assert-count: ("//*[@class='tooltip popover']", 1)
253wait-for-count: ("//*[@class='tooltip popover']", 1)
254254call-function: ("open-settings-menu", {})
255assert-count: ("//*[@class='tooltip popover']", 0)
255wait-for-count: ("//*[@class='tooltip popover']", 0)
256256assert-false: "#method\.create_an_iterator_from_read .tooltip:focus"
tests/ui/associated-types/substs-ppaux.normal.stderr+1-1
......@@ -88,7 +88,7 @@ note: required for `str` to implement `Foo<'_, '_, u8>`
8888LL | impl<'a, 'b, T, S> Foo<'a, 'b, S> for T {}
8989 | - ^^^^^^^^^^^^^^ ^
9090 | |
91 | unsatisfied trait bound introduced here
91 | unsatisfied trait bound implicitly introduced here
9292
9393error: aborting due to 5 previous errors
9494
tests/ui/associated-types/substs-ppaux.verbose.stderr+1-1
......@@ -88,7 +88,7 @@ note: required for `str` to implement `Foo<'?0, '?1, u8>`
8888LL | impl<'a, 'b, T, S> Foo<'a, 'b, S> for T {}
8989 | - ^^^^^^^^^^^^^^ ^
9090 | |
91 | unsatisfied trait bound introduced here
91 | unsatisfied trait bound implicitly introduced here
9292
9393error: aborting due to 5 previous errors
9494
tests/ui/const-generics/mgca/array-expr-type-mismatch-in-where-bound.rs created+21
......@@ -0,0 +1,21 @@
1//! regression test for <https://github.com/rust-lang/rust/issues/151024>
2#![feature(min_generic_const_args)]
3#![feature(adt_const_params)]
4#![expect(incomplete_features)]
5
6trait Trait1<const N: usize> {}
7trait Trait2<const N: [u8; 3]> {}
8
9fn foo<T>()
10where
11 T: Trait1<{ [] }>, //~ ERROR: expected `usize`, found const array
12{
13}
14
15fn bar<T>()
16where
17 T: Trait2<3>, //~ ERROR: mismatched types
18{
19}
20
21fn main() {}
tests/ui/const-generics/mgca/array-expr-type-mismatch-in-where-bound.stderr created+15
......@@ -0,0 +1,15 @@
1error: expected `usize`, found const array
2 --> $DIR/array-expr-type-mismatch-in-where-bound.rs:11:17
3 |
4LL | T: Trait1<{ [] }>,
5 | ^^
6
7error[E0308]: mismatched types
8 --> $DIR/array-expr-type-mismatch-in-where-bound.rs:17:15
9 |
10LL | T: Trait2<3>,
11 | ^ expected `[u8; 3]`, found integer
12
13error: aborting due to 2 previous errors
14
15For more information about this error, try `rustc --explain E0308`.
tests/ui/eii/type_checking/generic_implementation.rs created+13
......@@ -0,0 +1,13 @@
1//@ check-fail
2// Check that type parameters on EIIs are properly rejected.
3// Specifically a regression test for https://github.com/rust-lang/rust/issues/149983.
4#![feature(extern_item_impls)]
5
6#[eii]
7fn foo();
8
9#[foo]
10fn foo_impl<T>() {}
11//~^ ERROR `foo_impl` cannot have generic parameters other than lifetimes
12
13fn main() {}
tests/ui/eii/type_checking/generic_implementation.stderr created+12
......@@ -0,0 +1,12 @@
1error: `foo_impl` cannot have generic parameters other than lifetimes
2 --> $DIR/generic_implementation.rs:10:1
3 |
4LL | #[foo]
5 | ------ required by this attribute
6LL | fn foo_impl<T>() {}
7 | ^^^^^^^^^^^^^^^^
8 |
9 = help: `#[foo]` marks the implementation of an "externally implementable item"
10
11error: aborting due to 1 previous error
12
tests/ui/eii/type_checking/type_params_149983.rs created+10
......@@ -0,0 +1,10 @@
1//@ check-fail
2// Check that type parameters on EIIs are properly rejected.
3// Specifically a regression test for https://github.com/rust-lang/rust/issues/149983.
4#![feature(extern_item_impls)]
5
6#[eii]
7fn foo<T>() {}
8//~^ ERROR externally implementable items may not have type parameters
9
10fn main() {}
tests/ui/eii/type_checking/type_params_149983.stderr created+11
......@@ -0,0 +1,11 @@
1error[E0044]: externally implementable items may not have type parameters
2 --> $DIR/type_params_149983.rs:7:1
3 |
4LL | fn foo<T>() {}
5 | ^^^^^^^^^^^ can't have type parameters
6 |
7 = help: replace the type parameters with concrete types like `u32`
8
9error: aborting due to 1 previous error
10
11For more information about this error, try `rustc --explain E0044`.
tests/ui/error-codes/E0277-4.rs created+50
......@@ -0,0 +1,50 @@
1use std::fmt::Display;
2
3trait ImplicitTrait {
4 fn foo(&self);
5}
6
7trait ExplicitTrait {
8 fn foo(&self);
9}
10
11trait DisplayTrait {
12 fn foo(&self);
13}
14
15trait UnimplementedTrait {
16 fn foo(&self);
17}
18
19// Implicitly requires `T: Sized`.
20impl<T> ImplicitTrait for T {
21 fn foo(&self) {}
22}
23
24// Explicitly requires `T: Sized`.
25impl<T: Sized> ExplicitTrait for T {
26 fn foo(&self) {}
27}
28
29// Requires `T: Display`.
30impl<T: Display> DisplayTrait for T {
31 fn foo(&self) {}
32}
33
34fn main() {
35 // `[u8]` does not implement `Sized`.
36 let x: &[u8] = &[];
37 ImplicitTrait::foo(x);
38 //~^ ERROR: the trait bound `[u8]: ImplicitTrait` is not satisfied [E0277]
39 ExplicitTrait::foo(x);
40 //~^ ERROR: the trait bound `[u8]: ExplicitTrait` is not satisfied [E0277]
41
42 // `UnimplementedTrait` has no implementations.
43 UnimplementedTrait::foo(x);
44 //~^ ERROR: the trait bound `[u8]: UnimplementedTrait` is not satisfied [E0277]
45
46 // `[u8; 0]` implements `Sized` but not `Display`.
47 let x: &[u8; 0] = &[];
48 DisplayTrait::foo(x);
49 //~^ ERROR: the trait bound `[u8; 0]: DisplayTrait` is not satisfied [E0277]
50}
tests/ui/error-codes/E0277-4.stderr created+77
......@@ -0,0 +1,77 @@
1error[E0277]: the trait bound `[u8]: ImplicitTrait` is not satisfied
2 --> $DIR/E0277-4.rs:37:24
3 |
4LL | ImplicitTrait::foo(x);
5 | ------------------ ^ the trait `Sized` is not implemented for `[u8]`
6 | |
7 | required by a bound introduced by this call
8 |
9note: required for `[u8]` to implement `ImplicitTrait`
10 --> $DIR/E0277-4.rs:20:9
11 |
12LL | impl<T> ImplicitTrait for T {
13 | - ^^^^^^^^^^^^^ ^
14 | |
15 | unsatisfied trait bound implicitly introduced here
16help: consider borrowing here
17 |
18LL | ImplicitTrait::foo(&x);
19 | +
20LL | ImplicitTrait::foo(&mut x);
21 | ++++
22
23error[E0277]: the trait bound `[u8]: ExplicitTrait` is not satisfied
24 --> $DIR/E0277-4.rs:39:24
25 |
26LL | ExplicitTrait::foo(x);
27 | ------------------ ^ the trait `Sized` is not implemented for `[u8]`
28 | |
29 | required by a bound introduced by this call
30 |
31note: required for `[u8]` to implement `ExplicitTrait`
32 --> $DIR/E0277-4.rs:25:16
33 |
34LL | impl<T: Sized> ExplicitTrait for T {
35 | ----- ^^^^^^^^^^^^^ ^
36 | |
37 | unsatisfied trait bound introduced here
38help: consider borrowing here
39 |
40LL | ExplicitTrait::foo(&x);
41 | +
42LL | ExplicitTrait::foo(&mut x);
43 | ++++
44
45error[E0277]: the trait bound `[u8]: UnimplementedTrait` is not satisfied
46 --> $DIR/E0277-4.rs:43:29
47 |
48LL | UnimplementedTrait::foo(x);
49 | ----------------------- ^ the trait `UnimplementedTrait` is not implemented for `[u8]`
50 | |
51 | required by a bound introduced by this call
52 |
53help: this trait has no implementations, consider adding one
54 --> $DIR/E0277-4.rs:15:1
55 |
56LL | trait UnimplementedTrait {
57 | ^^^^^^^^^^^^^^^^^^^^^^^^
58
59error[E0277]: the trait bound `[u8; 0]: DisplayTrait` is not satisfied
60 --> $DIR/E0277-4.rs:48:23
61 |
62LL | DisplayTrait::foo(x);
63 | ----------------- ^ the trait `std::fmt::Display` is not implemented for `[u8; 0]`
64 | |
65 | required by a bound introduced by this call
66 |
67note: required for `[u8; 0]` to implement `DisplayTrait`
68 --> $DIR/E0277-4.rs:30:18
69 |
70LL | impl<T: Display> DisplayTrait for T {
71 | ------- ^^^^^^^^^^^^ ^
72 | |
73 | unsatisfied trait bound introduced here
74
75error: aborting due to 4 previous errors
76
77For more information about this error, try `rustc --explain E0277`.
tests/ui/recursion/issue-23122-2.stderr+1-1
......@@ -11,7 +11,7 @@ note: required for `GetNext<<<<... as Next>::Next as Next>::Next as Next>::Next>
1111LL | impl<T: Next> Next for GetNext<T> {
1212 | - ^^^^ ^^^^^^^^^^
1313 | |
14 | unsatisfied trait bound introduced here
14 | unsatisfied trait bound implicitly introduced here
1515 = note: the full name for the type has been written to '$TEST_BUILD_DIR/issue-23122-2.long-type-$LONG_TYPE_HASH.txt'
1616 = note: consider using `--verbose` to print the full type name to the console
1717
tests/ui/reflection/dump.rs+3
......@@ -22,9 +22,12 @@ struct Unsized {
2222
2323fn main() {
2424 println!("{:#?}", const { Type::of::<(u8, u8, ())>() }.kind);
25 println!("{:#?}", const { Type::of::<[u8; 2]>() }.kind);
2526 println!("{:#?}", const { Type::of::<Foo>() }.kind);
2627 println!("{:#?}", const { Type::of::<Bar>() }.kind);
2728 println!("{:#?}", const { Type::of::<&Unsized>() }.kind);
2829 println!("{:#?}", const { Type::of::<&str>() }.kind);
2930 println!("{:#?}", const { Type::of::<&[u8]>() }.kind);
31 println!("{:#?}", const { Type::of::<str>() }.kind);
32 println!("{:#?}", const { Type::of::<[u8]>() }.kind);
3033}
tests/ui/reflection/dump.run.stdout+8
......@@ -16,6 +16,14 @@ Tuple(
1616 ],
1717 },
1818)
19Array(
20 Array {
21 element_ty: TypeId(0x0596b48cc04376e64d5c788c2aa46bdb),
22 len: 2,
23 },
24)
25Other
26Other
1927Other
2028Other
2129Other
tests/ui/reflection/tuples.rs deleted-36
......@@ -1,36 +0,0 @@
1#![feature(type_info)]
2
3//@ run-pass
4
5use std::mem::type_info::{Type, TypeKind};
6
7fn assert_tuple_arity<T: 'static, const N: usize>() {
8 const {
9 match &Type::of::<T>().kind {
10 TypeKind::Tuple(tup) => {
11 assert!(tup.fields.len() == N);
12 }
13 _ => unreachable!(),
14 }
15 }
16}
17
18fn main() {
19 assert_tuple_arity::<(), 0>();
20 assert_tuple_arity::<(u8,), 1>();
21 assert_tuple_arity::<(u8, u8), 2>();
22 const {
23 match &Type::of::<(u8, u8)>().kind {
24 TypeKind::Tuple(tup) => {
25 let [a, b] = tup.fields else { unreachable!() };
26 assert!(a.offset == 0);
27 assert!(b.offset == 1);
28 match (&a.ty.info().kind, &b.ty.info().kind) {
29 (TypeKind::Leaf, TypeKind::Leaf) => {}
30 _ => unreachable!(),
31 }
32 }
33 _ => unreachable!(),
34 }
35 }
36}
tests/ui/resolve/decl-macro-use-no-ice.rs created+20
......@@ -0,0 +1,20 @@
1//@ edition: 2024
2#![feature(decl_macro)]
3
4// Regression test for issue <https://github.com/rust-lang/rust/issues/150711>
5// The compiler previously ICE'd during identifier resolution
6// involving `macro` items and `use` inside a public macro.
7
8
9mod foo {
10 macro f() {}
11
12 pub macro m() {
13 use f; //~ ERROR `f` is private, and cannot be re-exported
14 f!(); //~ ERROR macro import `f` is private
15 }
16}
17
18fn main() {
19 foo::m!();
20}
tests/ui/resolve/decl-macro-use-no-ice.stderr created+47
......@@ -0,0 +1,47 @@
1error[E0364]: `f` is private, and cannot be re-exported
2 --> $DIR/decl-macro-use-no-ice.rs:13:13
3 |
4LL | use f;
5 | ^
6...
7LL | foo::m!();
8 | --------- in this macro invocation
9 |
10note: consider marking `f` as `pub` in the imported module
11 --> $DIR/decl-macro-use-no-ice.rs:13:13
12 |
13LL | use f;
14 | ^
15...
16LL | foo::m!();
17 | --------- in this macro invocation
18 = note: this error originates in the macro `foo::m` (in Nightly builds, run with -Z macro-backtrace for more info)
19
20error[E0603]: macro import `f` is private
21 --> $DIR/decl-macro-use-no-ice.rs:14:9
22 |
23LL | f!();
24 | ^ private macro import
25...
26LL | foo::m!();
27 | --------- in this macro invocation
28 |
29note: the macro import `f` is defined here...
30 --> $DIR/decl-macro-use-no-ice.rs:13:13
31 |
32LL | use f;
33 | ^
34...
35LL | foo::m!();
36 | --------- in this macro invocation
37note: ...and refers to the macro `f` which is defined here
38 --> $DIR/decl-macro-use-no-ice.rs:10:5
39 |
40LL | macro f() {}
41 | ^^^^^^^^^
42 = note: this error originates in the macro `foo::m` (in Nightly builds, run with -Z macro-backtrace for more info)
43
44error: aborting due to 2 previous errors
45
46Some errors have detailed explanations: E0364, E0603.
47For more information about an error, try `rustc --explain E0364`.
tests/ui/suggestions/slice-issue-87994.stderr+4-6
......@@ -17,11 +17,10 @@ error[E0277]: `[i32]` is not an iterator
1717 --> $DIR/slice-issue-87994.rs:3:12
1818 |
1919LL | for _ in v[1..] {
20 | ^^^^^^ the trait `IntoIterator` is not implemented for `[i32]`
20 | ^^^^^^ the trait `Sized` is not implemented for `[i32]`
2121 |
22 = note: the trait bound `[i32]: IntoIterator` is not satisfied
22 = note: the trait bound `Sized` is not satisfied
2323 = note: required for `[i32]` to implement `IntoIterator`
24 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2524help: consider borrowing here
2625 |
2726LL | for _ in &v[1..] {
......@@ -48,11 +47,10 @@ error[E0277]: `[K]` is not an iterator
4847 --> $DIR/slice-issue-87994.rs:11:13
4948 |
5049LL | for i2 in v2[1..] {
51 | ^^^^^^^ the trait `IntoIterator` is not implemented for `[K]`
50 | ^^^^^^^ the trait `Sized` is not implemented for `[K]`
5251 |
53 = note: the trait bound `[K]: IntoIterator` is not satisfied
52 = note: the trait bound `Sized` is not satisfied
5453 = note: required for `[K]` to implement `IntoIterator`
55 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
5654help: consider borrowing here
5755 |
5856LL | for i2 in &v2[1..] {
tests/ui/traits/dyn-iterator-deref-in-for-loop.current.stderr+2-2
......@@ -2,9 +2,9 @@ error[E0277]: `dyn Iterator<Item = &'a mut u8>` is not an iterator
22 --> $DIR/dyn-iterator-deref-in-for-loop.rs:9:17
33 |
44LL | for item in *things {
5 | ^^^^^^^ the trait `IntoIterator` is not implemented for `dyn Iterator<Item = &'a mut u8>`
5 | ^^^^^^^ the trait `Sized` is not implemented for `dyn Iterator<Item = &'a mut u8>`
66 |
7 = note: the trait bound `dyn Iterator<Item = &'a mut u8>: IntoIterator` is not satisfied
7 = note: the trait bound `Sized` is not satisfied
88 = note: required for `dyn Iterator<Item = &'a mut u8>` to implement `IntoIterator`
99help: consider mutably borrowing here
1010 |
tests/ui/traits/dyn-iterator-deref-in-for-loop.next.stderr+2-2
......@@ -2,9 +2,9 @@ error[E0277]: `dyn Iterator<Item = &'a mut u8>` is not an iterator
22 --> $DIR/dyn-iterator-deref-in-for-loop.rs:9:17
33 |
44LL | for item in *things {
5 | ^^^^^^^ the trait `IntoIterator` is not implemented for `dyn Iterator<Item = &'a mut u8>`
5 | ^^^^^^^ the trait `Sized` is not implemented for `dyn Iterator<Item = &'a mut u8>`
66 |
7 = note: the trait bound `dyn Iterator<Item = &'a mut u8>: IntoIterator` is not satisfied
7 = note: the trait bound `Sized` is not satisfied
88 = note: required for `dyn Iterator<Item = &'a mut u8>` to implement `IntoIterator`
99help: consider mutably borrowing here
1010 |
tests/ui/traits/issue-18400.stderr+1-1
......@@ -11,7 +11,7 @@ note: required for `{integer}` to implement `Set<&[_]>`
1111LL | impl<'a, T, S> Set<&'a [T]> for S where
1212 | - ^^^^^^^^^^^^ ^
1313 | |
14 | unsatisfied trait bound introduced here
14 | unsatisfied trait bound implicitly introduced here
1515 = note: 128 redundant requirements hidden
1616 = note: required for `{integer}` to implement `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>`
1717
triagebot.toml+8
......@@ -332,6 +332,14 @@ trigger_labels = [
332332 "A-type-based-search",
333333]
334334
335[autolabel."A-rustdoc-js"]
336trigger_files = [
337 "src/librustdoc/html/static/js/",
338 "src/librustdoc/html/static/css/",
339 "tests/rustdoc-js/",
340 "tests/rustdoc-js-std/",
341]
342
335343[autolabel."T-compiler"]
336344trigger_files = [
337345 # Source code