diff --git a/compiler/rustc_ast/src/token.rs b/compiler/rustc_ast/src/token.rs index 300b1486f9ba0..7878985357f74 100644 --- a/compiler/rustc_ast/src/token.rs +++ b/compiler/rustc_ast/src/token.rs @@ -104,6 +104,7 @@ impl Lit { } } + // tidy-ticket-ast-from_token /// Keep this in sync with `Token::can_begin_literal_or_bool` excluding unary negation. pub fn from_token(token: &Token) -> Option { match token.uninterpolate().kind { @@ -120,6 +121,7 @@ impl Lit { _ => None, } } + // tidy-ticket-ast-from_token } impl fmt::Display for Lit { @@ -545,6 +547,7 @@ impl Token { /// /// In other words, would this token be a valid start of `parse_literal_maybe_minus`? /// + // tidy-ticket-ast-can_begin_literal_maybe_minus /// Keep this in sync with and `Lit::from_token`, excluding unary negation. pub fn can_begin_literal_maybe_minus(&self) -> bool { match self.uninterpolate().kind { @@ -564,6 +567,7 @@ impl Token { _ => false, } } + // tidy-ticket-ast-can_begin_literal_maybe_minus /// A convenience function for matching on identifiers during parsing. /// Turns interpolated identifier (`$i: ident`) or lifetime (`$l: lifetime`) token diff --git a/compiler/rustc_builtin_macros/src/assert/context.rs b/compiler/rustc_builtin_macros/src/assert/context.rs index 0682d48aca67b..1df992105b423 100644 --- a/compiler/rustc_builtin_macros/src/assert/context.rs +++ b/compiler/rustc_builtin_macros/src/assert/context.rs @@ -292,6 +292,7 @@ impl<'cx, 'a> Context<'cx, 'a> { } // Expressions that are not worth or can not be captured. // + // tidy-ticket-all-expr-kinds // Full list instead of `_` to catch possible future inclusions and to // sync with the `rfc-2011-nicer-assert-messages/all-expr-kinds.rs` test. ExprKind::Assign(_, _, _) @@ -323,6 +324,7 @@ impl<'cx, 'a> Context<'cx, 'a> { | ExprKind::Yeet(_) | ExprKind::Become(_) | ExprKind::Yield(_) => {} + // tidy-ticket-all-expr-kinds } } diff --git a/compiler/rustc_codegen_ssa/src/back/write.rs b/compiler/rustc_codegen_ssa/src/back/write.rs index f192747c8abaa..453ac4c2970f3 100644 --- a/compiler/rustc_codegen_ssa/src/back/write.rs +++ b/compiler/rustc_codegen_ssa/src/back/write.rs @@ -714,6 +714,7 @@ impl WorkItem { } } + // tidy-ticket-short_description /// Generate a short description of this work item suitable for use as a thread name. fn short_description(&self) -> String { // `pthread_setname()` on *nix ignores anything beyond the first 15 @@ -761,6 +762,7 @@ impl WorkItem { WorkItem::LTO(m) => desc("lto", "LTO module", m.name()), } } + // tidy-ticket-short_description } /// A result produced by the backend. diff --git a/compiler/rustc_const_eval/src/interpret/projection.rs b/compiler/rustc_const_eval/src/interpret/projection.rs index f462c13816ee8..4eb5c4c5d6a6e 100644 --- a/compiler/rustc_const_eval/src/interpret/projection.rs +++ b/compiler/rustc_const_eval/src/interpret/projection.rs @@ -149,6 +149,7 @@ where None => { // For unsized types with an extern type tail we perform no adjustments. // NOTE: keep this in sync with `PlaceRef::project_field` in the codegen backend. + // FIXME: that one? compiler/rustc_codegen_ssa/src/mir/place.rs assert!(matches!(base_meta, MemPlaceMeta::None)); (base_meta, offset) } diff --git a/compiler/rustc_const_eval/src/interpret/validity.rs b/compiler/rustc_const_eval/src/interpret/validity.rs index 3e023a89648e5..d146bd06abb4f 100644 --- a/compiler/rustc_const_eval/src/interpret/validity.rs +++ b/compiler/rustc_const_eval/src/interpret/validity.rs @@ -505,6 +505,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, ' Ok(true) } ty::Float(_) | ty::Int(_) | ty::Uint(_) => { + // tidy-ticket-try_visit_primitive // NOTE: Keep this in sync with the array optimization for int/float // types below! self.read_scalar( @@ -516,6 +517,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, ' }, )?; Ok(true) + // tidy-ticket-try_visit_primitive } ty::RawPtr(..) => { let place = @@ -778,9 +780,10 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M> } }; + // tidy-ticket-visit_value // Optimization: we just check the entire range at once. // NOTE: Keep this in sync with the handling of integer and float - // types above, in `visit_primitive`. + // types above, in `try_visit_primitive`. // In run-time mode, we accept pointers in here. This is actually more // permissive than a per-element check would be, e.g., we accept // a &[u8] that contains a pointer even though bytewise checking would @@ -820,6 +823,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M> } } } + // tidy-ticket-visit_value } // Fast path for arrays and slices of ZSTs. We only need to check a single ZST element // of an array and not all of them, because there's only a single value of a specific diff --git a/compiler/rustc_data_structures/src/profiling.rs b/compiler/rustc_data_structures/src/profiling.rs index e688feb5fe176..4106e9c6898c7 100644 --- a/compiler/rustc_data_structures/src/profiling.rs +++ b/compiler/rustc_data_structures/src/profiling.rs @@ -125,6 +125,7 @@ bitflags::bitflags! { } } +// tidy-ticket-self-profile-events // keep this in sync with the `-Z self-profile-events` help message in rustc_session/options.rs const EVENT_FILTERS_BY_NAME: &[(&str, EventFilter)] = &[ ("none", EventFilter::empty()), @@ -142,6 +143,7 @@ const EVENT_FILTERS_BY_NAME: &[(&str, EventFilter)] = &[ ("incr-result-hashing", EventFilter::INCR_RESULT_HASHING), ("artifact-sizes", EventFilter::ARTIFACT_SIZES), ]; +// tidy-ticket-self-profile-events /// Something that uniquely identifies a query invocation. pub struct QueryInvocationId(pub u32); diff --git a/compiler/rustc_errors/src/json.rs b/compiler/rustc_errors/src/json.rs index 0cb75c71b7346..21ebeb2b46dce 100644 --- a/compiler/rustc_errors/src/json.rs +++ b/compiler/rustc_errors/src/json.rs @@ -322,6 +322,8 @@ struct FutureIncompatReport { future_incompat_report: Vec, } +// tidy-ticket-UnusedExterns +// FIXME: where it located in cargo? // NOTE: Keep this in sync with the equivalent structs in rustdoc's // doctest component (as well as cargo). // We could unify this struct the one in rustdoc but they have different @@ -333,6 +335,7 @@ struct UnusedExterns<'a, 'b, 'c> { /// List of unused externs by their names. unused_extern_names: &'b [&'c str], } +// tidy-ticket-UnusedExterns impl Diagnostic { fn from_errors_diagnostic(diag: &crate::Diagnostic, je: &JsonEmitter) -> Diagnostic { diff --git a/compiler/rustc_hir_analysis/src/check/region.rs b/compiler/rustc_hir_analysis/src/check/region.rs index 463fab93e3fde..607b448ac3de1 100644 --- a/compiler/rustc_hir_analysis/src/check/region.rs +++ b/compiler/rustc_hir_analysis/src/check/region.rs @@ -119,6 +119,7 @@ fn resolve_block<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, blk: &'tcx h visitor.cx.var_parent = visitor.cx.parent; { + // FIXME: sync with exactly where? // This block should be kept approximately in sync with // `intravisit::walk_block`. (We manually walk the block, rather // than call `walk_block`, in order to maintain precise diff --git a/compiler/rustc_hir_analysis/src/lib.rs b/compiler/rustc_hir_analysis/src/lib.rs index 03963925d3dbd..d8cc51525f78e 100644 --- a/compiler/rustc_hir_analysis/src/lib.rs +++ b/compiler/rustc_hir_analysis/src/lib.rs @@ -208,10 +208,12 @@ pub fn check_crate(tcx: TyCtxt<'_>) -> Result<(), ErrorGuaranteed> { }); })?; + // tidy-ticket-sess-time-item_types_checking // NOTE: This is copy/pasted in librustdoc/core.rs and should be kept in sync. tcx.sess.time("item_types_checking", || { tcx.hir().for_each_module(|module| tcx.ensure().check_mod_item_types(module)) }); + // tidy-ticket-sess-time-item_types_checking // Freeze definitions as we don't add new ones at this point. This improves performance by // allowing lock-free access to them. diff --git a/compiler/rustc_middle/src/ty/util.rs b/compiler/rustc_middle/src/ty/util.rs index 31b52677b2797..593bd167bcfd0 100644 --- a/compiler/rustc_middle/src/ty/util.rs +++ b/compiler/rustc_middle/src/ty/util.rs @@ -653,6 +653,7 @@ impl<'tcx> TyCtxt<'tcx> { && !self.is_foreign_item(def_id) } + // tidy-ticket-thread_local_ptr_ty /// Returns the type a reference to the thread local takes in MIR. pub fn thread_local_ptr_ty(self, def_id: DefId) -> Ty<'tcx> { let static_ty = self.type_of(def_id).instantiate_identity(); @@ -665,6 +666,7 @@ impl<'tcx> TyCtxt<'tcx> { Ty::new_imm_ref(self, self.lifetimes.re_static, static_ty) } } + // tidy-ticket-thread_local_ptr_ty /// Get the type of the pointer to the static that we use in MIR. pub fn static_ptr_ty(self, def_id: DefId) -> Ty<'tcx> { @@ -674,7 +676,9 @@ impl<'tcx> TyCtxt<'tcx> { self.type_of(def_id).instantiate_identity(), ); + // tidy-ticket-static_ptr_ty // Make sure that accesses to unsafe statics end up using raw pointers. + // FIXME: should it said sync with thread_local_ptr_ty? // For thread-locals, this needs to be kept in sync with `Rvalue::ty`. if self.is_mutable_static(def_id) { Ty::new_mut_ptr(self, static_ty) @@ -683,6 +687,7 @@ impl<'tcx> TyCtxt<'tcx> { } else { Ty::new_imm_ref(self, self.lifetimes.re_erased, static_ty) } + // tidy-ticket-static_ptr_ty } /// Return the set of types that should be taken into account when checking diff --git a/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs b/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs index 3ee4befa12189..20d9b28cf239c 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs @@ -671,6 +671,7 @@ impl<'tcx> Constructor<'tcx> { } } + // tidy-ticket-arity /// The number of fields for this constructor. This must be kept in sync with /// `Fields::wildcards`. pub(super) fn arity(&self, pcx: &PatCtxt<'_, '_, 'tcx>) -> usize { @@ -702,6 +703,7 @@ impl<'tcx> Constructor<'tcx> { Or => bug!("The `Or` constructor doesn't have a fixed arity"), } } + // tidy-ticket-arity /// Some constructors (namely `Wildcard`, `IntRange` and `Slice`) actually stand for a set of actual /// constructors (like variants, integers or fixed-sized slices). When specializing for these @@ -749,6 +751,7 @@ impl<'tcx> Constructor<'tcx> { } } + // tidy-ticket-is_covered_by /// Returns whether `self` is covered by `other`, i.e. whether `self` is a subset of `other`. /// For the simple cases, this is simply checking for equality. For the "grouped" constructors, /// this checks for inclusion. @@ -802,7 +805,9 @@ impl<'tcx> Constructor<'tcx> { ), } } + // tidy-ticket-is_covered_by + // tidy-ticket-is_covered_by_any /// Faster version of `is_covered_by` when applied to many constructors. `used_ctors` is /// assumed to be built from `matrix.head_ctors()` with wildcards and opaques filtered out, /// and `self` is assumed to have been split from a wildcard. @@ -835,6 +840,7 @@ impl<'tcx> Constructor<'tcx> { } } } + // tidy-ticket-is_covered_by_any } /// A wildcard constructor that we split relative to the constructors in the matrix, as explained @@ -1144,6 +1150,7 @@ impl<'p, 'tcx> Fields<'p, 'tcx> { }) } + // tidy-ticket-wildcards /// Creates a new list of wildcard fields for a given constructor. The result must have a /// length of `constructor.arity()`. #[instrument(level = "trace")] @@ -1188,6 +1195,7 @@ impl<'p, 'tcx> Fields<'p, 'tcx> { debug!(?ret); ret } + // tidy-ticket-wildcards /// Returns the list of patterns. pub(super) fn iter_patterns<'a>( diff --git a/compiler/rustc_monomorphize/src/partitioning.rs b/compiler/rustc_monomorphize/src/partitioning.rs index 1d8cbe0e21b7d..8e30f4c926936 100644 --- a/compiler/rustc_monomorphize/src/partitioning.rs +++ b/compiler/rustc_monomorphize/src/partitioning.rs @@ -473,6 +473,8 @@ fn merge_codegen_units<'tcx>( codegen_units.sort_by_key(|cgu| cmp::Reverse(cgu.size_estimate())); let num_digits = codegen_units.len().ilog10() as usize + 1; for (index, cgu) in codegen_units.iter_mut().enumerate() { + // tidy-ticket-short_description + // FIXME: is it sync? // Note: `WorkItem::short_description` depends on this name ending // with `-cgu.` followed by a numeric suffix. Please keep it in // sync with this code. @@ -480,6 +482,7 @@ fn merge_codegen_units<'tcx>( let numbered_codegen_unit_name = cgu_name_builder.build_cgu_name_no_mangle(LOCAL_CRATE, &["cgu"], Some(suffix)); cgu.set_name(numbered_codegen_unit_name); + // tidy-ticket-short_description } } } diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index f4cee3a661e65..047cb3c368691 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -2081,6 +2081,7 @@ impl<'a> Parser<'a> { } } + // tidy-ticket-rustc_parse-can_begin_literal_maybe_minus /// Matches `'-' lit | lit` (cf. `ast_validation::AstValidator::check_expr_within_pat`). /// Keep this in sync with `Token::can_begin_literal_maybe_minus`. pub fn parse_literal_maybe_minus(&mut self) -> PResult<'a, P> { @@ -2097,6 +2098,7 @@ impl<'a> Parser<'a> { Ok(expr) } } + // tidy-ticket-rustc_parse-can_begin_literal_maybe_minus fn is_array_like_block(&mut self) -> bool { self.look_ahead(1, |t| matches!(t.kind, TokenKind::Ident(..) | TokenKind::Literal(_))) diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index d29ab02c1a6ac..657aa2165988a 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -1210,6 +1210,7 @@ pub const fn default_lib_output() -> CrateType { fn default_configuration(sess: &Session) -> CrateConfig { // NOTE: This should be kept in sync with `CrateCheckConfig::fill_well_known` below. + // FIXME: what exactly sync there? let end = &sess.target.endian; let arch = &sess.target.arch; let wordsz = sess.target.pointer_width.to_string(); diff --git a/compiler/rustc_session/src/config/sigpipe.rs b/compiler/rustc_session/src/config/sigpipe.rs index 53692ad7cc92b..24140d3c93416 100644 --- a/compiler/rustc_session/src/config/sigpipe.rs +++ b/compiler/rustc_session/src/config/sigpipe.rs @@ -1,3 +1,4 @@ +// tidy-ticket-sigpipe //! NOTE: Keep these constants in sync with `library/std/src/sys/unix/mod.rs`! /// The default value if `#[unix_sigpipe]` is not specified. This resolves @@ -23,3 +24,4 @@ pub const SIG_IGN: u8 = 2; /// such as `head -n 1`. #[allow(dead_code)] pub const SIG_DFL: u8 = 3; +// tidy-ticket-sigpipe diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index c1424db600eff..16daab2757cdd 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -1749,12 +1749,15 @@ written to standard error output)"), `instructions:u` (retired instructions, userspace-only) `instructions-minus-irqs:u` (subtracting hardware interrupt counts for extra accuracy)" ), - /// keep this in sync with the event filter names in librustc_data_structures/profiling.rs + // tidy-ticket-self-profile-events + /// keep this in sync with the event filter names in rustc_data_structures/src/profiling.rs self_profile_events: Option> = (None, parse_opt_comma_list, [UNTRACKED], "specify the events recorded by the self profiler; for example: `-Z self-profile-events=default,query-keys` - all options: none, all, default, generic-activity, query-provider, query-cache-hit - query-blocked, incr-cache-load, incr-result-hashing, query-keys, function-args, args, llvm, artifact-sizes"), + all options: none, all, default, generic-activity, query-provider, query-cache-hit, + query-blocked, incr-cache-load, query-keys, function-args, args, llvm, incr-result-hashing, artifact-sizes"), + // tidy-ticket-self-profile-events + share_generics: Option = (None, parse_opt_bool, [TRACKED], "make the current crate share its generic instantiations"), show_span: Option = (None, parse_opt_string, [TRACKED], diff --git a/compiler/rustc_trait_selection/src/solve/assembly/structural_traits.rs b/compiler/rustc_trait_selection/src/solve/assembly/structural_traits.rs index 26c68acddffef..9f2fdc31cda7a 100644 --- a/compiler/rustc_trait_selection/src/solve/assembly/structural_traits.rs +++ b/compiler/rustc_trait_selection/src/solve/assembly/structural_traits.rs @@ -213,6 +213,7 @@ pub(in crate::solve) fn instantiate_constituent_tys_for_copy_clone_trait<'tcx>( } } +// tidy-ticket-extract_tupled_inputs_and_output_from_callable // Returns a binder of the tupled inputs types and output type from a builtin callable type. pub(in crate::solve) fn extract_tupled_inputs_and_output_from_callable<'tcx>( tcx: TyCtxt<'tcx>, @@ -234,6 +235,7 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_callable<'tcx>( Err(NoSolution) } } + // keep this in sync with assemble_fn_pointer_candidates until the old solver is removed. ty::FnPtr(sig) => { if sig.is_fn_trait_compatible() { @@ -291,6 +293,7 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_callable<'tcx>( } } } +// tidy-ticket-extract_tupled_inputs_and_output_from_callable /// Assemble a list of predicates that would be present on a theoretical /// user impl for an object type. These predicates must be checked any time diff --git a/compiler/rustc_trait_selection/src/solve/eval_ctxt/select.rs b/compiler/rustc_trait_selection/src/solve/eval_ctxt/select.rs index 315df06be417c..a73a1986d67c8 100644 --- a/compiler/rustc_trait_selection/src/solve/eval_ctxt/select.rs +++ b/compiler/rustc_trait_selection/src/solve/eval_ctxt/select.rs @@ -216,6 +216,7 @@ fn rematch_impl<'tcx>( Ok(Some(ImplSource::UserDefined(ImplSourceUserDefinedData { impl_def_id, args, nested }))) } +// tidy-ticket-rematch_unsize /// The `Unsize` trait is particularly important to coercion, so we try rematch it. /// NOTE: This must stay in sync with `consider_builtin_unsize_candidate` in trait /// goal assembly in the solver, both for soundness and in order to avoid ICEs. @@ -377,6 +378,7 @@ fn rematch_unsize<'tcx>( } } } +// tidy-ticket-rematch_unsize fn structurally_normalize<'tcx>( ty: Ty<'tcx>, diff --git a/compiler/rustc_trait_selection/src/solve/trait_goals.rs b/compiler/rustc_trait_selection/src/solve/trait_goals.rs index 8055c63b9f301..ed43ca0f00c3a 100644 --- a/compiler/rustc_trait_selection/src/solve/trait_goals.rs +++ b/compiler/rustc_trait_selection/src/solve/trait_goals.rs @@ -423,6 +423,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { ecx.evaluate_added_goals_and_make_canonical_response(certainty) } + // tidy-ticket-consider_builtin_unsize_candidate fn consider_unsize_to_dyn_candidate( ecx: &mut EvalCtxt<'_, 'tcx>, goal: Goal<'tcx, Self>, @@ -463,6 +464,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> { ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes) }) } + // tidy-ticket-consider_builtin_unsize_candidate /// ```ignore (builtin impl example) /// trait Trait { diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs index 154cc7a71416e..ab2b1fc939dff 100644 --- a/compiler/rustc_trait_selection/src/traits/project.rs +++ b/compiler/rustc_trait_selection/src/traits/project.rs @@ -1732,6 +1732,7 @@ fn assemble_candidates_from_impls<'cx, 'tcx>( }; let eligible = match &impl_source { + // tidy-ticket-assemble_candidates_from_impls-UserDefined ImplSource::UserDefined(impl_data) => { // We have to be careful when projecting out of an // impl because of specialization. If we are not in @@ -1782,6 +1783,8 @@ fn assemble_candidates_from_impls<'cx, 'tcx>( } } } + // tidy-ticket-assemble_candidates_from_impls-UserDefined + ImplSource::Builtin(BuiltinImplSource::Misc, _) => { // While a builtin impl may be known to exist, the associated type may not yet // be known. Any type with multiple potential associated types is therefore diff --git a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs index bead8758ad604..0c4c7edc06763 100644 --- a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs +++ b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs @@ -286,6 +286,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { } } + // tidy-ticket-assemble_fn_pointer_candidates /// Implements one of the `Fn()` family for a fn pointer. fn assemble_fn_pointer_candidates( &mut self, @@ -307,12 +308,15 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { debug!("assemble_fn_pointer_candidates: ambiguous self-type"); candidates.ambiguous = true; // Could wind up being a fn() type. } + + // tidy-ticket-extract_tupled_inputs_and_output_from_callable-FnPtr // Provide an impl, but only for suitable `fn` pointers. ty::FnPtr(sig) => { if sig.is_fn_trait_compatible() { candidates.vec.push(FnPointerCandidate { is_const: false }); } } + // Provide an impl for suitable functions, rejecting `#[target_feature]` functions (RFC 2396). ty::FnDef(def_id, _) => { if self.tcx().fn_sig(def_id).skip_binder().is_fn_trait_compatible() @@ -326,6 +330,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { _ => {} } } + // tidy-ticket-assemble_fn_pointer_candidates /// Searches for impls that might apply to `obligation`. #[instrument(level = "debug", skip(self, candidates))] diff --git a/compiler/rustc_ty_utils/src/instance.rs b/compiler/rustc_ty_utils/src/instance.rs index 91f1c21310e30..0792ffa434fbc 100644 --- a/compiler/rustc_ty_utils/src/instance.rs +++ b/compiler/rustc_ty_utils/src/instance.rs @@ -95,6 +95,7 @@ fn resolve_associated_item<'tcx>( // Now that we know which impl is being used, we can dispatch to // the actual function: Ok(match vtbl { + // tidy-ticket-resolve_associated_item-UserDefined traits::ImplSource::UserDefined(impl_data) => { debug!( "resolving ImplSource::UserDefined: {:?}, {:?}, {:?}, {:?}", @@ -196,6 +197,7 @@ fn resolve_associated_item<'tcx>( Some(ty::Instance::new(leaf_def.item.def_id, args)) } + // tidy-ticket-resolve_associated_item-UserDefined traits::ImplSource::Builtin(BuiltinImplSource::Object { vtable_base }, _) => { traits::get_vtable_index_of_object_method(tcx, *vtable_base, trait_item_id).map( |index| Instance { diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs index 96b93830f9600..77ce98519d640 100644 --- a/library/alloc/src/boxed.rs +++ b/library/alloc/src/boxed.rs @@ -189,6 +189,8 @@ mod thin; #[lang = "owned_box"] #[fundamental] #[stable(feature = "rust1", since = "1.0.0")] +// FIXME: box_free was removed in https://github.com/rust-lang/rust/commit/67b0cfc761c9ad31a1dbacca36c42803b255f17a +// so fix documentation here // The declaration of the `Box` struct must be kept in sync with the // `alloc::alloc::box_free` function or ICEs will happen. See the comment // on `box_free` for more details. diff --git a/library/core/src/ptr/metadata.rs b/library/core/src/ptr/metadata.rs index 040aa06978748..6343b72d54319 100644 --- a/library/core/src/ptr/metadata.rs +++ b/library/core/src/ptr/metadata.rs @@ -54,10 +54,12 @@ use crate::hash::{Hash, Hasher}; pub trait Pointee { /// The type for metadata in pointers and references to `Self`. #[lang = "metadata_type"] + // tidy-ticket-static_assert_expected_bounds_for_metadata // NOTE: Keep trait bounds in `static_assert_expected_bounds_for_metadata` - // in `library/core/src/ptr/metadata.rs` + // in `library/core/tests/ptr.rs` // in sync with those here: type Metadata: Copy + Send + Sync + Ord + Hash + Unpin; + // tidy-ticket-static_assert_expected_bounds_for_metadata } /// Pointers to types implementing this trait alias are “thin”. diff --git a/library/core/tests/ptr.rs b/library/core/tests/ptr.rs index ee885adfeee61..f6432ea6f6165 100644 --- a/library/core/tests/ptr.rs +++ b/library/core/tests/ptr.rs @@ -822,12 +822,15 @@ fn ptr_metadata_bounds() { let _ = static_assert_expected_bounds_for_metadata::<::Metadata>; } + // tidy-ticket-static_assert_expected_bounds_for_metadata + // FIXME: should be core::hash::hash? fn static_assert_expected_bounds_for_metadata() where // Keep this in sync with the associated type in `library/core/src/ptr/metadata.rs` Meta: Copy + Send + Sync + Ord + std::hash::Hash + Unpin, { } + // tidy-ticket-static_assert_expected_bounds_for_metadata } #[test] diff --git a/library/std/src/sys/unix/mod.rs b/library/std/src/sys/unix/mod.rs index 3edafde71e937..a67d712da3033 100644 --- a/library/std/src/sys/unix/mod.rs +++ b/library/std/src/sys/unix/mod.rs @@ -179,6 +179,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) { target_vendor = "unikraft", )))] { + // tidy-ticket-sigpipe // We don't want to add this as a public type to std, nor do we // want to `include!` a file from the compiler (which would break // Miri and xargo for example), so we choose to duplicate these @@ -191,6 +192,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) { pub const SIG_IGN: u8 = 2; pub const SIG_DFL: u8 = 3; } + // tidy-ticket-sigpipe let (sigpipe_attr_specified, handler) = match sigpipe { sigpipe::DEFAULT => (false, Some(libc::SIG_IGN)), diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 3e6066c78fba2..812428d91d068 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -316,10 +316,13 @@ pub(crate) fn run_global_ctxt( tcx.hir().for_each_module(|module| tcx.ensure().collect_mod_item_types(module)) }); - // NOTE: This is copy/pasted from typeck/lib.rs and should be kept in sync with those changes. + // tidy-ticket-sess-time-item_types_checking + // NOTE: This is copy/pasted from rustc_hir_analysis/src/lib.rs and should be kept in sync with those changes. tcx.sess.time("item_types_checking", || { tcx.hir().for_each_module(|module| tcx.ensure().check_mod_item_types(module)) }); + // tidy-ticket-sess-time-item_types_checking + tcx.sess.abort_if_errors(); tcx.sess.time("missing_docs", || rustc_lint::check_crate(tcx)); tcx.sess.time("check_mod_attrs", || { diff --git a/src/librustdoc/doctest.rs b/src/librustdoc/doctest.rs index 741d329fb1922..601c133c935ed 100644 --- a/src/librustdoc/doctest.rs +++ b/src/librustdoc/doctest.rs @@ -282,6 +282,7 @@ impl DirState { } } +// tidy-ticket-UnusedExterns // NOTE: Keep this in sync with the equivalent structs in rustc // and cargo. // We could unify this struct the one in rustc but they have different @@ -293,6 +294,7 @@ struct UnusedExterns { /// List of unused externs by their names. unused_extern_names: Vec, } +// tidy-ticket-UnusedExterns fn add_exe_suffix(input: String, target: &TargetTriple) -> String { let exe_suffix = match target { diff --git a/src/tools/opt-dist/src/main.rs b/src/tools/opt-dist/src/main.rs index 978e2dfa4e864..9c46630eeaf1c 100644 --- a/src/tools/opt-dist/src/main.rs +++ b/src/tools/opt-dist/src/main.rs @@ -376,10 +376,11 @@ fn copy_rustc_perf(env: &Environment, dir: &Utf8Path) -> anyhow::Result<()> { fn download_rustc_perf(env: &Environment) -> anyhow::Result<()> { reset_directory(&env.rustc_perf_dir())?; - // FIXME: add some mechanism for synchronization of this commit SHA with + // tidy-ticket-perf-commit // Linux (which builds rustc-perf in a Dockerfile) // rustc-perf version from 2023-05-30 const PERF_COMMIT: &str = "8b2ac3042e1ff2c0074455a0a3618adef97156b1"; + // tidy-ticket-perf-commit let url = format!("https://ci-mirrors.rust-lang.org/rustc/rustc-perf-{PERF_COMMIT}.zip"); let client = reqwest::blocking::Client::builder() diff --git a/src/tools/tidy/src/watcher.rs b/src/tools/tidy/src/watcher.rs index a5e50543afea2..cc2e822ce61cf 100644 --- a/src/tools/tidy/src/watcher.rs +++ b/src/tools/tidy/src/watcher.rs @@ -61,7 +61,8 @@ fn span_hash(source: &str, tag: &str, bad: &mut bool) -> Result { } fn check_entry(entry: &ListEntry<'_>, bad: &mut bool, root_path: &Path) { - let file = fs::read_to_string(root_path.join(Path::new(entry.0))).unwrap(); + let file = fs::read_to_string(root_path.join(Path::new(entry.0))) + .unwrap_or_else(|e| panic!("{:?}, path: {}", e, entry.0)); let actual_hash = span_hash(&file, entry.2, bad).unwrap(); if actual_hash != entry.1 { // Write tidy error description for wather only once. @@ -91,8 +92,56 @@ type ListEntry<'a> = (&'a str, &'a str, &'a str); /// List of tags to watch, along with paths and hashes #[rustfmt::skip] const TIDY_WATCH_LIST: &[ListEntry<'_>] = &[ - ("src/tools/opt-dist/src/environment/windows.rs", "dcad53f163a2775164b5d2faaa70b653", "tidy-ticket-perf-commit"), + // sync perf commit across dockerfile and opt-dist + ("src/tools/opt-dist/src/main.rs", "728c2783154a52a30bdb1d66f8ea1f2a", "tidy-ticket-perf-commit"), ("src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile", "76c8d9783e38e25a461355f82fcd7955", "tidy-ticket-perf-commit"), + + ("compiler/rustc_ast/src/token.rs", "70666de80ab0194a67524deeda3c01b8", "tidy-ticket-ast-from_token"), + ("compiler/rustc_ast/src/token.rs", "9a78008a2377486eadf19d67ee4fdce2", "tidy-ticket-ast-can_begin_literal_maybe_minus"), + ("compiler/rustc_parse/src/parser/expr.rs", "500240cdc80690209060fdce10ce065a", "tidy-ticket-rustc_parse-can_begin_literal_maybe_minus"), + + ("compiler/rustc_builtin_macros/src/assert/context.rs", "81bd6f37797c22fce5c85a4b590b3856", "tidy-ticket-all-expr-kinds"), + ("tests/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs", "78ce54cc25baeac3ae07c876db25180c", "tidy-ticket-all-expr-kinds"), + + ("compiler/rustc_const_eval/src/interpret/validity.rs", "91c69e391741f64b7624e1bda4b31bc3", "tidy-ticket-try_visit_primitive"), + ("compiler/rustc_const_eval/src/interpret/validity.rs", "05e496c9ca019273c49ba9de48b5da23", "tidy-ticket-visit_value"), + + // sync self-profile-events help mesage with actual list of events + ("compiler/rustc_data_structures/src/profiling.rs", "881e7899c7d6904af1bc000594ee0418", "tidy-ticket-self-profile-events"), + ("compiler/rustc_session/src/options.rs", "012ee5a3b61ee1377744e5c6913fa00a", "tidy-ticket-self-profile-events"), + + ("compiler/rustc_errors/src/json.rs", "5907da5c0476785fe2aae4d0d62f7171", "tidy-ticket-UnusedExterns"), + ("src/librustdoc/doctest.rs", "b5bb5128abb4a2dbb47bb1a1a083ba9b", "tidy-ticket-UnusedExterns"), + + ("compiler/rustc_middle/src/ty/util.rs", "cae64b1bc854e7ee81894212facb5bfa", "tidy-ticket-static_ptr_ty"), + ("compiler/rustc_middle/src/ty/util.rs", "6f5ead08474b4d3e358db5d3c7aef970", "tidy-ticket-thread_local_ptr_ty"), + + ("compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs", "8ac64f1266a60bb7b11d80ac764e5154", "tidy-ticket-arity"), + ("compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs", "2bab79a2441e8ffae79b7dc3befe91cf", "tidy-ticket-wildcards"), + + ("compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs", "3844ca4b7b45be1c721c17808ee5b2e2", "tidy-ticket-is_covered_by"), + ("compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs", "4d296b7b1f48a9dd92e8bb8cd3344718", "tidy-ticket-is_covered_by_any"), + + ("compiler/rustc_monomorphize/src/partitioning.rs", "f4f33e9c14f4e0c3a20b5240ae36a7c8", "tidy-ticket-short_description"), + ("compiler/rustc_codegen_ssa/src/back/write.rs", "5286f7f76fcf564c98d7a8eaeec39b18", "tidy-ticket-short_description"), + + ("compiler/rustc_session/src/config/sigpipe.rs", "8d765a5c613d931852c0f59ed1997dcd", "tidy-ticket-sigpipe"), + ("library/std/src/sys/unix/mod.rs", "2cdc37081831cdcf44f3331efbe440af", "tidy-ticket-sigpipe"), + + ("compiler/rustc_trait_selection/src/solve/assembly/structural_traits.rs", "b205939890472130649d5fd4fc86a992", "tidy-ticket-extract_tupled_inputs_and_output_from_callable"), + ("compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs", "e9a77bba86a02702af65b2713af47394", "tidy-ticket-assemble_fn_pointer_candidates"), + + ("compiler/rustc_trait_selection/src/solve/eval_ctxt/select.rs", "d0c807d90501f3f63dffc3e7ec046c20", "tidy-ticket-rematch_unsize"), + ("compiler/rustc_trait_selection/src/solve/trait_goals.rs", "f1b0ce28128b5d5a5b545af3f3cf55f4", "tidy-ticket-consider_builtin_unsize_candidate"), + + ("compiler/rustc_trait_selection/src/traits/project.rs", "66585f93352fe56a5be6cc5a63bcc756", "tidy-ticket-assemble_candidates_from_impls-UserDefined"), + ("compiler/rustc_ty_utils/src/instance.rs", "e8b404fd4160512708f922140a8bb187", "tidy-ticket-resolve_associated_item-UserDefined"), + + ("compiler/rustc_hir_analysis/src/lib.rs", "842e23fb65caf3a96681686131093316", "tidy-ticket-sess-time-item_types_checking"), + ("src/librustdoc/core.rs", "d11d64105aa952bbf3c0c2f211135c43", "tidy-ticket-sess-time-item_types_checking"), + + ("library/core/src/ptr/metadata.rs", "57fc0e05c177c042c9766cc1134ae240", "tidy-ticket-static_assert_expected_bounds_for_metadata"), + ("library/core/tests/ptr.rs", "13ecb32e2a0db0998ff94f33a30f5cfd", "tidy-ticket-static_assert_expected_bounds_for_metadata"), ]; pub fn check(root_path: &Path, bad: &mut bool) { diff --git a/tests/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs b/tests/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs index b1db05afd080b..16de6415c8013 100644 --- a/tests/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs +++ b/tests/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs @@ -7,6 +7,7 @@ #![allow(path_statements, unused_allocation)] #![feature(core_intrinsics, generic_assert)] +// tidy-ticket-all-expr-kinds macro_rules! test { ( let mut $elem_ident:ident = $elem_expr:expr; @@ -118,3 +119,4 @@ fn main() { [ -elem == -3 ] => "Assertion failed: -elem == -3\nWith captures:\n elem = 1\n" ); } +// tidy-ticket-all-expr-kinds