Skip to content

Commit e4c6a7c

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 3a0ea27 commit e4c6a7c

File tree

31 files changed

+137
-9
lines changed

31 files changed

+137
-9
lines changed

compiler/rustc_ast/src/token.rs

Lines changed: 4 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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_codegen_ssa/src/back/write.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,7 @@ impl<B: WriteBackendMethods> WorkItem<B> {
714714
}
715715
}
716716

717+
// tidy-ticket-short_description
717718
/// Generate a short description of this work item suitable for use as a thread name.
718719
fn short_description(&self) -> String {
719720
// `pthread_setname()` on *nix ignores anything beyond the first 15
@@ -761,6 +762,7 @@ impl<B: WriteBackendMethods> WorkItem<B> {
761762
WorkItem::LTO(m) => desc("lto", "LTO module", m.name()),
762763
}
763764
}
765+
// tidy-ticket-short_description
764766
}
765767

766768
/// A result produced by the backend.

compiler/rustc_const_eval/src/interpret/projection.rs

Lines changed: 1 addition & 0 deletions
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

Lines changed: 5 additions & 1 deletion
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 =
@@ -778,9 +780,10 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M>
778780
}
779781
};
780782

783+
// tidy-ticket-visit_value
781784
// Optimization: we just check the entire range at once.
782785
// NOTE: Keep this in sync with the handling of integer and float
783-
// types above, in `visit_primitive`.
786+
// types above, in `try_visit_primitive`.
784787
// In run-time mode, we accept pointers in here. This is actually more
785788
// permissive than a per-element check would be, e.g., we accept
786789
// 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>
820823
}
821824
}
822825
}
826+
// tidy-ticket-visit_value
823827
}
824828
// Fast path for arrays and slices of ZSTs. We only need to check a single ZST element
825829
// 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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,8 @@ struct FutureIncompatReport {
322322
future_incompat_report: Vec<FutureBreakageItem>,
323323
}
324324

325+
// tidy-ticket-UnusedExterns
326+
// FIXME: where it located in cargo?
325327
// NOTE: Keep this in sync with the equivalent structs in rustdoc's
326328
// doctest component (as well as cargo).
327329
// We could unify this struct the one in rustdoc but they have different
@@ -333,6 +335,7 @@ struct UnusedExterns<'a, 'b, 'c> {
333335
/// List of unused externs by their names.
334336
unused_extern_names: &'b [&'c str],
335337
}
338+
// tidy-ticket-UnusedExterns
336339

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

compiler/rustc_hir_analysis/src/check/region.rs

Lines changed: 1 addition & 0 deletions
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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,12 @@ pub fn check_crate(tcx: TyCtxt<'_>) -> Result<(), ErrorGuaranteed> {
208208
});
209209
})?;
210210

211+
// tidy-ticket-sess-time-item_types_checking
211212
// NOTE: This is copy/pasted in librustdoc/core.rs and should be kept in sync.
212213
tcx.sess.time("item_types_checking", || {
213214
tcx.hir().for_each_module(|module| tcx.ensure().check_mod_item_types(module))
214215
});
216+
// tidy-ticket-sess-time-item_types_checking
215217

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

compiler/rustc_middle/src/ty/util.rs

Lines changed: 5 additions & 0 deletions
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

0 commit comments

Comments
 (0)