Skip to content

Commit 0b311d0

Browse files
committed
add tidy-keep-sync-with prefix around
1 parent 4d09021 commit 0b311d0

File tree

28 files changed

+67
-66
lines changed

28 files changed

+67
-66
lines changed

compiler/rustc_ast/src/token.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ impl Lit {
104104
}
105105
}
106106

107-
// tidy-ticket-ast-from_token
107+
// tidy-keep-sync-with=tidy-ticket-ast-from_token
108108
/// Keep this in sync with `Token::can_begin_literal_or_bool` excluding unary negation.
109109
pub fn from_token(token: &Token) -> Option<Lit> {
110110
match token.uninterpolate().kind {
@@ -119,7 +119,7 @@ impl Lit {
119119
_ => None,
120120
}
121121
}
122-
// tidy-ticket-ast-from_token
122+
// tidy-keep-sync-with=tidy-ticket-ast-from_token
123123
}
124124

125125
impl fmt::Display for Lit {
@@ -573,7 +573,7 @@ impl Token {
573573
///
574574
/// In other words, would this token be a valid start of `parse_literal_maybe_minus`?
575575
///
576-
// tidy-ticket-ast-can_begin_literal_maybe_minus
576+
// tidy-keep-sync-with=tidy-ticket-ast-can_begin_literal_maybe_minus
577577
/// Keep this in sync with and `Lit::from_token`, excluding unary negation.
578578
pub fn can_begin_literal_maybe_minus(&self) -> bool {
579579
match self.uninterpolate().kind {
@@ -593,7 +593,7 @@ impl Token {
593593
_ => false,
594594
}
595595
}
596-
// tidy-ticket-ast-can_begin_literal_maybe_minus
596+
// tidy-keep-sync-with=tidy-ticket-ast-can_begin_literal_maybe_minus
597597

598598
/// A convenience function for matching on identifiers during parsing.
599599
/// Turns interpolated identifier (`$i: ident`) or lifetime (`$l: lifetime`) token

compiler/rustc_builtin_macros/src/assert/context.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ impl<'cx, 'a> Context<'cx, 'a> {
290290
}
291291
// Expressions that are not worth or can not be captured.
292292
//
293-
// tidy-ticket-all-expr-kinds
293+
// tidy-keep-sync-with=tidy-ticket-all-expr-kinds
294294
// Full list instead of `_` to catch possible future inclusions and to
295295
// sync with the `rfc-2011-nicer-assert-messages/all-expr-kinds.rs` test.
296296
ExprKind::Assign(_, _, _)
@@ -322,7 +322,7 @@ impl<'cx, 'a> Context<'cx, 'a> {
322322
| ExprKind::Yeet(_)
323323
| ExprKind::Become(_)
324324
| ExprKind::Yield(_) => {}
325-
// tidy-ticket-all-expr-kinds
325+
// tidy-keep-sync-with=tidy-ticket-all-expr-kinds
326326
}
327327
}
328328

compiler/rustc_codegen_ssa/src/back/write.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ impl<B: WriteBackendMethods> WorkItem<B> {
711711
}
712712
}
713713

714-
// tidy-ticket-short_description
714+
// tidy-keep-sync-with=tidy-ticket-short_description
715715
/// Generate a short description of this work item suitable for use as a thread name.
716716
fn short_description(&self) -> String {
717717
// `pthread_setname()` on *nix ignores anything beyond the first 15
@@ -759,7 +759,7 @@ impl<B: WriteBackendMethods> WorkItem<B> {
759759
WorkItem::LTO(m) => desc("lto", "LTO module", m.name()),
760760
}
761761
}
762-
// tidy-ticket-short_description
762+
// tidy-keep-sync-with=tidy-ticket-short_description
763763
}
764764

765765
/// A result produced by the backend.

compiler/rustc_const_eval/src/interpret/validity.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
511511
Ok(true)
512512
}
513513
ty::Float(_) | ty::Int(_) | ty::Uint(_) => {
514-
// tidy-ticket-try_visit_primitive
514+
// tidy-keep-sync-with=tidy-ticket-try_visit_primitive
515515
// NOTE: Keep this in sync with the array optimization for int/float
516516
// types below!
517517
self.read_scalar(
@@ -523,7 +523,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
523523
},
524524
)?;
525525
Ok(true)
526-
// tidy-ticket-try_visit_primitive
526+
// tidy-keep-sync-with=tidy-ticket-try_visit_primitive
527527
}
528528
ty::RawPtr(..) => {
529529
let place =
@@ -786,7 +786,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M>
786786
}
787787
};
788788

789-
// tidy-ticket-visit_value
789+
// tidy-keep-sync-with=tidy-ticket-visit_value
790790
// Optimization: we just check the entire range at once.
791791
// NOTE: Keep this in sync with the handling of integer and float
792792
// types above, in `try_visit_primitive`.
@@ -823,7 +823,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M>
823823
}
824824
}
825825
}
826-
// tidy-ticket-visit_value
826+
// tidy-keep-sync-with=tidy-ticket-visit_value
827827
}
828828
// Fast path for arrays and slices of ZSTs. We only need to check a single ZST element
829829
// of an array and not all of them, because there's only a single value of a specific

compiler/rustc_data_structures/src/profiling.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ bitflags::bitflags! {
125125
}
126126
}
127127

128-
// tidy-ticket-self-profile-events
128+
// tidy-keep-sync-with=tidy-ticket-self-profile-events
129129
// keep this in sync with the `-Z self-profile-events` help message in rustc_session/options.rs
130130
const EVENT_FILTERS_BY_NAME: &[(&str, EventFilter)] = &[
131131
("none", EventFilter::empty()),
@@ -143,7 +143,7 @@ const EVENT_FILTERS_BY_NAME: &[(&str, EventFilter)] = &[
143143
("incr-result-hashing", EventFilter::INCR_RESULT_HASHING),
144144
("artifact-sizes", EventFilter::ARTIFACT_SIZES),
145145
];
146-
// tidy-ticket-self-profile-events
146+
// tidy-keep-sync-with=tidy-ticket-self-profile-events
147147

148148
/// Something that uniquely identifies a query invocation.
149149
pub struct QueryInvocationId(pub u32);

compiler/rustc_errors/src/json.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ struct FutureIncompatReport {
322322
future_incompat_report: Vec<FutureBreakageItem>,
323323
}
324324

325-
// tidy-ticket-UnusedExterns
325+
// tidy-keep-sync-with=tidy-ticket-UnusedExterns
326326
// FIXME: where it located in cargo?
327327
// NOTE: Keep this in sync with the equivalent structs in rustdoc's
328328
// doctest component (as well as cargo).
@@ -335,7 +335,7 @@ struct UnusedExterns<'a, 'b, 'c> {
335335
/// List of unused externs by their names.
336336
unused_extern_names: &'b [&'c str],
337337
}
338-
// tidy-ticket-UnusedExterns
338+
// tidy-keep-sync-with=tidy-ticket-UnusedExterns
339339

340340
impl Diagnostic {
341341
fn from_errors_diagnostic(diag: &crate::Diagnostic, je: &JsonEmitter) -> Diagnostic {

compiler/rustc_hir_analysis/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,12 @@ pub fn check_crate(tcx: TyCtxt<'_>) -> Result<(), ErrorGuaranteed> {
206206
tcx.hir().try_par_for_each_module(|module| tcx.ensure().check_mod_type_wf(module))
207207
});
208208

209-
// tidy-ticket-sess-time-item_types_checking
209+
// tidy-keep-sync-with=tidy-ticket-sess-time-item_types_checking
210210
// NOTE: This is copy/pasted in librustdoc/core.rs and should be kept in sync.
211211
tcx.sess.time("item_types_checking", || {
212212
tcx.hir().for_each_module(|module| tcx.ensure().check_mod_item_types(module))
213213
});
214-
// tidy-ticket-sess-time-item_types_checking
214+
// tidy-keep-sync-with=tidy-ticket-sess-time-item_types_checking
215215

216216
// HACK: `check_mod_type_wf` may spuriously emit errors due to `delay_span_bug`, even if those errors
217217
// only actually get emitted in `check_mod_item_types`.

compiler/rustc_middle/src/ty/util.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ impl<'tcx> TyCtxt<'tcx> {
653653
&& !self.is_foreign_item(def_id)
654654
}
655655

656-
// tidy-ticket-thread_local_ptr_ty
656+
// tidy-keep-sync-with=tidy-ticket-thread_local_ptr_ty
657657
/// Returns the type a reference to the thread local takes in MIR.
658658
pub fn thread_local_ptr_ty(self, def_id: DefId) -> Ty<'tcx> {
659659
let static_ty = self.type_of(def_id).instantiate_identity();
@@ -666,7 +666,7 @@ impl<'tcx> TyCtxt<'tcx> {
666666
Ty::new_imm_ref(self, self.lifetimes.re_static, static_ty)
667667
}
668668
}
669-
// tidy-ticket-thread_local_ptr_ty
669+
// tidy-keep-sync-with=tidy-ticket-thread_local_ptr_ty
670670

671671
/// Get the type of the pointer to the static that we use in MIR.
672672
pub fn static_ptr_ty(self, def_id: DefId) -> Ty<'tcx> {
@@ -676,7 +676,7 @@ impl<'tcx> TyCtxt<'tcx> {
676676
self.type_of(def_id).instantiate_identity(),
677677
);
678678

679-
// tidy-ticket-static_ptr_ty
679+
// tidy-keep-sync-with=tidy-ticket-static_ptr_ty
680680
// Make sure that accesses to unsafe statics end up using raw pointers.
681681
// FIXME: should it said sync with thread_local_ptr_ty?
682682
// For thread-locals, this needs to be kept in sync with `Rvalue::ty`.
@@ -687,7 +687,7 @@ impl<'tcx> TyCtxt<'tcx> {
687687
} else {
688688
Ty::new_imm_ref(self, self.lifetimes.re_erased, static_ty)
689689
}
690-
// tidy-ticket-static_ptr_ty
690+
// tidy-keep-sync-with=tidy-ticket-static_ptr_ty
691691
}
692692

693693
/// Return the set of types that should be taken into account when checking

compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ impl<'tcx> Constructor<'tcx> {
703703
}
704704
}
705705

706-
// tidy-ticket-arity
706+
// tidy-keep-sync-with=tidy-ticket-arity
707707
/// The number of fields for this constructor. This must be kept in sync with
708708
/// `Fields::wildcards`.
709709
pub(super) fn arity(&self, pcx: &PatCtxt<'_, '_, 'tcx>) -> usize {
@@ -737,7 +737,7 @@ impl<'tcx> Constructor<'tcx> {
737737
Or => bug!("The `Or` constructor doesn't have a fixed arity"),
738738
}
739739
}
740-
// tidy-ticket-arity
740+
// tidy-keep-sync-with=tidy-ticket-arity
741741

742742
/// Some constructors (namely `Wildcard`, `IntRange` and `Slice`) actually stand for a set of
743743
/// actual constructors (like variants, integers or fixed-sized slices). When specializing for
@@ -1307,7 +1307,7 @@ impl<'p, 'tcx> Fields<'p, 'tcx> {
13071307
})
13081308
}
13091309

1310-
// tidy-ticket-wildcards
1310+
// tidy-keep-sync-with=tidy-ticket-wildcards
13111311
/// Creates a new list of wildcard fields for a given constructor. The result must have a
13121312
/// length of `constructor.arity()`.
13131313
#[instrument(level = "trace")]
@@ -1354,7 +1354,7 @@ impl<'p, 'tcx> Fields<'p, 'tcx> {
13541354
debug!(?ret);
13551355
ret
13561356
}
1357-
// tidy-ticket-wildcards
1357+
// tidy-keep-sync-with=tidy-ticket-wildcards
13581358

13591359
/// Returns the list of patterns.
13601360
pub(super) fn iter_patterns<'a>(

compiler/rustc_monomorphize/src/partitioning.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ fn merge_codegen_units<'tcx>(
472472
codegen_units.sort_by_key(|cgu| cmp::Reverse(cgu.size_estimate()));
473473
let num_digits = codegen_units.len().ilog10() as usize + 1;
474474
for (index, cgu) in codegen_units.iter_mut().enumerate() {
475-
// tidy-ticket-short_description
475+
// tidy-keep-sync-with=tidy-ticket-short_description
476476
// FIXME: is it sync?
477477
// Note: `WorkItem::short_description` depends on this name ending
478478
// with `-cgu.` followed by a numeric suffix. Please keep it in
@@ -481,7 +481,7 @@ fn merge_codegen_units<'tcx>(
481481
let numbered_codegen_unit_name =
482482
cgu_name_builder.build_cgu_name_no_mangle(LOCAL_CRATE, &["cgu"], Some(suffix));
483483
cgu.set_name(numbered_codegen_unit_name);
484-
// tidy-ticket-short_description
484+
// tidy-keep-sync-with=tidy-ticket-short_description
485485
}
486486
}
487487
}

compiler/rustc_parse/src/parser/expr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2087,7 +2087,7 @@ impl<'a> Parser<'a> {
20872087
}
20882088
}
20892089

2090-
// tidy-ticket-rustc_parse-can_begin_literal_maybe_minus
2090+
// tidy-keep-sync-with=tidy-ticket-rustc_parse-can_begin_literal_maybe_minus
20912091
/// Matches `'-' lit | lit` (cf. `ast_validation::AstValidator::check_expr_within_pat`).
20922092
/// Keep this in sync with `Token::can_begin_literal_maybe_minus`.
20932093
pub fn parse_literal_maybe_minus(&mut self) -> PResult<'a, P<Expr>> {
@@ -2104,7 +2104,7 @@ impl<'a> Parser<'a> {
21042104
Ok(expr)
21052105
}
21062106
}
2107-
// tidy-ticket-rustc_parse-can_begin_literal_maybe_minus
2107+
// tidy-keep-sync-with=tidy-ticket-rustc_parse-can_begin_literal_maybe_minus
21082108

21092109
fn is_array_like_block(&mut self) -> bool {
21102110
self.look_ahead(1, |t| matches!(t.kind, TokenKind::Ident(..) | TokenKind::Literal(_)))

compiler/rustc_session/src/config/sigpipe.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// tidy-ticket-sigpipe
1+
// tidy-keep-sync-with=tidy-ticket-sigpipe
22
//! NOTE: Keep these constants in sync with `library/std/src/sys/unix/mod.rs`!
33
44
/// The default value if `#[unix_sigpipe]` is not specified. This resolves
@@ -24,4 +24,4 @@ pub const SIG_IGN: u8 = 2;
2424
/// such as `head -n 1`.
2525
#[allow(dead_code)]
2626
pub const SIG_DFL: u8 = 3;
27-
// tidy-ticket-sigpipe
27+
// tidy-keep-sync-with=tidy-ticket-sigpipe

compiler/rustc_session/src/options.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1779,14 +1779,14 @@ written to standard error output)"),
17791779
`instructions:u` (retired instructions, userspace-only)
17801780
`instructions-minus-irqs:u` (subtracting hardware interrupt counts for extra accuracy)"
17811781
),
1782-
// tidy-ticket-self-profile-events
1782+
// tidy-keep-sync-with=tidy-ticket-self-profile-events
17831783
/// keep this in sync with the event filter names in rustc_data_structures/src/profiling.rs
17841784
self_profile_events: Option<Vec<String>> = (None, parse_opt_comma_list, [UNTRACKED],
17851785
"specify the events recorded by the self profiler;
17861786
for example: `-Z self-profile-events=default,query-keys`
17871787
all options: none, all, default, generic-activity, query-provider, query-cache-hit,
17881788
query-blocked, incr-cache-load, query-keys, function-args, args, llvm, incr-result-hashing, artifact-sizes"),
1789-
// tidy-ticket-self-profile-events
1789+
// tidy-keep-sync-with=tidy-ticket-self-profile-events
17901790

17911791
share_generics: Option<bool> = (None, parse_opt_bool, [TRACKED],
17921792
"make the current crate share its generic instantiations"),

compiler/rustc_trait_selection/src/solve/assembly/structural_traits.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ pub(in crate::solve) fn instantiate_constituent_tys_for_copy_clone_trait<'tcx>(
213213
}
214214
}
215215

216-
// tidy-ticket-extract_tupled_inputs_and_output_from_callable
216+
// tidy-keep-sync-with=tidy-ticket-extract_tupled_inputs_and_output_from_callable
217217
// Returns a binder of the tupled inputs types and output type from a builtin callable type.
218218
pub(in crate::solve) fn extract_tupled_inputs_and_output_from_callable<'tcx>(
219219
tcx: TyCtxt<'tcx>,
@@ -293,7 +293,7 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_callable<'tcx>(
293293
}
294294
}
295295
}
296-
// tidy-ticket-extract_tupled_inputs_and_output_from_callable
296+
// tidy-keep-sync-with=tidy-ticket-extract_tupled_inputs_and_output_from_callable
297297

298298
/// Assemble a list of predicates that would be present on a theoretical
299299
/// user impl for an object type. These predicates must be checked any time

compiler/rustc_trait_selection/src/solve/eval_ctxt/select.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ fn rematch_impl<'tcx>(
216216
Ok(Some(ImplSource::UserDefined(ImplSourceUserDefinedData { impl_def_id, args, nested })))
217217
}
218218

219-
// tidy-ticket-rematch_unsize
219+
// tidy-keep-sync-with=tidy-ticket-rematch_unsize
220220
/// The `Unsize` trait is particularly important to coercion, so we try rematch it.
221221
/// NOTE: This must stay in sync with `consider_builtin_unsize_candidate` in trait
222222
/// goal assembly in the solver, both for soundness and in order to avoid ICEs.
@@ -378,7 +378,7 @@ fn rematch_unsize<'tcx>(
378378
}
379379
}
380380
}
381-
// tidy-ticket-rematch_unsize
381+
// tidy-keep-sync-with=tidy-ticket-rematch_unsize
382382

383383
fn structurally_normalize<'tcx>(
384384
ty: Ty<'tcx>,

compiler/rustc_trait_selection/src/solve/trait_goals.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
463463
ecx.evaluate_added_goals_and_make_canonical_response(certainty)
464464
}
465465

466-
// tidy-ticket-consider_builtin_unsize_candidate
466+
// tidy-keep-sync-with=tidy-ticket-consider_builtin_unsize_candidate
467467
fn consider_unsize_to_dyn_candidate(
468468
ecx: &mut EvalCtxt<'_, 'tcx>,
469469
goal: Goal<'tcx, Self>,
@@ -504,7 +504,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
504504
ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
505505
})
506506
}
507-
// tidy-ticket-consider_builtin_unsize_candidate
507+
// tidy-keep-sync-with=tidy-ticket-consider_builtin_unsize_candidate
508508

509509
/// ```ignore (builtin impl example)
510510
/// trait Trait {

compiler/rustc_trait_selection/src/traits/project.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1741,7 +1741,7 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
17411741
};
17421742

17431743
let eligible = match &impl_source {
1744-
// tidy-ticket-assemble_candidates_from_impls-UserDefined
1744+
// tidy-keep-sync-with=tidy-ticket-assemble_candidates_from_impls-UserDefined
17451745
ImplSource::UserDefined(impl_data) => {
17461746
// We have to be careful when projecting out of an
17471747
// impl because of specialization. If we are not in
@@ -1792,7 +1792,7 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
17921792
}
17931793
}
17941794
}
1795-
// tidy-ticket-assemble_candidates_from_impls-UserDefined
1795+
// tidy-keep-sync-with=tidy-ticket-assemble_candidates_from_impls-UserDefined
17961796

17971797
ImplSource::Builtin(BuiltinImplSource::Misc, _) => {
17981798
// While a builtin impl may be known to exist, the associated type may not yet

compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
304304
}
305305
}
306306

307-
// tidy-ticket-assemble_fn_pointer_candidates
307+
// tidy-keep-sync-with=tidy-ticket-assemble_fn_pointer_candidates
308308
/// Implements one of the `Fn()` family for a fn pointer.
309309
fn assemble_fn_pointer_candidates(
310310
&mut self,
@@ -327,7 +327,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
327327
candidates.ambiguous = true; // Could wind up being a fn() type.
328328
}
329329

330-
// tidy-ticket-extract_tupled_inputs_and_output_from_callable-FnPtr
331330
// Provide an impl, but only for suitable `fn` pointers.
332331
ty::FnPtr(sig) => {
333332
if sig.is_fn_trait_compatible() {
@@ -348,7 +347,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
348347
_ => {}
349348
}
350349
}
351-
// tidy-ticket-assemble_fn_pointer_candidates
350+
// tidy-keep-sync-with=tidy-ticket-assemble_fn_pointer_candidates
352351

353352
/// Searches for impls that might apply to `obligation`.
354353
#[instrument(level = "debug", skip(self, candidates))]

0 commit comments

Comments
 (0)