| author | bors <bors@rust-lang.org> 2026-01-14 03:26:31 UTC |
| committer | bors <bors@rust-lang.org> 2026-01-14 03:26:31 UTC |
| log | 4931e09e3ac3182d2a00f38cccfdf68e8e385e1c |
| tree | 9bbc5ceae114b09da0e5dde3902cfb3bd8779c3b |
| parent | fcac501a73cdde54de46a0683567f1a890730555 |
| parent | 3adbd3ae4e12dcd0a3f0f68e887fea71f4ba00d5 |
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? @ghost52 files changed, 728 insertions(+), 175 deletions(-)
.github/workflows/ci.yml+9-10| ... | ... | @@ -11,11 +11,9 @@ name: CI |
| 11 | 11 | on: |
| 12 | 12 | push: |
| 13 | 13 | branches: |
| 14 | - auto | |
| 15 | - try | |
| 16 | - try-perf | |
| 17 | - automation/bors/try | |
| 18 | 14 | - automation/bors/auto |
| 15 | - automation/bors/try | |
| 16 | - try-perf | |
| 19 | 17 | pull_request: |
| 20 | 18 | branches: |
| 21 | 19 | - "**" |
| ... | ... | @@ -33,9 +31,10 @@ defaults: |
| 33 | 31 | |
| 34 | 32 | concurrency: |
| 35 | 33 | # 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 }} | |
| 39 | 38 | cancel-in-progress: true |
| 40 | 39 | env: |
| 41 | 40 | TOOLSTATE_REPO: "https://github.com/rust-lang-nursery/rust-toolstate" |
| ... | ... | @@ -57,7 +56,7 @@ jobs: |
| 57 | 56 | - name: Test citool |
| 58 | 57 | # Only test citool on the auto branch, to reduce latency of the calculate matrix job |
| 59 | 58 | # 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' }} | |
| 61 | 60 | run: | |
| 62 | 61 | cd src/ci/citool |
| 63 | 62 | CARGO_INCREMENTAL=0 cargo test |
| ... | ... | @@ -80,7 +79,7 @@ jobs: |
| 80 | 79 | # access the environment. |
| 81 | 80 | # |
| 82 | 81 | # 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') || '' }} | |
| 84 | 83 | env: |
| 85 | 84 | CI_JOB_NAME: ${{ matrix.name }} |
| 86 | 85 | CI_JOB_DOC_URL: ${{ matrix.doc_url }} |
| ... | ... | @@ -314,7 +313,7 @@ jobs: |
| 314 | 313 | needs: [ calculate_matrix, job ] |
| 315 | 314 | # !cancelled() executes the job regardless of whether the previous jobs passed or failed |
| 316 | 315 | 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') || '' }} | |
| 318 | 317 | steps: |
| 319 | 318 | - name: checkout the source code |
| 320 | 319 | uses: actions/checkout@v5 |
compiler/rustc_attr_parsing/src/attributes/mod.rs+1| ... | ... | @@ -57,6 +57,7 @@ pub(crate) mod pin_v2; |
| 57 | 57 | pub(crate) mod proc_macro_attrs; |
| 58 | 58 | pub(crate) mod prototype; |
| 59 | 59 | pub(crate) mod repr; |
| 60 | pub(crate) mod rustc_dump; | |
| 60 | 61 | pub(crate) mod rustc_internal; |
| 61 | 62 | pub(crate) mod semantics; |
| 62 | 63 | pub(crate) mod stability; |
compiler/rustc_attr_parsing/src/attributes/rustc_dump.rs created+62| ... | ... | @@ -0,0 +1,62 @@ |
| 1 | use rustc_hir::Target; | |
| 2 | use rustc_hir::attrs::AttributeKind; | |
| 3 | use rustc_span::{Span, Symbol, sym}; | |
| 4 | ||
| 5 | use crate::attributes::prelude::Allow; | |
| 6 | use crate::attributes::{NoArgsAttributeParser, OnDuplicate}; | |
| 7 | use crate::context::Stage; | |
| 8 | use crate::target_checking::AllowedTargets; | |
| 9 | ||
| 10 | pub(crate) struct RustcDumpUserArgs; | |
| 11 | ||
| 12 | impl<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 | ||
| 19 | pub(crate) struct RustcDumpDefParents; | |
| 20 | ||
| 21 | impl<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 | ||
| 28 | pub(crate) struct RustcDumpItemBounds; | |
| 29 | ||
| 30 | impl<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 | ||
| 37 | pub(crate) struct RustcDumpPredicates; | |
| 38 | ||
| 39 | impl<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 | ||
| 52 | pub(crate) struct RustcDumpVtable; | |
| 53 | ||
| 54 | impl<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::{ |
| 63 | 63 | }; |
| 64 | 64 | use crate::attributes::prototype::CustomMirParser; |
| 65 | 65 | use crate::attributes::repr::{AlignParser, AlignStaticParser, ReprParser}; |
| 66 | use crate::attributes::rustc_dump::{ | |
| 67 | RustcDumpDefParents, RustcDumpItemBounds, RustcDumpPredicates, RustcDumpUserArgs, | |
| 68 | RustcDumpVtable, | |
| 69 | }; | |
| 66 | 70 | use crate::attributes::rustc_internal::{ |
| 67 | 71 | RustcHasIncoherentInherentImplsParser, RustcLayoutScalarValidRangeEndParser, |
| 68 | 72 | RustcLayoutScalarValidRangeStartParser, RustcLegacyConstGenericsParser, |
| ... | ... | @@ -267,6 +271,11 @@ attribute_parsers!( |
| 267 | 271 | Single<WithoutArgs<ProcMacroParser>>, |
| 268 | 272 | Single<WithoutArgs<PubTransparentParser>>, |
| 269 | 273 | Single<WithoutArgs<RustcCoherenceIsCoreParser>>, |
| 274 | Single<WithoutArgs<RustcDumpDefParents>>, | |
| 275 | Single<WithoutArgs<RustcDumpItemBounds>>, | |
| 276 | Single<WithoutArgs<RustcDumpPredicates>>, | |
| 277 | Single<WithoutArgs<RustcDumpUserArgs>>, | |
| 278 | Single<WithoutArgs<RustcDumpVtable>>, | |
| 270 | 279 | Single<WithoutArgs<RustcHasIncoherentInherentImplsParser>>, |
| 271 | 280 | Single<WithoutArgs<RustcLintDiagnosticsParser>>, |
| 272 | 281 | Single<WithoutArgs<RustcLintOptTyParser>>, |
compiler/rustc_const_eval/src/const_eval/type_info.rs+33-2| ... | ... | @@ -3,7 +3,7 @@ use rustc_hir::LangItem; |
| 3 | 3 | use rustc_middle::mir::interpret::CtfeProvenance; |
| 4 | 4 | use rustc_middle::span_bug; |
| 5 | 5 | use rustc_middle::ty::layout::TyAndLayout; |
| 6 | use rustc_middle::ty::{self, ScalarInt, Ty}; | |
| 6 | use rustc_middle::ty::{self, Const, ScalarInt, Ty}; | |
| 7 | 7 | use rustc_span::{Symbol, sym}; |
| 8 | 8 | |
| 9 | 9 | use crate::const_eval::CompileTimeMachine; |
| ... | ... | @@ -56,6 +56,14 @@ impl<'tcx> InterpCx<'tcx, CompileTimeMachine<'tcx>> { |
| 56 | 56 | self.write_tuple_fields(tuple_place, fields, ty)?; |
| 57 | 57 | variant |
| 58 | 58 | } |
| 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 | } | |
| 59 | 67 | // For now just merge all primitives into one `Leaf` variant with no data |
| 60 | 68 | ty::Uint(_) | ty::Int(_) | ty::Float(_) | ty::Char | ty::Bool => { |
| 61 | 69 | downcast(sym::Leaf)?.0 |
| ... | ... | @@ -63,7 +71,6 @@ impl<'tcx> InterpCx<'tcx, CompileTimeMachine<'tcx>> { |
| 63 | 71 | ty::Adt(_, _) |
| 64 | 72 | | ty::Foreign(_) |
| 65 | 73 | | ty::Str |
| 66 | | ty::Array(_, _) | |
| 67 | 74 | | ty::Pat(_, _) |
| 68 | 75 | | ty::Slice(_) |
| 69 | 76 | | ty::RawPtr(..) |
| ... | ... | @@ -172,4 +179,28 @@ impl<'tcx> InterpCx<'tcx, CompileTimeMachine<'tcx>> { |
| 172 | 179 | } |
| 173 | 180 | interp_ok(()) |
| 174 | 181 | } |
| 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 | } | |
| 175 | 206 | } |
compiler/rustc_driver_impl/src/lib.rs+20-15| ... | ... | @@ -765,30 +765,35 @@ fn print_crate_info( |
| 765 | 765 | for (name, expected_values) in &sess.psess.check_config.expecteds { |
| 766 | 766 | use crate::config::ExpectedValues; |
| 767 | 767 | 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 | } | |
| 769 | 771 | 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| { | |
| 772 | 775 | if let Some(value) = value { |
| 773 | format!("{name}=\"{value}\"") | |
| 776 | format!("\"{value}\"") | |
| 774 | 777 | } else { |
| 775 | name.to_string() | |
| 778 | "none()".to_string() | |
| 776 | 779 | } |
| 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}))")) | |
| 781 | 788 | } |
| 782 | 789 | } |
| 783 | 790 | } |
| 784 | 791 | |
| 785 | 792 | 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())"); | |
| 792 | 797 | } |
| 793 | 798 | for check_cfg in check_cfgs { |
| 794 | 799 | println_info!("{check_cfg}"); |
compiler/rustc_hir/src/attrs/data_structures.rs+15| ... | ... | @@ -906,6 +906,21 @@ pub enum AttributeKind { |
| 906 | 906 | /// Represents `#[rustc_coherence_is_core]` |
| 907 | 907 | RustcCoherenceIsCore(Span), |
| 908 | 908 | |
| 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 | ||
| 909 | 924 | /// Represents `#[rustc_has_incoherent_inherent_impls]` |
| 910 | 925 | RustcHasIncoherentInherentImpls, |
| 911 | 926 |
compiler/rustc_hir/src/attrs/encode_cross_crate.rs+5| ... | ... | @@ -97,6 +97,11 @@ impl AttributeKind { |
| 97 | 97 | Repr { .. } => No, |
| 98 | 98 | RustcBuiltinMacro { .. } => Yes, |
| 99 | 99 | RustcCoherenceIsCore(..) => No, |
| 100 | RustcDumpDefParents => No, | |
| 101 | RustcDumpItemBounds => No, | |
| 102 | RustcDumpPredicates => No, | |
| 103 | RustcDumpUserArgs => No, | |
| 104 | RustcDumpVtable(..) => No, | |
| 100 | 105 | RustcHasIncoherentInherentImpls => Yes, |
| 101 | 106 | RustcLayoutScalarValidRangeEnd(..) => Yes, |
| 102 | 107 | RustcLayoutScalarValidRangeStart(..) => Yes, |
compiler/rustc_hir_analysis/messages.ftl+2-1| ... | ... | @@ -166,8 +166,9 @@ hir_analysis_duplicate_precise_capture = cannot capture parameter `{$name}` twic |
| 166 | 166 | .label = parameter captured again here |
| 167 | 167 | |
| 168 | 168 | hir_analysis_eii_with_generics = |
| 169 | #[{$eii_name}] cannot have generic parameters other than lifetimes | |
| 169 | `{$impl_name}` cannot have generic parameters other than lifetimes | |
| 170 | 170 | .label = required by this attribute |
| 171 | .help = `#[{$eii_name}]` marks the implementation of an "externally implementable item" | |
| 171 | 172 | |
| 172 | 173 | hir_analysis_empty_specialization = specialization impl does not specialize any associated items |
| 173 | 174 | .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<(), |
| 974 | 974 | (0, _) => ("const", "consts", None), |
| 975 | 975 | _ => ("type or const", "types or consts", None), |
| 976 | 976 | }; |
| 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 | ||
| 977 | 984 | let span = tcx.def_span(def_id); |
| 978 | 985 | struct_span_code_err!( |
| 979 | 986 | tcx.dcx(), |
| 980 | 987 | span, |
| 981 | 988 | E0044, |
| 982 | "foreign items may not have {kinds} parameters", | |
| 989 | "{name} may not have {kinds} parameters", | |
| 983 | 990 | ) |
| 984 | 991 | .with_span_label(span, format!("can't have {kinds} parameters")) |
| 985 | 992 | .with_help( |
compiler/rustc_hir_analysis/src/check/compare_eii.rs+15-2| ... | ... | @@ -8,8 +8,9 @@ use std::iter; |
| 8 | 8 | |
| 9 | 9 | use rustc_data_structures::fx::FxIndexSet; |
| 10 | 10 | use rustc_errors::{Applicability, E0806, struct_span_code_err}; |
| 11 | use rustc_hir::attrs::{AttributeKind, EiiImplResolution}; | |
| 11 | 12 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| 12 | use rustc_hir::{self as hir, FnSig, HirId, ItemKind}; | |
| 13 | use rustc_hir::{self as hir, FnSig, HirId, ItemKind, find_attr}; | |
| 13 | 14 | use rustc_infer::infer::{self, InferCtxt, TyCtxtInferExt}; |
| 14 | 15 | use rustc_infer::traits::{ObligationCause, ObligationCauseCode}; |
| 15 | 16 | use rustc_middle::ty::error::{ExpectedFound, TypeError}; |
| ... | ... | @@ -169,11 +170,23 @@ fn check_no_generics<'tcx>( |
| 169 | 170 | eii_attr_span: Span, |
| 170 | 171 | ) -> Result<(), ErrorGuaranteed> { |
| 171 | 172 | 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 | { | |
| 173 | 185 | tcx.dcx().emit_err(EiiWithGenerics { |
| 174 | 186 | span: tcx.def_span(external_impl), |
| 175 | 187 | attr: eii_attr_span, |
| 176 | 188 | eii_name, |
| 189 | impl_name: tcx.item_name(external_impl), | |
| 177 | 190 | }); |
| 178 | 191 | } |
| 179 | 192 |
compiler/rustc_hir_analysis/src/collect/dump.rs+15-13| ... | ... | @@ -1,6 +1,7 @@ |
| 1 | 1 | use rustc_hir as hir; |
| 2 | use rustc_hir::attrs::AttributeKind; | |
| 2 | 3 | use rustc_hir::def_id::{CRATE_DEF_ID, LocalDefId}; |
| 3 | use rustc_hir::intravisit; | |
| 4 | use rustc_hir::{find_attr, intravisit}; | |
| 4 | 5 | use rustc_middle::hir::nested_filter; |
| 5 | 6 | use rustc_middle::ty::{self, TyCtxt, TypeVisitableExt}; |
| 6 | 7 | use rustc_span::sym; |
| ... | ... | @@ -28,7 +29,7 @@ pub(crate) fn opaque_hidden_types(tcx: TyCtxt<'_>) { |
| 28 | 29 | |
| 29 | 30 | pub(crate) fn predicates_and_item_bounds(tcx: TyCtxt<'_>) { |
| 30 | 31 | 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) { | |
| 32 | 33 | let preds = tcx.predicates_of(id).instantiate_identity(tcx).predicates; |
| 33 | 34 | let span = tcx.def_span(id); |
| 34 | 35 | |
| ... | ... | @@ -38,7 +39,7 @@ pub(crate) fn predicates_and_item_bounds(tcx: TyCtxt<'_>) { |
| 38 | 39 | } |
| 39 | 40 | diag.emit(); |
| 40 | 41 | } |
| 41 | if tcx.has_attr(id, sym::rustc_dump_item_bounds) { | |
| 42 | if find_attr!(tcx.get_all_attrs(id), AttributeKind::RustcDumpItemBounds) { | |
| 42 | 43 | let bounds = tcx.item_bounds(id).instantiate_identity(); |
| 43 | 44 | let span = tcx.def_span(id); |
| 44 | 45 | |
| ... | ... | @@ -54,7 +55,7 @@ pub(crate) fn predicates_and_item_bounds(tcx: TyCtxt<'_>) { |
| 54 | 55 | pub(crate) fn def_parents(tcx: TyCtxt<'_>) { |
| 55 | 56 | for iid in tcx.hir_free_items() { |
| 56 | 57 | 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) { | |
| 58 | 59 | struct AnonConstFinder<'tcx> { |
| 59 | 60 | tcx: TyCtxt<'tcx>, |
| 60 | 61 | anon_consts: Vec<LocalDefId>, |
| ... | ... | @@ -102,7 +103,9 @@ pub(crate) fn vtables<'tcx>(tcx: TyCtxt<'tcx>) { |
| 102 | 103 | for id in tcx.hir_free_items() { |
| 103 | 104 | let def_id = id.owner_id.def_id; |
| 104 | 105 | |
| 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 { | |
| 106 | 109 | continue; |
| 107 | 110 | }; |
| 108 | 111 | |
| ... | ... | @@ -111,14 +114,14 @@ pub(crate) fn vtables<'tcx>(tcx: TyCtxt<'tcx>) { |
| 111 | 114 | let trait_ref = tcx.impl_trait_ref(def_id).instantiate_identity(); |
| 112 | 115 | if trait_ref.has_non_region_param() { |
| 113 | 116 | tcx.dcx().span_err( |
| 114 | attr.span(), | |
| 117 | attr_span, | |
| 115 | 118 | "`rustc_dump_vtable` must be applied to non-generic impl", |
| 116 | 119 | ); |
| 117 | 120 | continue; |
| 118 | 121 | } |
| 119 | 122 | if !tcx.is_dyn_compatible(trait_ref.def_id) { |
| 120 | 123 | tcx.dcx().span_err( |
| 121 | attr.span(), | |
| 124 | attr_span, | |
| 122 | 125 | "`rustc_dump_vtable` must be applied to dyn-compatible trait", |
| 123 | 126 | ); |
| 124 | 127 | continue; |
| ... | ... | @@ -127,7 +130,7 @@ pub(crate) fn vtables<'tcx>(tcx: TyCtxt<'tcx>) { |
| 127 | 130 | .try_normalize_erasing_regions(ty::TypingEnv::fully_monomorphized(), trait_ref) |
| 128 | 131 | else { |
| 129 | 132 | tcx.dcx().span_err( |
| 130 | attr.span(), | |
| 133 | attr_span, | |
| 131 | 134 | "`rustc_dump_vtable` applied to impl header that cannot be normalized", |
| 132 | 135 | ); |
| 133 | 136 | continue; |
| ... | ... | @@ -138,7 +141,7 @@ pub(crate) fn vtables<'tcx>(tcx: TyCtxt<'tcx>) { |
| 138 | 141 | let ty = tcx.type_of(def_id).instantiate_identity(); |
| 139 | 142 | if ty.has_non_region_param() { |
| 140 | 143 | tcx.dcx().span_err( |
| 141 | attr.span(), | |
| 144 | attr_span, | |
| 142 | 145 | "`rustc_dump_vtable` must be applied to non-generic type", |
| 143 | 146 | ); |
| 144 | 147 | continue; |
| ... | ... | @@ -147,14 +150,13 @@ pub(crate) fn vtables<'tcx>(tcx: TyCtxt<'tcx>) { |
| 147 | 150 | tcx.try_normalize_erasing_regions(ty::TypingEnv::fully_monomorphized(), ty) |
| 148 | 151 | else { |
| 149 | 152 | tcx.dcx().span_err( |
| 150 | attr.span(), | |
| 153 | attr_span, | |
| 151 | 154 | "`rustc_dump_vtable` applied to type alias that cannot be normalized", |
| 152 | 155 | ); |
| 153 | 156 | continue; |
| 154 | 157 | }; |
| 155 | 158 | 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"); | |
| 158 | 160 | continue; |
| 159 | 161 | }; |
| 160 | 162 | if let Some(principal) = data.principal() { |
| ... | ... | @@ -167,7 +169,7 @@ pub(crate) fn vtables<'tcx>(tcx: TyCtxt<'tcx>) { |
| 167 | 169 | } |
| 168 | 170 | _ => { |
| 169 | 171 | tcx.dcx().span_err( |
| 170 | attr.span(), | |
| 172 | attr_span, | |
| 171 | 173 | "`rustc_dump_vtable` only applies to impl, or type alias of dyn type", |
| 172 | 174 | ); |
| 173 | 175 | continue; |
compiler/rustc_hir_analysis/src/errors.rs+2| ... | ... | @@ -1655,10 +1655,12 @@ pub(crate) struct LifetimesOrBoundsMismatchOnEii { |
| 1655 | 1655 | |
| 1656 | 1656 | #[derive(Diagnostic)] |
| 1657 | 1657 | #[diag(hir_analysis_eii_with_generics)] |
| 1658 | #[help] | |
| 1658 | 1659 | pub(crate) struct EiiWithGenerics { |
| 1659 | 1660 | #[primary_span] |
| 1660 | 1661 | pub span: Span, |
| 1661 | 1662 | #[label] |
| 1662 | 1663 | pub attr: Span, |
| 1663 | 1664 | pub eii_name: Symbol, |
| 1665 | pub impl_name: Symbol, | |
| 1664 | 1666 | } |
compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs+4-5| ... | ... | @@ -2415,11 +2415,10 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { |
| 2415 | 2415 | }; |
| 2416 | 2416 | |
| 2417 | 2417 | 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); | |
| 2423 | 2422 | }; |
| 2424 | 2423 | |
| 2425 | 2424 | let elems = array_expr |
compiler/rustc_hir_typeck/src/writeback.rs+5-4| ... | ... | @@ -14,9 +14,10 @@ use std::ops::ControlFlow; |
| 14 | 14 | use rustc_data_structures::fx::{FxHashSet, FxIndexMap}; |
| 15 | 15 | use rustc_data_structures::unord::ExtendUnord; |
| 16 | 16 | use rustc_errors::{E0720, ErrorGuaranteed}; |
| 17 | use rustc_hir::attrs::AttributeKind; | |
| 17 | 18 | use rustc_hir::def_id::LocalDefId; |
| 18 | 19 | use rustc_hir::intravisit::{self, InferKind, Visitor}; |
| 19 | use rustc_hir::{self as hir, AmbigArg, HirId}; | |
| 20 | use rustc_hir::{self as hir, AmbigArg, HirId, find_attr}; | |
| 20 | 21 | use rustc_infer::traits::solve::Goal; |
| 21 | 22 | use rustc_middle::traits::ObligationCause; |
| 22 | 23 | use rustc_middle::ty::adjustment::{Adjust, Adjustment, PointerCoercion}; |
| ... | ... | @@ -25,7 +26,7 @@ use rustc_middle::ty::{ |
| 25 | 26 | TypeSuperFoldable, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor, |
| 26 | 27 | fold_regions, |
| 27 | 28 | }; |
| 28 | use rustc_span::{Span, sym}; | |
| 29 | use rustc_span::Span; | |
| 29 | 30 | use rustc_trait_selection::error_reporting::infer::need_type_info::TypeAnnotationNeeded; |
| 30 | 31 | use rustc_trait_selection::opaque_types::opaque_type_has_defining_use_args; |
| 31 | 32 | use rustc_trait_selection::solve; |
| ... | ... | @@ -45,8 +46,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 45 | 46 | |
| 46 | 47 | // This attribute causes us to dump some writeback information |
| 47 | 48 | // 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); | |
| 50 | 51 | |
| 51 | 52 | let mut wbcx = WritebackCx::new(self, body, rustc_dump_user_args); |
| 52 | 53 | for param in body.params { |
compiler/rustc_passes/src/check_attr.rs+5-5| ... | ... | @@ -309,6 +309,11 @@ impl<'tcx> CheckAttrVisitor<'tcx> { |
| 309 | 309 | | AttributeKind::CfiEncoding { .. } |
| 310 | 310 | | AttributeKind::RustcHasIncoherentInherentImpls |
| 311 | 311 | | AttributeKind::MustNotSupend { .. } |
| 312 | | AttributeKind::RustcDumpUserArgs | |
| 313 | | AttributeKind::RustcDumpItemBounds | |
| 314 | | AttributeKind::RustcDumpPredicates | |
| 315 | | AttributeKind::RustcDumpDefParents | |
| 316 | | AttributeKind::RustcDumpVtable(..) | |
| 312 | 317 | ) => { /* do nothing */ } |
| 313 | 318 | Attribute::Unparsed(attr_item) => { |
| 314 | 319 | style = Some(attr_item.style); |
| ... | ... | @@ -368,25 +373,20 @@ impl<'tcx> CheckAttrVisitor<'tcx> { |
| 368 | 373 | | sym::rustc_abi |
| 369 | 374 | | sym::rustc_layout |
| 370 | 375 | | sym::rustc_proc_macro_decls |
| 371 | | sym::rustc_dump_def_parents | |
| 372 | 376 | | sym::rustc_never_type_options |
| 373 | 377 | | sym::rustc_autodiff |
| 374 | 378 | | sym::rustc_capture_analysis |
| 375 | 379 | | sym::rustc_regions |
| 376 | 380 | | sym::rustc_strict_coherence |
| 377 | | sym::rustc_dump_predicates | |
| 378 | 381 | | sym::rustc_variance |
| 379 | 382 | | sym::rustc_variance_of_opaques |
| 380 | 383 | | sym::rustc_hidden_type_of_opaques |
| 381 | 384 | | sym::rustc_mir |
| 382 | | sym::rustc_dump_user_args | |
| 383 | 385 | | sym::rustc_effective_visibility |
| 384 | 386 | | sym::rustc_outlives |
| 385 | 387 | | sym::rustc_symbol_name |
| 386 | 388 | | sym::rustc_evaluate_where_clauses |
| 387 | | sym::rustc_dump_vtable | |
| 388 | 389 | | sym::rustc_delayed_bug_from_inside_query |
| 389 | | sym::rustc_dump_item_bounds | |
| 390 | 390 | | sym::rustc_def_path |
| 391 | 391 | | sym::rustc_partition_reused |
| 392 | 392 | | sym::rustc_partition_codegened |
compiler/rustc_span/src/symbol.rs+2| ... | ... | @@ -162,6 +162,7 @@ symbols! { |
| 162 | 162 | Arc, |
| 163 | 163 | ArcWeak, |
| 164 | 164 | Argument, |
| 165 | Array, | |
| 165 | 166 | ArrayIntoIter, |
| 166 | 167 | AsMut, |
| 167 | 168 | AsRef, |
| ... | ... | @@ -939,6 +940,7 @@ symbols! { |
| 939 | 940 | eii_impl, |
| 940 | 941 | eii_internals, |
| 941 | 942 | eii_shared_macro, |
| 943 | element_ty, | |
| 942 | 944 | emit, |
| 943 | 945 | emit_enum, |
| 944 | 946 | 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> { |
| 1391 | 1391 | // return early in the caller. |
| 1392 | 1392 | |
| 1393 | 1393 | 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 | ||
| 1394 | 1403 | let msg = format!( |
| 1395 | 1404 | "the trait bound `{}` is not satisfied", |
| 1396 | 1405 | self.tcx.short_string(old_pred, err.long_ty_path()), |
| 1397 | 1406 | ); |
| 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()); | |
| 1400 | 1408 | let trait_path = self |
| 1401 | 1409 | .tcx |
| 1402 | 1410 | .short_string(old_pred.print_modifiers_and_trait_path(), err.long_ty_path()); |
| 1403 | 1411 | |
| 1404 | 1412 | if has_custom_message { |
| 1413 | let msg = if is_sized { | |
| 1414 | "the trait bound `Sized` is not satisfied".into() | |
| 1415 | } else { | |
| 1416 | msg | |
| 1417 | }; | |
| 1405 | 1418 | err.note(msg); |
| 1406 | 1419 | } else { |
| 1407 | 1420 | err.messages = vec![(rustc_errors::DiagMessage::from(msg), Style::NoStyle)]; |
| 1408 | 1421 | } |
| 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 | } | |
| 1413 | 1433 | }; |
| 1414 | 1434 | |
| 1415 | 1435 | let mut sugg_prefixes = vec![]; |
| ... | ... | @@ -3578,10 +3598,27 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 3578 | 3598 | "unsatisfied trait bound introduced in this `derive` macro", |
| 3579 | 3599 | ); |
| 3580 | 3600 | } 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 | } | |
| 3585 | 3622 | } |
| 3586 | 3623 | err.span_note(spans, msg); |
| 3587 | 3624 | point_at_assoc_type_restriction( |
library/core/src/mem/type_info.rs+14-1| ... | ... | @@ -31,7 +31,7 @@ impl Type { |
| 31 | 31 | #[unstable(feature = "type_info", issue = "146922")] |
| 32 | 32 | #[rustc_const_unstable(feature = "type_info", issue = "146922")] |
| 33 | 33 | // 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 { | |
| 35 | 35 | const { TypeId::of::<T>().info() } |
| 36 | 36 | } |
| 37 | 37 | } |
| ... | ... | @@ -43,6 +43,8 @@ impl Type { |
| 43 | 43 | pub enum TypeKind { |
| 44 | 44 | /// Tuples. |
| 45 | 45 | Tuple(Tuple), |
| 46 | /// Arrays. | |
| 47 | Array(Array), | |
| 46 | 48 | /// Primitives |
| 47 | 49 | /// FIXME(#146922): disambiguate further |
| 48 | 50 | Leaf, |
| ... | ... | @@ -69,3 +71,14 @@ pub struct Field { |
| 69 | 71 | /// Offset in bytes from the parent type |
| 70 | 72 | pub offset: usize, |
| 71 | 73 | } |
| 74 | ||
| 75 | /// Compile-time type information about arrays. | |
| 76 | #[derive(Debug)] | |
| 77 | #[non_exhaustive] | |
| 78 | #[unstable(feature = "type_info", issue = "146922")] | |
| 79 | pub 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 @@ |
| 115 | 115 | #![feature(try_blocks)] |
| 116 | 116 | #![feature(try_find)] |
| 117 | 117 | #![feature(try_trait_v2)] |
| 118 | #![feature(type_info)] | |
| 118 | 119 | #![feature(uint_bit_width)] |
| 119 | 120 | #![feature(uint_gather_scatter_bits)] |
| 120 | 121 | #![feature(unsize)] |
library/coretests/tests/mem.rs+2| ... | ... | @@ -1,3 +1,5 @@ |
| 1 | mod type_info; | |
| 2 | ||
| 1 | 3 | use core::mem::*; |
| 2 | 4 | use core::{array, ptr}; |
| 3 | 5 | use std::cell::Cell; |
library/coretests/tests/mem/type_info.rs created+56| ... | ... | @@ -0,0 +1,56 @@ |
| 1 | use std::any::TypeId; | |
| 2 | use std::mem::type_info::{Type, TypeKind}; | |
| 3 | ||
| 4 | #[test] | |
| 5 | fn 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] | |
| 26 | fn 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 { |
| 2972 | 2972 | /// |
| 2973 | 2973 | /// If `path` is absolute, it replaces the current path. |
| 2974 | 2974 | /// |
| 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 | /// | |
| 2975 | 2984 | /// See [`PathBuf::push`] for more details on what it means to adjoin a path. |
| 2976 | 2985 | /// |
| 2977 | 2986 | /// # Examples |
src/ci/citool/src/main.rs+2-4| ... | ... | @@ -41,14 +41,12 @@ impl GitHubContext { |
| 41 | 41 | match (self.event_name.as_str(), self.branch_ref.as_str()) { |
| 42 | 42 | ("pull_request", _) => Some(RunType::PullRequest), |
| 43 | 43 | ("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") => { | |
| 45 | 45 | let patterns = self.get_try_job_patterns(); |
| 46 | 46 | let patterns = if !patterns.is_empty() { Some(patterns) } else { None }; |
| 47 | 47 | Some(RunType::TryJob { job_patterns: patterns }) |
| 48 | 48 | } |
| 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), | |
| 52 | 50 | ("push", "refs/heads/main") => Some(RunType::MainJob), |
| 53 | 51 | _ => None, |
| 54 | 52 | } |
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 |
| 4 | 4 | |
| 5 | 5 | #[test] |
| 6 | 6 | fn auto_jobs() { |
| 7 | let stdout = get_matrix("push", "commit", "refs/heads/auto"); | |
| 7 | let stdout = get_matrix("push", "commit", "refs/heads/automation/bors/auto"); | |
| 8 | 8 | insta::assert_snapshot!(stdout, @r#" |
| 9 | 9 | 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"}] |
| 10 | 10 | run_type=auto |
| ... | ... | @@ -13,7 +13,7 @@ fn auto_jobs() { |
| 13 | 13 | |
| 14 | 14 | #[test] |
| 15 | 15 | fn try_jobs() { |
| 16 | let stdout = get_matrix("push", "commit", "refs/heads/try"); | |
| 16 | let stdout = get_matrix("push", "commit", "refs/heads/automation/bors/try"); | |
| 17 | 17 | insta::assert_snapshot!(stdout, @r###" |
| 18 | 18 | 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}}] |
| 19 | 19 | run_type=try |
| ... | ... | @@ -28,7 +28,7 @@ fn try_custom_jobs() { |
| 28 | 28 | |
| 29 | 29 | try-job: aarch64-gnu |
| 30 | 30 | try-job: dist-i686-msvc"#, |
| 31 | "refs/heads/try", | |
| 31 | "refs/heads/automation/bors/try", | |
| 32 | 32 | ); |
| 33 | 33 | insta::assert_snapshot!(stdout, @r###" |
| 34 | 34 | 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' |
| 8 | 8 | |
| 9 | 9 | source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" |
| 10 | 10 | |
| 11 | if isCiBranch auto || isCiBranch try || isCiBranch try-perf || \ | |
| 12 | isCiBranch automation/bors/try || isCiBranch automation/bors/auto; then | |
| 11 | if isCiBranch try-perf || isCiBranch automation/bors/try || isCiBranch automation/bors/auto; then | |
| 13 | 12 | echo "channel verification is only executed on PR builds" |
| 14 | 13 | exit |
| 15 | 14 | fi |
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 |
| 21 | 21 | |
| 22 | 22 | Compiling 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. |
| 23 | 23 | |
| 24 | If 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. | |
| 24 | If 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. | |
| 25 | 25 | |
| 26 | 26 | ### Configure rust |
| 27 | 27 | |
| ... | ... | @@ -30,7 +30,7 @@ The target can be built by enabling it for a `rustc` build, by placing the follo |
| 30 | 30 | ```toml |
| 31 | 31 | [build] |
| 32 | 32 | target = ["armv7-unknown-linux-uclibceabihf"] |
| 33 | stage = 2 | |
| 33 | build-stage = 2 | |
| 34 | 34 | |
| 35 | 35 | [target.armv7-unknown-linux-uclibceabihf] |
| 36 | 36 | # 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. |
| 9 | 9 | This is related to the [`--check-cfg` flag][check-cfg] which allows specifying arbitrary expected |
| 10 | 10 | names and values. |
| 11 | 11 | |
| 12 | This 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()` | | |
| 12 | This print option outputs compatible `--check-cfg` arguments with a reduced syntax where all the | |
| 13 | expected 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 | ||
| 25 | The print option includes well known cfgs. | |
| 24 | 26 | |
| 25 | 27 | To be used like this: |
| 26 | 28 | |
| ... | ... | @@ -28,4 +30,7 @@ To be used like this: |
| 28 | 30 | rustc --print=check-cfg -Zunstable-options lib.rs |
| 29 | 31 | ``` |
| 30 | 32 | |
| 33 | > **Note:** Users should be resilient when parsing, in particular against new predicates that | |
| 34 | may be added in the future. | |
| 35 | ||
| 31 | 36 | [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> { |
| 1070 | 1070 | Default::default(), |
| 1071 | 1071 | ) |
| 1072 | 1072 | .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()) | |
| 1074 | 1074 | .chain(std::iter::once(String::from("test"))) |
| 1075 | 1075 | .collect() |
| 1076 | 1076 | } |
| 1077 | 1077 | |
| 1078 | /// Extract the cfg name from `cfg(name, values(...))` lines | |
| 1079 | fn 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 | ||
| 1078 | 1094 | pub const KNOWN_CRATE_TYPES: &[&str] = |
| 1079 | 1095 | &["bin", "cdylib", "dylib", "lib", "proc-macro", "rlib", "staticlib"]; |
| 1080 | 1096 |
tests/run-make/print-check-cfg/rmake.rs+36-30| ... | ... | @@ -14,51 +14,55 @@ struct CheckCfg { |
| 14 | 14 | |
| 15 | 15 | enum Contains { |
| 16 | 16 | Some { contains: &'static [&'static str], doesnt_contain: &'static [&'static str] }, |
| 17 | Only(&'static str), | |
| 17 | Nothing, | |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | fn main() { |
| 21 | check(CheckCfg { args: &[], contains: Contains::Only("any()=any()") }); | |
| 21 | check(CheckCfg { args: &[], contains: Contains::Nothing }); | |
| 22 | 22 | check(CheckCfg { |
| 23 | 23 | args: &["--check-cfg=cfg()"], |
| 24 | 24 | 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())"], | |
| 27 | 27 | }, |
| 28 | 28 | }); |
| 29 | 29 | check(CheckCfg { |
| 30 | 30 | args: &["--check-cfg=cfg(any())"], |
| 31 | 31 | contains: Contains::Some { |
| 32 | contains: &["any()", "unix", r#"target_feature="crt-static""#], | |
| 32 | contains: &["cfg(any())", "cfg(unix, values(none()))"], | |
| 33 | 33 | doesnt_contain: &["any()=any()"], |
| 34 | 34 | }, |
| 35 | 35 | }); |
| 36 | 36 | check(CheckCfg { |
| 37 | 37 | args: &["--check-cfg=cfg(feature)"], |
| 38 | 38 | 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)"], | |
| 41 | 45 | }, |
| 42 | 46 | }); |
| 43 | 47 | check(CheckCfg { |
| 44 | 48 | args: &[r#"--check-cfg=cfg(feature, values(none(), "", "test", "lol"))"#], |
| 45 | 49 | 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)"], | |
| 48 | 52 | }, |
| 49 | 53 | }); |
| 50 | 54 | check(CheckCfg { |
| 51 | 55 | args: &["--check-cfg=cfg(feature, values())"], |
| 52 | 56 | 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)"], | |
| 55 | 59 | }, |
| 56 | 60 | }); |
| 57 | 61 | check(CheckCfg { |
| 58 | 62 | args: &["--check-cfg=cfg(feature, values())", "--check-cfg=cfg(feature, values(none()))"], |
| 59 | 63 | 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())"], | |
| 62 | 66 | }, |
| 63 | 67 | }); |
| 64 | 68 | check(CheckCfg { |
| ... | ... | @@ -67,8 +71,8 @@ fn main() { |
| 67 | 71 | r#"--check-cfg=cfg(feature, values("tmp"))"#, |
| 68 | 72 | ], |
| 69 | 73 | 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"))"#], | |
| 72 | 76 | }, |
| 73 | 77 | }); |
| 74 | 78 | check(CheckCfg { |
| ... | ... | @@ -78,8 +82,12 @@ fn main() { |
| 78 | 82 | r#"--check-cfg=cfg(feature, values("tmp"))"#, |
| 79 | 83 | ], |
| 80 | 84 | 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)"], | |
| 83 | 91 | }, |
| 84 | 92 | }); |
| 85 | 93 | } |
| ... | ... | @@ -94,16 +102,15 @@ fn check(CheckCfg { args, contains }: CheckCfg) { |
| 94 | 102 | |
| 95 | 103 | for l in stdout.lines() { |
| 96 | 104 | 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}"); | |
| 107 | 114 | } |
| 108 | 115 | |
| 109 | 116 | match contains { |
| ... | ... | @@ -131,9 +138,8 @@ fn check(CheckCfg { args, contains }: CheckCfg) { |
| 131 | 138 | ); |
| 132 | 139 | } |
| 133 | 140 | } |
| 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()); | |
| 137 | 143 | } |
| 138 | 144 | } |
| 139 | 145 | } |
tests/rustdoc-gui/notable-trait.goml+2-2| ... | ... | @@ -250,7 +250,7 @@ set-window-size: (1100, 600) |
| 250 | 250 | reload: |
| 251 | 251 | assert-count: ("//*[@class='tooltip popover']", 0) |
| 252 | 252 | click: "//*[@id='method.create_an_iterator_from_read']//*[@class='tooltip']" |
| 253 | assert-count: ("//*[@class='tooltip popover']", 1) | |
| 253 | wait-for-count: ("//*[@class='tooltip popover']", 1) | |
| 254 | 254 | call-function: ("open-settings-menu", {}) |
| 255 | assert-count: ("//*[@class='tooltip popover']", 0) | |
| 255 | wait-for-count: ("//*[@class='tooltip popover']", 0) | |
| 256 | 256 | assert-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>` |
| 88 | 88 | LL | impl<'a, 'b, T, S> Foo<'a, 'b, S> for T {} |
| 89 | 89 | | - ^^^^^^^^^^^^^^ ^ |
| 90 | 90 | | | |
| 91 | | unsatisfied trait bound introduced here | |
| 91 | | unsatisfied trait bound implicitly introduced here | |
| 92 | 92 | |
| 93 | 93 | error: aborting due to 5 previous errors |
| 94 | 94 |
tests/ui/associated-types/substs-ppaux.verbose.stderr+1-1| ... | ... | @@ -88,7 +88,7 @@ note: required for `str` to implement `Foo<'?0, '?1, u8>` |
| 88 | 88 | LL | impl<'a, 'b, T, S> Foo<'a, 'b, S> for T {} |
| 89 | 89 | | - ^^^^^^^^^^^^^^ ^ |
| 90 | 90 | | | |
| 91 | | unsatisfied trait bound introduced here | |
| 91 | | unsatisfied trait bound implicitly introduced here | |
| 92 | 92 | |
| 93 | 93 | error: aborting due to 5 previous errors |
| 94 | 94 |
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 | ||
| 6 | trait Trait1<const N: usize> {} | |
| 7 | trait Trait2<const N: [u8; 3]> {} | |
| 8 | ||
| 9 | fn foo<T>() | |
| 10 | where | |
| 11 | T: Trait1<{ [] }>, //~ ERROR: expected `usize`, found const array | |
| 12 | { | |
| 13 | } | |
| 14 | ||
| 15 | fn bar<T>() | |
| 16 | where | |
| 17 | T: Trait2<3>, //~ ERROR: mismatched types | |
| 18 | { | |
| 19 | } | |
| 20 | ||
| 21 | fn main() {} |
tests/ui/const-generics/mgca/array-expr-type-mismatch-in-where-bound.stderr created+15| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | error: expected `usize`, found const array | |
| 2 | --> $DIR/array-expr-type-mismatch-in-where-bound.rs:11:17 | |
| 3 | | | |
| 4 | LL | T: Trait1<{ [] }>, | |
| 5 | | ^^ | |
| 6 | ||
| 7 | error[E0308]: mismatched types | |
| 8 | --> $DIR/array-expr-type-mismatch-in-where-bound.rs:17:15 | |
| 9 | | | |
| 10 | LL | T: Trait2<3>, | |
| 11 | | ^ expected `[u8; 3]`, found integer | |
| 12 | ||
| 13 | error: aborting due to 2 previous errors | |
| 14 | ||
| 15 | For 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] | |
| 7 | fn foo(); | |
| 8 | ||
| 9 | #[foo] | |
| 10 | fn foo_impl<T>() {} | |
| 11 | //~^ ERROR `foo_impl` cannot have generic parameters other than lifetimes | |
| 12 | ||
| 13 | fn main() {} |
tests/ui/eii/type_checking/generic_implementation.stderr created+12| ... | ... | @@ -0,0 +1,12 @@ |
| 1 | error: `foo_impl` cannot have generic parameters other than lifetimes | |
| 2 | --> $DIR/generic_implementation.rs:10:1 | |
| 3 | | | |
| 4 | LL | #[foo] | |
| 5 | | ------ required by this attribute | |
| 6 | LL | fn foo_impl<T>() {} | |
| 7 | | ^^^^^^^^^^^^^^^^ | |
| 8 | | | |
| 9 | = help: `#[foo]` marks the implementation of an "externally implementable item" | |
| 10 | ||
| 11 | error: 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] | |
| 7 | fn foo<T>() {} | |
| 8 | //~^ ERROR externally implementable items may not have type parameters | |
| 9 | ||
| 10 | fn main() {} |
tests/ui/eii/type_checking/type_params_149983.stderr created+11| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | error[E0044]: externally implementable items may not have type parameters | |
| 2 | --> $DIR/type_params_149983.rs:7:1 | |
| 3 | | | |
| 4 | LL | fn foo<T>() {} | |
| 5 | | ^^^^^^^^^^^ can't have type parameters | |
| 6 | | | |
| 7 | = help: replace the type parameters with concrete types like `u32` | |
| 8 | ||
| 9 | error: aborting due to 1 previous error | |
| 10 | ||
| 11 | For more information about this error, try `rustc --explain E0044`. |
tests/ui/error-codes/E0277-4.rs created+50| ... | ... | @@ -0,0 +1,50 @@ |
| 1 | use std::fmt::Display; | |
| 2 | ||
| 3 | trait ImplicitTrait { | |
| 4 | fn foo(&self); | |
| 5 | } | |
| 6 | ||
| 7 | trait ExplicitTrait { | |
| 8 | fn foo(&self); | |
| 9 | } | |
| 10 | ||
| 11 | trait DisplayTrait { | |
| 12 | fn foo(&self); | |
| 13 | } | |
| 14 | ||
| 15 | trait UnimplementedTrait { | |
| 16 | fn foo(&self); | |
| 17 | } | |
| 18 | ||
| 19 | // Implicitly requires `T: Sized`. | |
| 20 | impl<T> ImplicitTrait for T { | |
| 21 | fn foo(&self) {} | |
| 22 | } | |
| 23 | ||
| 24 | // Explicitly requires `T: Sized`. | |
| 25 | impl<T: Sized> ExplicitTrait for T { | |
| 26 | fn foo(&self) {} | |
| 27 | } | |
| 28 | ||
| 29 | // Requires `T: Display`. | |
| 30 | impl<T: Display> DisplayTrait for T { | |
| 31 | fn foo(&self) {} | |
| 32 | } | |
| 33 | ||
| 34 | fn 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 @@ |
| 1 | error[E0277]: the trait bound `[u8]: ImplicitTrait` is not satisfied | |
| 2 | --> $DIR/E0277-4.rs:37:24 | |
| 3 | | | |
| 4 | LL | ImplicitTrait::foo(x); | |
| 5 | | ------------------ ^ the trait `Sized` is not implemented for `[u8]` | |
| 6 | | | | |
| 7 | | required by a bound introduced by this call | |
| 8 | | | |
| 9 | note: required for `[u8]` to implement `ImplicitTrait` | |
| 10 | --> $DIR/E0277-4.rs:20:9 | |
| 11 | | | |
| 12 | LL | impl<T> ImplicitTrait for T { | |
| 13 | | - ^^^^^^^^^^^^^ ^ | |
| 14 | | | | |
| 15 | | unsatisfied trait bound implicitly introduced here | |
| 16 | help: consider borrowing here | |
| 17 | | | |
| 18 | LL | ImplicitTrait::foo(&x); | |
| 19 | | + | |
| 20 | LL | ImplicitTrait::foo(&mut x); | |
| 21 | | ++++ | |
| 22 | ||
| 23 | error[E0277]: the trait bound `[u8]: ExplicitTrait` is not satisfied | |
| 24 | --> $DIR/E0277-4.rs:39:24 | |
| 25 | | | |
| 26 | LL | ExplicitTrait::foo(x); | |
| 27 | | ------------------ ^ the trait `Sized` is not implemented for `[u8]` | |
| 28 | | | | |
| 29 | | required by a bound introduced by this call | |
| 30 | | | |
| 31 | note: required for `[u8]` to implement `ExplicitTrait` | |
| 32 | --> $DIR/E0277-4.rs:25:16 | |
| 33 | | | |
| 34 | LL | impl<T: Sized> ExplicitTrait for T { | |
| 35 | | ----- ^^^^^^^^^^^^^ ^ | |
| 36 | | | | |
| 37 | | unsatisfied trait bound introduced here | |
| 38 | help: consider borrowing here | |
| 39 | | | |
| 40 | LL | ExplicitTrait::foo(&x); | |
| 41 | | + | |
| 42 | LL | ExplicitTrait::foo(&mut x); | |
| 43 | | ++++ | |
| 44 | ||
| 45 | error[E0277]: the trait bound `[u8]: UnimplementedTrait` is not satisfied | |
| 46 | --> $DIR/E0277-4.rs:43:29 | |
| 47 | | | |
| 48 | LL | UnimplementedTrait::foo(x); | |
| 49 | | ----------------------- ^ the trait `UnimplementedTrait` is not implemented for `[u8]` | |
| 50 | | | | |
| 51 | | required by a bound introduced by this call | |
| 52 | | | |
| 53 | help: this trait has no implementations, consider adding one | |
| 54 | --> $DIR/E0277-4.rs:15:1 | |
| 55 | | | |
| 56 | LL | trait UnimplementedTrait { | |
| 57 | | ^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 58 | ||
| 59 | error[E0277]: the trait bound `[u8; 0]: DisplayTrait` is not satisfied | |
| 60 | --> $DIR/E0277-4.rs:48:23 | |
| 61 | | | |
| 62 | LL | 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 | | | |
| 67 | note: required for `[u8; 0]` to implement `DisplayTrait` | |
| 68 | --> $DIR/E0277-4.rs:30:18 | |
| 69 | | | |
| 70 | LL | impl<T: Display> DisplayTrait for T { | |
| 71 | | ------- ^^^^^^^^^^^^ ^ | |
| 72 | | | | |
| 73 | | unsatisfied trait bound introduced here | |
| 74 | ||
| 75 | error: aborting due to 4 previous errors | |
| 76 | ||
| 77 | For 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> |
| 11 | 11 | LL | impl<T: Next> Next for GetNext<T> { |
| 12 | 12 | | - ^^^^ ^^^^^^^^^^ |
| 13 | 13 | | | |
| 14 | | unsatisfied trait bound introduced here | |
| 14 | | unsatisfied trait bound implicitly introduced here | |
| 15 | 15 | = note: the full name for the type has been written to '$TEST_BUILD_DIR/issue-23122-2.long-type-$LONG_TYPE_HASH.txt' |
| 16 | 16 | = note: consider using `--verbose` to print the full type name to the console |
| 17 | 17 |
tests/ui/reflection/dump.rs+3| ... | ... | @@ -22,9 +22,12 @@ struct Unsized { |
| 22 | 22 | |
| 23 | 23 | fn main() { |
| 24 | 24 | println!("{:#?}", const { Type::of::<(u8, u8, ())>() }.kind); |
| 25 | println!("{:#?}", const { Type::of::<[u8; 2]>() }.kind); | |
| 25 | 26 | println!("{:#?}", const { Type::of::<Foo>() }.kind); |
| 26 | 27 | println!("{:#?}", const { Type::of::<Bar>() }.kind); |
| 27 | 28 | println!("{:#?}", const { Type::of::<&Unsized>() }.kind); |
| 28 | 29 | println!("{:#?}", const { Type::of::<&str>() }.kind); |
| 29 | 30 | println!("{:#?}", const { Type::of::<&[u8]>() }.kind); |
| 31 | println!("{:#?}", const { Type::of::<str>() }.kind); | |
| 32 | println!("{:#?}", const { Type::of::<[u8]>() }.kind); | |
| 30 | 33 | } |
tests/ui/reflection/dump.run.stdout+8| ... | ... | @@ -16,6 +16,14 @@ Tuple( |
| 16 | 16 | ], |
| 17 | 17 | }, |
| 18 | 18 | ) |
| 19 | Array( | |
| 20 | Array { | |
| 21 | element_ty: TypeId(0x0596b48cc04376e64d5c788c2aa46bdb), | |
| 22 | len: 2, | |
| 23 | }, | |
| 24 | ) | |
| 25 | Other | |
| 26 | Other | |
| 19 | 27 | Other |
| 20 | 28 | Other |
| 21 | 29 | Other |
tests/ui/reflection/tuples.rs deleted-36| ... | ... | @@ -1,36 +0,0 @@ |
| 1 | #![feature(type_info)] | |
| 2 | ||
| 3 | //@ run-pass | |
| 4 | ||
| 5 | use std::mem::type_info::{Type, TypeKind}; | |
| 6 | ||
| 7 | fn 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 | ||
| 18 | fn 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 | ||
| 9 | mod 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 | ||
| 18 | fn main() { | |
| 19 | foo::m!(); | |
| 20 | } |
tests/ui/resolve/decl-macro-use-no-ice.stderr created+47| ... | ... | @@ -0,0 +1,47 @@ |
| 1 | error[E0364]: `f` is private, and cannot be re-exported | |
| 2 | --> $DIR/decl-macro-use-no-ice.rs:13:13 | |
| 3 | | | |
| 4 | LL | use f; | |
| 5 | | ^ | |
| 6 | ... | |
| 7 | LL | foo::m!(); | |
| 8 | | --------- in this macro invocation | |
| 9 | | | |
| 10 | note: consider marking `f` as `pub` in the imported module | |
| 11 | --> $DIR/decl-macro-use-no-ice.rs:13:13 | |
| 12 | | | |
| 13 | LL | use f; | |
| 14 | | ^ | |
| 15 | ... | |
| 16 | LL | 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 | ||
| 20 | error[E0603]: macro import `f` is private | |
| 21 | --> $DIR/decl-macro-use-no-ice.rs:14:9 | |
| 22 | | | |
| 23 | LL | f!(); | |
| 24 | | ^ private macro import | |
| 25 | ... | |
| 26 | LL | foo::m!(); | |
| 27 | | --------- in this macro invocation | |
| 28 | | | |
| 29 | note: the macro import `f` is defined here... | |
| 30 | --> $DIR/decl-macro-use-no-ice.rs:13:13 | |
| 31 | | | |
| 32 | LL | use f; | |
| 33 | | ^ | |
| 34 | ... | |
| 35 | LL | foo::m!(); | |
| 36 | | --------- in this macro invocation | |
| 37 | note: ...and refers to the macro `f` which is defined here | |
| 38 | --> $DIR/decl-macro-use-no-ice.rs:10:5 | |
| 39 | | | |
| 40 | LL | 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 | ||
| 44 | error: aborting due to 2 previous errors | |
| 45 | ||
| 46 | Some errors have detailed explanations: E0364, E0603. | |
| 47 | For 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 |
| 17 | 17 | --> $DIR/slice-issue-87994.rs:3:12 |
| 18 | 18 | | |
| 19 | 19 | LL | for _ in v[1..] { |
| 20 | | ^^^^^^ the trait `IntoIterator` is not implemented for `[i32]` | |
| 20 | | ^^^^^^ the trait `Sized` is not implemented for `[i32]` | |
| 21 | 21 | | |
| 22 | = note: the trait bound `[i32]: IntoIterator` is not satisfied | |
| 22 | = note: the trait bound `Sized` is not satisfied | |
| 23 | 23 | = note: required for `[i32]` to implement `IntoIterator` |
| 24 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` | |
| 25 | 24 | help: consider borrowing here |
| 26 | 25 | | |
| 27 | 26 | LL | for _ in &v[1..] { |
| ... | ... | @@ -48,11 +47,10 @@ error[E0277]: `[K]` is not an iterator |
| 48 | 47 | --> $DIR/slice-issue-87994.rs:11:13 |
| 49 | 48 | | |
| 50 | 49 | LL | for i2 in v2[1..] { |
| 51 | | ^^^^^^^ the trait `IntoIterator` is not implemented for `[K]` | |
| 50 | | ^^^^^^^ the trait `Sized` is not implemented for `[K]` | |
| 52 | 51 | | |
| 53 | = note: the trait bound `[K]: IntoIterator` is not satisfied | |
| 52 | = note: the trait bound `Sized` is not satisfied | |
| 54 | 53 | = note: required for `[K]` to implement `IntoIterator` |
| 55 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` | |
| 56 | 54 | help: consider borrowing here |
| 57 | 55 | | |
| 58 | 56 | LL | 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 |
| 2 | 2 | --> $DIR/dyn-iterator-deref-in-for-loop.rs:9:17 |
| 3 | 3 | | |
| 4 | 4 | LL | 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>` | |
| 6 | 6 | | |
| 7 | = note: the trait bound `dyn Iterator<Item = &'a mut u8>: IntoIterator` is not satisfied | |
| 7 | = note: the trait bound `Sized` is not satisfied | |
| 8 | 8 | = note: required for `dyn Iterator<Item = &'a mut u8>` to implement `IntoIterator` |
| 9 | 9 | help: consider mutably borrowing here |
| 10 | 10 | | |
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 |
| 2 | 2 | --> $DIR/dyn-iterator-deref-in-for-loop.rs:9:17 |
| 3 | 3 | | |
| 4 | 4 | LL | 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>` | |
| 6 | 6 | | |
| 7 | = note: the trait bound `dyn Iterator<Item = &'a mut u8>: IntoIterator` is not satisfied | |
| 7 | = note: the trait bound `Sized` is not satisfied | |
| 8 | 8 | = note: required for `dyn Iterator<Item = &'a mut u8>` to implement `IntoIterator` |
| 9 | 9 | help: consider mutably borrowing here |
| 10 | 10 | | |
tests/ui/traits/issue-18400.stderr+1-1| ... | ... | @@ -11,7 +11,7 @@ note: required for `{integer}` to implement `Set<&[_]>` |
| 11 | 11 | LL | impl<'a, T, S> Set<&'a [T]> for S where |
| 12 | 12 | | - ^^^^^^^^^^^^ ^ |
| 13 | 13 | | | |
| 14 | | unsatisfied trait bound introduced here | |
| 14 | | unsatisfied trait bound implicitly introduced here | |
| 15 | 15 | = note: 128 redundant requirements hidden |
| 16 | 16 | = note: required for `{integer}` to implement `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` |
| 17 | 17 |
triagebot.toml+8| ... | ... | @@ -332,6 +332,14 @@ trigger_labels = [ |
| 332 | 332 | "A-type-based-search", |
| 333 | 333 | ] |
| 334 | 334 | |
| 335 | [autolabel."A-rustdoc-js"] | |
| 336 | trigger_files = [ | |
| 337 | "src/librustdoc/html/static/js/", | |
| 338 | "src/librustdoc/html/static/css/", | |
| 339 | "tests/rustdoc-js/", | |
| 340 | "tests/rustdoc-js-std/", | |
| 341 | ] | |
| 342 | ||
| 335 | 343 | [autolabel."T-compiler"] |
| 336 | 344 | trigger_files = [ |
| 337 | 345 | # Source code |