Skip to content

Commit 3f2a374

Browse files
committed
add few more items to sync list. NB: not every entry is checked if code actually in sync, should be reviewed
1 parent 0892b38 commit 3f2a374

File tree

32 files changed

+141
-7
lines changed

32 files changed

+141
-7
lines changed

compiler/rustc_ast/src/token.rs

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

107+
// tidy-ticket-ast-from_token
107108
/// Keep this in sync with `Token::can_begin_literal_or_bool` excluding unary negation.
108109
pub fn from_token(token: &Token) -> Option<Lit> {
109110
match token.uninterpolate().kind {
@@ -120,6 +121,7 @@ impl Lit {
120121
_ => None,
121122
}
122123
}
124+
// tidy-ticket-ast-from_token
123125
}
124126

125127
impl fmt::Display for Lit {
@@ -545,6 +547,7 @@ impl Token {
545547
///
546548
/// In other words, would this token be a valid start of `parse_literal_maybe_minus`?
547549
///
550+
// tidy-ticket-ast-can_begin_literal_maybe_minus
548551
/// Keep this in sync with and `Lit::from_token`, excluding unary negation.
549552
pub fn can_begin_literal_maybe_minus(&self) -> bool {
550553
match self.uninterpolate().kind {
@@ -564,6 +567,7 @@ impl Token {
564567
_ => false,
565568
}
566569
}
570+
// tidy-ticket-ast-can_begin_literal_maybe_minus
567571

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

compiler/rustc_builtin_macros/src/assert/context.rs

+2
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ impl<'cx, 'a> Context<'cx, 'a> {
292292
}
293293
// Expressions that are not worth or can not be captured.
294294
//
295+
// tidy-ticket-all-expr-kinds
295296
// Full list instead of `_` to catch possible future inclusions and to
296297
// sync with the `rfc-2011-nicer-assert-messages/all-expr-kinds.rs` test.
297298
ExprKind::Assign(_, _, _)
@@ -323,6 +324,7 @@ impl<'cx, 'a> Context<'cx, 'a> {
323324
| ExprKind::Yeet(_)
324325
| ExprKind::Become(_)
325326
| ExprKind::Yield(_) => {}
327+
// tidy-ticket-all-expr-kinds
326328
}
327329
}
328330

compiler/rustc_builtin_macros/src/test_harness.rs

+3
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ impl<'a> Visitor<'a> for InnerItemLinter<'_> {
169169
}
170170
}
171171

172+
// tidy-ticket-entry_point_type
172173
// Beware, this is duplicated in librustc_passes/entry.rs (with
173174
// `rustc_hir::Item`), so make sure to keep them in sync.
174175
fn entry_point_type(item: &ast::Item, depth: usize) -> EntryPointType {
@@ -192,6 +193,8 @@ fn entry_point_type(item: &ast::Item, depth: usize) -> EntryPointType {
192193
_ => EntryPointType::None,
193194
}
194195
}
196+
// tidy-ticket-entry_point_type
197+
195198
/// A folder used to remove any entry points (like fn main) because the harness
196199
/// generator will provide its own
197200
struct EntryPointCleaner<'a> {

compiler/rustc_codegen_ssa/src/back/write.rs

+2
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,7 @@ impl<B: WriteBackendMethods> WorkItem<B> {
701701
}
702702
}
703703

704+
// tidy-ticket-short_description
704705
/// Generate a short description of this work item suitable for use as a thread name.
705706
fn short_description(&self) -> String {
706707
// `pthread_setname()` on *nix ignores anything beyond the first 15
@@ -748,6 +749,7 @@ impl<B: WriteBackendMethods> WorkItem<B> {
748749
WorkItem::LTO(m) => desc("lto", "LTO module", m.name()),
749750
}
750751
}
752+
// tidy-ticket-short_description
751753
}
752754

753755
/// A result produced by the backend.

compiler/rustc_const_eval/src/interpret/projection.rs

+1
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ where
149149
None => {
150150
// For unsized types with an extern type tail we perform no adjustments.
151151
// NOTE: keep this in sync with `PlaceRef::project_field` in the codegen backend.
152+
// FIXME: that one? compiler/rustc_codegen_ssa/src/mir/place.rs
152153
assert!(matches!(base_meta, MemPlaceMeta::None));
153154
(base_meta, offset)
154155
}

compiler/rustc_const_eval/src/interpret/validity.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
505505
Ok(true)
506506
}
507507
ty::Float(_) | ty::Int(_) | ty::Uint(_) => {
508+
// tidy-ticket-try_visit_primitive
508509
// NOTE: Keep this in sync with the array optimization for int/float
509510
// types below!
510511
self.read_scalar(
@@ -516,6 +517,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
516517
},
517518
)?;
518519
Ok(true)
520+
// tidy-ticket-try_visit_primitive
519521
}
520522
ty::RawPtr(..) => {
521523
let place =
@@ -779,9 +781,10 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M>
779781
}
780782
};
781783

784+
// tidy-ticket-visit_value
782785
// Optimization: we just check the entire range at once.
783786
// NOTE: Keep this in sync with the handling of integer and float
784-
// types above, in `visit_primitive`.
787+
// types above, in `try_visit_primitive`.
785788
// In run-time mode, we accept pointers in here. This is actually more
786789
// permissive than a per-element check would be, e.g., we accept
787790
// a &[u8] that contains a pointer even though bytewise checking would
@@ -821,6 +824,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M>
821824
}
822825
}
823826
}
827+
// tidy-ticket-visit_value
824828
}
825829
// Fast path for arrays and slices of ZSTs. We only need to check a single ZST element
826830
// 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
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ bitflags::bitflags! {
125125
}
126126
}
127127

128+
// tidy-ticket-self-profile-events
128129
// keep this in sync with the `-Z self-profile-events` help message in rustc_session/options.rs
129130
const EVENT_FILTERS_BY_NAME: &[(&str, EventFilter)] = &[
130131
("none", EventFilter::empty()),
@@ -142,6 +143,7 @@ const EVENT_FILTERS_BY_NAME: &[(&str, EventFilter)] = &[
142143
("incr-result-hashing", EventFilter::INCR_RESULT_HASHING),
143144
("artifact-sizes", EventFilter::ARTIFACT_SIZES),
144145
];
146+
// tidy-ticket-self-profile-events
145147

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

compiler/rustc_errors/src/json.rs

+3
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,8 @@ struct FutureIncompatReport {
315315
future_incompat_report: Vec<FutureBreakageItem>,
316316
}
317317

318+
// tidy-ticket-UnusedExterns
319+
// FIXME: where it located in cargo?
318320
// NOTE: Keep this in sync with the equivalent structs in rustdoc's
319321
// doctest component (as well as cargo).
320322
// We could unify this struct the one in rustdoc but they have different
@@ -326,6 +328,7 @@ struct UnusedExterns<'a, 'b, 'c> {
326328
/// List of unused externs by their names.
327329
unused_extern_names: &'b [&'c str],
328330
}
331+
// tidy-ticket-UnusedExterns
329332

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

compiler/rustc_hir_analysis/src/check/region.rs

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ fn resolve_block<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, blk: &'tcx h
119119
visitor.cx.var_parent = visitor.cx.parent;
120120

121121
{
122+
// FIXME: sync with exactly where?
122123
// This block should be kept approximately in sync with
123124
// `intravisit::walk_block`. (We manually walk the block, rather
124125
// than call `walk_block`, in order to maintain precise

compiler/rustc_hir_analysis/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,12 @@ pub fn check_crate(tcx: TyCtxt<'_>) -> Result<(), ErrorGuaranteed> {
232232
});
233233
})?;
234234

235+
// tidy-ticket-sess-time-item_types_checking
235236
// NOTE: This is copy/pasted in librustdoc/core.rs and should be kept in sync.
236237
tcx.sess.time("item_types_checking", || {
237238
tcx.hir().for_each_module(|module| tcx.ensure().check_mod_item_types(module))
238239
});
240+
// tidy-ticket-sess-time-item_types_checking
239241

240242
// Freeze definitions as we don't add new ones at this point. This improves performance by
241243
// allowing lock-free access to them.

compiler/rustc_middle/src/ty/util.rs

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

656+
// tidy-ticket-thread_local_ptr_ty
656657
/// Returns the type a reference to the thread local takes in MIR.
657658
pub fn thread_local_ptr_ty(self, def_id: DefId) -> Ty<'tcx> {
658659
let static_ty = self.type_of(def_id).instantiate_identity();
@@ -665,6 +666,7 @@ impl<'tcx> TyCtxt<'tcx> {
665666
Ty::new_imm_ref(self, self.lifetimes.re_static, static_ty)
666667
}
667668
}
669+
// tidy-ticket-thread_local_ptr_ty
668670

669671
/// Get the type of the pointer to the static that we use in MIR.
670672
pub fn static_ptr_ty(self, def_id: DefId) -> Ty<'tcx> {
@@ -674,7 +676,9 @@ impl<'tcx> TyCtxt<'tcx> {
674676
self.type_of(def_id).instantiate_identity(),
675677
);
676678

679+
// tidy-ticket-static_ptr_ty
677680
// Make sure that accesses to unsafe statics end up using raw pointers.
681+
// FIXME: should it said sync with thread_local_ptr_ty?
678682
// For thread-locals, this needs to be kept in sync with `Rvalue::ty`.
679683
if self.is_mutable_static(def_id) {
680684
Ty::new_mut_ptr(self, static_ty)
@@ -683,6 +687,7 @@ impl<'tcx> TyCtxt<'tcx> {
683687
} else {
684688
Ty::new_imm_ref(self, self.lifetimes.re_erased, static_ty)
685689
}
690+
// tidy-ticket-static_ptr_ty
686691
}
687692

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

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

+8
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,7 @@ impl<'tcx> Constructor<'tcx> {
701701
}
702702
}
703703

704+
// tidy-ticket-arity
704705
/// The number of fields for this constructor. This must be kept in sync with
705706
/// `Fields::wildcards`.
706707
pub(super) fn arity(&self, pcx: &PatCtxt<'_, '_, 'tcx>) -> usize {
@@ -731,6 +732,7 @@ impl<'tcx> Constructor<'tcx> {
731732
Or => bug!("The `Or` constructor doesn't have a fixed arity"),
732733
}
733734
}
735+
// tidy-ticket-arity
734736

735737
/// Some constructors (namely `Wildcard`, `IntRange` and `Slice`) actually stand for a set of actual
736738
/// constructors (like variants, integers or fixed-sized slices). When specializing for these
@@ -778,6 +780,7 @@ impl<'tcx> Constructor<'tcx> {
778780
}
779781
}
780782

783+
// tidy-ticket-is_covered_by
781784
/// Returns whether `self` is covered by `other`, i.e. whether `self` is a subset of `other`.
782785
/// For the simple cases, this is simply checking for equality. For the "grouped" constructors,
783786
/// this checks for inclusion.
@@ -831,7 +834,9 @@ impl<'tcx> Constructor<'tcx> {
831834
),
832835
}
833836
}
837+
// tidy-ticket-is_covered_by
834838

839+
// tidy-ticket-is_covered_by_any
835840
/// Faster version of `is_covered_by` when applied to many constructors. `used_ctors` is
836841
/// assumed to be built from `matrix.head_ctors()` with wildcards and opaques filtered out,
837842
/// and `self` is assumed to have been split from a wildcard.
@@ -864,6 +869,7 @@ impl<'tcx> Constructor<'tcx> {
864869
}
865870
}
866871
}
872+
// tidy-ticket-is_covered_by_any
867873
}
868874

869875
/// A wildcard constructor that we split relative to the constructors in the matrix, as explained
@@ -1173,6 +1179,7 @@ impl<'p, 'tcx> Fields<'p, 'tcx> {
11731179
})
11741180
}
11751181

1182+
// tidy-ticket-wildcards
11761183
/// Creates a new list of wildcard fields for a given constructor. The result must have a
11771184
/// length of `constructor.arity()`.
11781185
#[instrument(level = "trace")]
@@ -1216,6 +1223,7 @@ impl<'p, 'tcx> Fields<'p, 'tcx> {
12161223
debug!(?ret);
12171224
ret
12181225
}
1226+
// tidy-ticket-wildcards
12191227

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

compiler/rustc_monomorphize/src/partitioning.rs

+3
Original file line numberDiff line numberDiff line change
@@ -473,13 +473,16 @@ fn merge_codegen_units<'tcx>(
473473
codegen_units.sort_by_key(|cgu| cmp::Reverse(cgu.size_estimate()));
474474
let num_digits = codegen_units.len().ilog10() as usize + 1;
475475
for (index, cgu) in codegen_units.iter_mut().enumerate() {
476+
// tidy-ticket-short_description
477+
// FIXME: is it sync?
476478
// Note: `WorkItem::short_description` depends on this name ending
477479
// with `-cgu.` followed by a numeric suffix. Please keep it in
478480
// sync with this code.
479481
let suffix = format!("{index:0num_digits$}");
480482
let numbered_codegen_unit_name =
481483
cgu_name_builder.build_cgu_name_no_mangle(LOCAL_CRATE, &["cgu"], Some(suffix));
482484
cgu.set_name(numbered_codegen_unit_name);
485+
// tidy-ticket-short_description
483486
}
484487
}
485488
}

compiler/rustc_parse/src/parser/expr.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2075,6 +2075,7 @@ impl<'a> Parser<'a> {
20752075
}
20762076
}
20772077

2078+
// tidy-ticket-rustc_parse-can_begin_literal_maybe_minus
20782079
/// Matches `'-' lit | lit` (cf. `ast_validation::AstValidator::check_expr_within_pat`).
20792080
/// Keep this in sync with `Token::can_begin_literal_maybe_minus`.
20802081
pub fn parse_literal_maybe_minus(&mut self) -> PResult<'a, P<Expr>> {
@@ -2091,6 +2092,7 @@ impl<'a> Parser<'a> {
20912092
Ok(expr)
20922093
}
20932094
}
2095+
// tidy-ticket-rustc_parse-can_begin_literal_maybe_minus
20942096

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

compiler/rustc_passes/src/entry.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ fn entry_fn(tcx: TyCtxt<'_>, (): ()) -> Option<(DefId, EntryFnType)> {
5252
configure_main(tcx, &ctxt)
5353
}
5454

55-
// Beware, this is duplicated in `librustc_builtin_macros/test_harness.rs`
55+
// tidy-ticket-entry_point_type
56+
// Beware, this is duplicated in `rustc_builtin_macros/src/test_harness.rs`
5657
// (with `ast::Item`), so make sure to keep them in sync.
5758
// A small optimization was added so that hir::Item is fetched only when needed.
5859
// An equivalent optimization was not applied to the duplicated code in test_harness.rs.
@@ -76,6 +77,7 @@ fn entry_point_type(ctxt: &EntryContext<'_>, id: ItemId, at_root: bool) -> Entry
7677
}
7778
}
7879
}
80+
// tidy-ticket-entry_point_type
7981

8082
fn attr_span_by_symbol(ctxt: &EntryContext<'_>, id: ItemId, sym: Symbol) -> Option<Span> {
8183
let attrs = ctxt.tcx.hir().attrs(id.hir_id());

compiler/rustc_session/src/config.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,7 @@ pub const fn default_lib_output() -> CrateType {
11871187

11881188
fn default_configuration(sess: &Session) -> CrateConfig {
11891189
// NOTE: This should be kept in sync with `CrateCheckConfig::fill_well_known` below.
1190+
// FIXME: what exactly sync there?
11901191
let end = &sess.target.endian;
11911192
let arch = &sess.target.arch;
11921193
let wordsz = sess.target.pointer_width.to_string();

compiler/rustc_session/src/config/sigpipe.rs

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

compiler/rustc_session/src/options.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1735,12 +1735,15 @@ written to standard error output)"),
17351735
`instructions:u` (retired instructions, userspace-only)
17361736
`instructions-minus-irqs:u` (subtracting hardware interrupt counts for extra accuracy)"
17371737
),
1738-
/// keep this in sync with the event filter names in librustc_data_structures/profiling.rs
1738+
// tidy-ticket-self-profile-events
1739+
/// keep this in sync with the event filter names in rustc_data_structures/src/profiling.rs
17391740
self_profile_events: Option<Vec<String>> = (None, parse_opt_comma_list, [UNTRACKED],
17401741
"specify the events recorded by the self profiler;
17411742
for example: `-Z self-profile-events=default,query-keys`
1742-
all options: none, all, default, generic-activity, query-provider, query-cache-hit
1743-
query-blocked, incr-cache-load, incr-result-hashing, query-keys, function-args, args, llvm, artifact-sizes"),
1743+
all options: none, all, default, generic-activity, query-provider, query-cache-hit,
1744+
query-blocked, incr-cache-load, query-keys, function-args, args, llvm, incr-result-hashing, artifact-sizes"),
1745+
// tidy-ticket-self-profile-events
1746+
17441747
share_generics: Option<bool> = (None, parse_opt_bool, [TRACKED],
17451748
"make the current crate share its generic instantiations"),
17461749
show_span: Option<String> = (None, parse_opt_string, [TRACKED],

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

+3
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ pub(in crate::solve) fn instantiate_constituent_tys_for_copy_clone_trait<'tcx>(
219219
}
220220
}
221221

222+
// tidy-ticket-extract_tupled_inputs_and_output_from_callable
222223
// Returns a binder of the tupled inputs types and output type from a builtin callable type.
223224
pub(in crate::solve) fn extract_tupled_inputs_and_output_from_callable<'tcx>(
224225
tcx: TyCtxt<'tcx>,
@@ -240,6 +241,7 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_callable<'tcx>(
240241
Err(NoSolution)
241242
}
242243
}
244+
243245
// keep this in sync with assemble_fn_pointer_candidates until the old solver is removed.
244246
ty::FnPtr(sig) => {
245247
if sig.is_fn_trait_compatible() {
@@ -298,6 +300,7 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_callable<'tcx>(
298300
}
299301
}
300302
}
303+
// tidy-ticket-extract_tupled_inputs_and_output_from_callable
301304

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

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

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

219+
// tidy-ticket-rematch_unsize
219220
/// The `Unsize` trait is particularly important to coercion, so we try rematch it.
220221
/// NOTE: This must stay in sync with `consider_builtin_unsize_candidate` in trait
221222
/// goal assembly in the solver, both for soundness and in order to avoid ICEs.
@@ -377,6 +378,7 @@ fn rematch_unsize<'tcx>(
377378
}
378379
}
379380
}
381+
// tidy-ticket-rematch_unsize
380382

381383
fn structurally_normalize<'tcx>(
382384
ty: Ty<'tcx>,

0 commit comments

Comments
 (0)