Skip to content

Commit 8951342

Browse files
Naming nits
1 parent 1322f92 commit 8951342

File tree

7 files changed

+55
-55
lines changed

7 files changed

+55
-55
lines changed

compiler/rustc_middle/src/ty/list.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ impl<T: fmt::Debug> fmt::Debug for List<T> {
121121
}
122122
}
123123
impl<'tcx, T: super::DebugWithInfcx<TyCtxt<'tcx>>> super::DebugWithInfcx<TyCtxt<'tcx>> for List<T> {
124-
fn fmt<InfCtx: InferCtxtLike<TyCtxt<'tcx>>>(
125-
this: OptWithInfcx<'_, TyCtxt<'tcx>, InfCtx, &Self>,
124+
fn fmt<Infcx: InferCtxtLike<TyCtxt<'tcx>>>(
125+
this: OptWithInfcx<'_, TyCtxt<'tcx>, Infcx, &Self>,
126126
f: &mut core::fmt::Formatter<'_>,
127127
) -> core::fmt::Result {
128128
fmt::Debug::fmt(&this.map(|this| this.as_slice()), f)

compiler/rustc_middle/src/ty/structural_impls.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ impl<'tcx> fmt::Debug for ty::FnSig<'tcx> {
9393
}
9494
}
9595
impl<'tcx> DebugWithInfcx<TyCtxt<'tcx>> for ty::FnSig<'tcx> {
96-
fn fmt<InfCtx: InferCtxtLike<TyCtxt<'tcx>>>(
97-
this: OptWithInfcx<'_, TyCtxt<'tcx>, InfCtx, &Self>,
96+
fn fmt<Infcx: InferCtxtLike<TyCtxt<'tcx>>>(
97+
this: OptWithInfcx<'_, TyCtxt<'tcx>, Infcx, &Self>,
9898
f: &mut core::fmt::Formatter<'_>,
9999
) -> core::fmt::Result {
100100
let sig = this.data;
@@ -149,8 +149,8 @@ impl<'tcx> fmt::Debug for ty::TraitRef<'tcx> {
149149
}
150150

151151
impl<'tcx> ty::DebugWithInfcx<TyCtxt<'tcx>> for Ty<'tcx> {
152-
fn fmt<InfCtx: InferCtxtLike<TyCtxt<'tcx>>>(
153-
this: OptWithInfcx<'_, TyCtxt<'tcx>, InfCtx, &Self>,
152+
fn fmt<Infcx: InferCtxtLike<TyCtxt<'tcx>>>(
153+
this: OptWithInfcx<'_, TyCtxt<'tcx>, Infcx, &Self>,
154154
f: &mut core::fmt::Formatter<'_>,
155155
) -> core::fmt::Result {
156156
this.data.fmt(f)
@@ -242,8 +242,8 @@ impl<'tcx> fmt::Debug for AliasTy<'tcx> {
242242
}
243243
}
244244
impl<'tcx> DebugWithInfcx<TyCtxt<'tcx>> for AliasTy<'tcx> {
245-
fn fmt<InfCtx: InferCtxtLike<TyCtxt<'tcx>>>(
246-
this: OptWithInfcx<'_, TyCtxt<'tcx>, InfCtx, &Self>,
245+
fn fmt<Infcx: InferCtxtLike<TyCtxt<'tcx>>>(
246+
this: OptWithInfcx<'_, TyCtxt<'tcx>, Infcx, &Self>,
247247
f: &mut core::fmt::Formatter<'_>,
248248
) -> core::fmt::Result {
249249
f.debug_struct("AliasTy")
@@ -263,8 +263,8 @@ impl<'tcx> fmt::Debug for ty::InferConst<'tcx> {
263263
}
264264
}
265265
impl<'tcx> DebugWithInfcx<TyCtxt<'tcx>> for ty::InferConst<'tcx> {
266-
fn fmt<InfCtx: InferCtxtLike<TyCtxt<'tcx>>>(
267-
this: OptWithInfcx<'_, TyCtxt<'tcx>, InfCtx, &Self>,
266+
fn fmt<Infcx: InferCtxtLike<TyCtxt<'tcx>>>(
267+
this: OptWithInfcx<'_, TyCtxt<'tcx>, Infcx, &Self>,
268268
f: &mut core::fmt::Formatter<'_>,
269269
) -> core::fmt::Result {
270270
use ty::InferConst::*;
@@ -287,8 +287,8 @@ impl<'tcx> fmt::Debug for ty::consts::Expr<'tcx> {
287287
}
288288
}
289289
impl<'tcx> DebugWithInfcx<TyCtxt<'tcx>> for ty::consts::Expr<'tcx> {
290-
fn fmt<InfCtx: InferCtxtLike<TyCtxt<'tcx>>>(
291-
this: OptWithInfcx<'_, TyCtxt<'tcx>, InfCtx, &Self>,
290+
fn fmt<Infcx: InferCtxtLike<TyCtxt<'tcx>>>(
291+
this: OptWithInfcx<'_, TyCtxt<'tcx>, Infcx, &Self>,
292292
f: &mut core::fmt::Formatter<'_>,
293293
) -> core::fmt::Result {
294294
match this.data {
@@ -320,8 +320,8 @@ impl<'tcx> fmt::Debug for ty::UnevaluatedConst<'tcx> {
320320
}
321321
}
322322
impl<'tcx> DebugWithInfcx<TyCtxt<'tcx>> for ty::UnevaluatedConst<'tcx> {
323-
fn fmt<InfCtx: InferCtxtLike<TyCtxt<'tcx>>>(
324-
this: OptWithInfcx<'_, TyCtxt<'tcx>, InfCtx, &Self>,
323+
fn fmt<Infcx: InferCtxtLike<TyCtxt<'tcx>>>(
324+
this: OptWithInfcx<'_, TyCtxt<'tcx>, Infcx, &Self>,
325325
f: &mut core::fmt::Formatter<'_>,
326326
) -> core::fmt::Result {
327327
f.debug_struct("UnevaluatedConst")
@@ -337,8 +337,8 @@ impl<'tcx> fmt::Debug for ty::Const<'tcx> {
337337
}
338338
}
339339
impl<'tcx> DebugWithInfcx<TyCtxt<'tcx>> for ty::Const<'tcx> {
340-
fn fmt<InfCtx: InferCtxtLike<TyCtxt<'tcx>>>(
341-
this: OptWithInfcx<'_, TyCtxt<'tcx>, InfCtx, &Self>,
340+
fn fmt<Infcx: InferCtxtLike<TyCtxt<'tcx>>>(
341+
this: OptWithInfcx<'_, TyCtxt<'tcx>, Infcx, &Self>,
342342
f: &mut core::fmt::Formatter<'_>,
343343
) -> core::fmt::Result {
344344
// If this is a value, we spend some effort to make it look nice.
@@ -395,8 +395,8 @@ impl<'tcx> fmt::Debug for GenericArg<'tcx> {
395395
}
396396
}
397397
impl<'tcx> DebugWithInfcx<TyCtxt<'tcx>> for GenericArg<'tcx> {
398-
fn fmt<InfCtx: InferCtxtLike<TyCtxt<'tcx>>>(
399-
this: OptWithInfcx<'_, TyCtxt<'tcx>, InfCtx, &Self>,
398+
fn fmt<Infcx: InferCtxtLike<TyCtxt<'tcx>>>(
399+
this: OptWithInfcx<'_, TyCtxt<'tcx>, Infcx, &Self>,
400400
f: &mut core::fmt::Formatter<'_>,
401401
) -> core::fmt::Result {
402402
match this.data.unpack() {
@@ -413,17 +413,17 @@ impl<'tcx> fmt::Debug for Region<'tcx> {
413413
}
414414
}
415415
impl<'tcx> DebugWithInfcx<TyCtxt<'tcx>> for Region<'tcx> {
416-
fn fmt<InfCtx: InferCtxtLike<TyCtxt<'tcx>>>(
417-
this: OptWithInfcx<'_, TyCtxt<'tcx>, InfCtx, &Self>,
416+
fn fmt<Infcx: InferCtxtLike<TyCtxt<'tcx>>>(
417+
this: OptWithInfcx<'_, TyCtxt<'tcx>, Infcx, &Self>,
418418
f: &mut core::fmt::Formatter<'_>,
419419
) -> core::fmt::Result {
420420
write!(f, "{:?}", &this.map(|data| data.kind()))
421421
}
422422
}
423423

424424
impl<'tcx> DebugWithInfcx<TyCtxt<'tcx>> for ty::RegionVid {
425-
fn fmt<InfCtx: InferCtxtLike<TyCtxt<'tcx>>>(
426-
this: OptWithInfcx<'_, TyCtxt<'tcx>, InfCtx, &Self>,
425+
fn fmt<Infcx: InferCtxtLike<TyCtxt<'tcx>>>(
426+
this: OptWithInfcx<'_, TyCtxt<'tcx>, Infcx, &Self>,
427427
f: &mut core::fmt::Formatter<'_>,
428428
) -> core::fmt::Result {
429429
match this.infcx.and_then(|infcx| infcx.universe_of_lt(*this.data)) {
@@ -434,8 +434,8 @@ impl<'tcx> DebugWithInfcx<TyCtxt<'tcx>> for ty::RegionVid {
434434
}
435435

436436
impl<'tcx, T: DebugWithInfcx<TyCtxt<'tcx>>> DebugWithInfcx<TyCtxt<'tcx>> for ty::Binder<'tcx, T> {
437-
fn fmt<InfCtx: InferCtxtLike<TyCtxt<'tcx>>>(
438-
this: OptWithInfcx<'_, TyCtxt<'tcx>, InfCtx, &Self>,
437+
fn fmt<Infcx: InferCtxtLike<TyCtxt<'tcx>>>(
438+
this: OptWithInfcx<'_, TyCtxt<'tcx>, Infcx, &Self>,
439439
f: &mut core::fmt::Formatter<'_>,
440440
) -> core::fmt::Result {
441441
f.debug_tuple("Binder")

compiler/rustc_middle/src/ty/sty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,8 @@ pub enum ExistentialPredicate<'tcx> {
683683
}
684684

685685
impl<'tcx> DebugWithInfcx<TyCtxt<'tcx>> for ExistentialPredicate<'tcx> {
686-
fn fmt<InfCtx: rustc_type_ir::InferCtxtLike<TyCtxt<'tcx>>>(
687-
this: rustc_type_ir::OptWithInfcx<'_, TyCtxt<'tcx>, InfCtx, &Self>,
686+
fn fmt<Infcx: rustc_type_ir::InferCtxtLike<TyCtxt<'tcx>>>(
687+
this: rustc_type_ir::OptWithInfcx<'_, TyCtxt<'tcx>, Infcx, &Self>,
688688
f: &mut core::fmt::Formatter<'_>,
689689
) -> core::fmt::Result {
690690
fmt::Debug::fmt(&this.data, f)

compiler/rustc_type_ir/src/const_kind.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,13 @@ impl<I: Interner> Clone for ConstKind<I> {
231231

232232
impl<I: Interner> fmt::Debug for ConstKind<I> {
233233
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
234-
OptWithInfcx::new_no_ctx(self).fmt(f)
234+
OptWithInfcx::with_no_infcx(self).fmt(f)
235235
}
236236
}
237237

238238
impl<I: Interner> DebugWithInfcx<I> for ConstKind<I> {
239-
fn fmt<InfCtx: InferCtxtLike<I>>(
240-
this: OptWithInfcx<'_, I, InfCtx, &Self>,
239+
fn fmt<Infcx: InferCtxtLike<I>>(
240+
this: OptWithInfcx<'_, I, Infcx, &Self>,
241241
f: &mut core::fmt::Formatter<'_>,
242242
) -> core::fmt::Result {
243243
use ConstKind::*;

compiler/rustc_type_ir/src/debug.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,24 @@ impl<I: Interner> InferCtxtLike<I> for core::convert::Infallible {
2626
}
2727

2828
pub trait DebugWithInfcx<I: Interner>: fmt::Debug {
29-
fn fmt<InfCtx: InferCtxtLike<I>>(
30-
this: OptWithInfcx<'_, I, InfCtx, &Self>,
29+
fn fmt<Infcx: InferCtxtLike<I>>(
30+
this: OptWithInfcx<'_, I, Infcx, &Self>,
3131
f: &mut fmt::Formatter<'_>,
3232
) -> fmt::Result;
3333
}
3434

3535
impl<I: Interner, T: DebugWithInfcx<I> + ?Sized> DebugWithInfcx<I> for &'_ T {
36-
fn fmt<InfCtx: InferCtxtLike<I>>(
37-
this: OptWithInfcx<'_, I, InfCtx, &Self>,
36+
fn fmt<Infcx: InferCtxtLike<I>>(
37+
this: OptWithInfcx<'_, I, Infcx, &Self>,
3838
f: &mut fmt::Formatter<'_>,
3939
) -> fmt::Result {
4040
<T as DebugWithInfcx<I>>::fmt(this.map(|&data| data), f)
4141
}
4242
}
4343

4444
impl<I: Interner, T: DebugWithInfcx<I>> DebugWithInfcx<I> for [T] {
45-
fn fmt<InfCtx: InferCtxtLike<I>>(
46-
this: OptWithInfcx<'_, I, InfCtx, &Self>,
45+
fn fmt<Infcx: InferCtxtLike<I>>(
46+
this: OptWithInfcx<'_, I, Infcx, &Self>,
4747
f: &mut fmt::Formatter<'_>,
4848
) -> fmt::Result {
4949
match f.alternate() {
@@ -70,46 +70,46 @@ impl<I: Interner, T: DebugWithInfcx<I>> DebugWithInfcx<I> for [T] {
7070
}
7171
}
7272

73-
pub struct OptWithInfcx<'a, I: Interner, InfCtx: InferCtxtLike<I>, T> {
73+
pub struct OptWithInfcx<'a, I: Interner, Infcx: InferCtxtLike<I>, T> {
7474
pub data: T,
75-
pub infcx: Option<&'a InfCtx>,
75+
pub infcx: Option<&'a Infcx>,
7676
_interner: PhantomData<I>,
7777
}
7878

79-
impl<I: Interner, InfCtx: InferCtxtLike<I>, T: Copy> Copy for OptWithInfcx<'_, I, InfCtx, T> {}
79+
impl<I: Interner, Infcx: InferCtxtLike<I>, T: Copy> Copy for OptWithInfcx<'_, I, Infcx, T> {}
8080

81-
impl<I: Interner, InfCtx: InferCtxtLike<I>, T: Clone> Clone for OptWithInfcx<'_, I, InfCtx, T> {
81+
impl<I: Interner, Infcx: InferCtxtLike<I>, T: Clone> Clone for OptWithInfcx<'_, I, Infcx, T> {
8282
fn clone(&self) -> Self {
8383
Self { data: self.data.clone(), infcx: self.infcx, _interner: self._interner }
8484
}
8585
}
8686

8787
impl<'a, I: Interner, T> OptWithInfcx<'a, I, core::convert::Infallible, T> {
88-
pub fn new_no_ctx(data: T) -> Self {
88+
pub fn with_no_infcx(data: T) -> Self {
8989
Self { data, infcx: None, _interner: PhantomData }
9090
}
9191
}
9292

93-
impl<'a, I: Interner, InfCtx: InferCtxtLike<I>, T> OptWithInfcx<'a, I, InfCtx, T> {
94-
pub fn new(data: T, infcx: &'a InfCtx) -> Self {
93+
impl<'a, I: Interner, Infcx: InferCtxtLike<I>, T> OptWithInfcx<'a, I, Infcx, T> {
94+
pub fn new(data: T, infcx: &'a Infcx) -> Self {
9595
Self { data, infcx: Some(infcx), _interner: PhantomData }
9696
}
9797

98-
pub fn wrap<U>(self, u: U) -> OptWithInfcx<'a, I, InfCtx, U> {
98+
pub fn wrap<U>(self, u: U) -> OptWithInfcx<'a, I, Infcx, U> {
9999
OptWithInfcx { data: u, infcx: self.infcx, _interner: PhantomData }
100100
}
101101

102-
pub fn map<U>(self, f: impl FnOnce(T) -> U) -> OptWithInfcx<'a, I, InfCtx, U> {
102+
pub fn map<U>(self, f: impl FnOnce(T) -> U) -> OptWithInfcx<'a, I, Infcx, U> {
103103
OptWithInfcx { data: f(self.data), infcx: self.infcx, _interner: PhantomData }
104104
}
105105

106-
pub fn as_ref(&self) -> OptWithInfcx<'a, I, InfCtx, &T> {
106+
pub fn as_ref(&self) -> OptWithInfcx<'a, I, Infcx, &T> {
107107
OptWithInfcx { data: &self.data, infcx: self.infcx, _interner: PhantomData }
108108
}
109109
}
110110

111-
impl<I: Interner, InfCtx: InferCtxtLike<I>, T: DebugWithInfcx<I>> fmt::Debug
112-
for OptWithInfcx<'_, I, InfCtx, T>
111+
impl<I: Interner, Infcx: InferCtxtLike<I>, T: DebugWithInfcx<I>> fmt::Debug
112+
for OptWithInfcx<'_, I, Infcx, T>
113113
{
114114
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
115115
DebugWithInfcx::fmt(self.as_ref(), f)

compiler/rustc_type_ir/src/region_kind.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ impl<I: Interner> hash::Hash for RegionKind<I> {
274274
}
275275

276276
impl<I: Interner> DebugWithInfcx<I> for RegionKind<I> {
277-
fn fmt<InfCtx: InferCtxtLike<I>>(
278-
this: OptWithInfcx<'_, I, InfCtx, &Self>,
277+
fn fmt<Infcx: InferCtxtLike<I>>(
278+
this: OptWithInfcx<'_, I, Infcx, &Self>,
279279
f: &mut core::fmt::Formatter<'_>,
280280
) -> core::fmt::Result {
281281
match this.data {
@@ -301,7 +301,7 @@ impl<I: Interner> DebugWithInfcx<I> for RegionKind<I> {
301301
}
302302
impl<I: Interner> fmt::Debug for RegionKind<I> {
303303
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
304-
OptWithInfcx::new_no_ctx(self).fmt(f)
304+
OptWithInfcx::with_no_infcx(self).fmt(f)
305305
}
306306
}
307307

compiler/rustc_type_ir/src/ty_kind.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,8 @@ impl<I: Interner> hash::Hash for TyKind<I> {
534534
}
535535

536536
impl<I: Interner> DebugWithInfcx<I> for TyKind<I> {
537-
fn fmt<InfCtx: InferCtxtLike<I>>(
538-
this: OptWithInfcx<'_, I, InfCtx, &Self>,
537+
fn fmt<Infcx: InferCtxtLike<I>>(
538+
this: OptWithInfcx<'_, I, Infcx, &Self>,
539539
f: &mut core::fmt::Formatter<'_>,
540540
) -> fmt::Result {
541541
match this.data {
@@ -617,7 +617,7 @@ impl<I: Interner> DebugWithInfcx<I> for TyKind<I> {
617617
// This is manually implemented because a derive would require `I: Debug`
618618
impl<I: Interner> fmt::Debug for TyKind<I> {
619619
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
620-
OptWithInfcx::new_no_ctx(self).fmt(f)
620+
OptWithInfcx::with_no_infcx(self).fmt(f)
621621
}
622622
}
623623

@@ -1239,8 +1239,8 @@ impl fmt::Debug for InferTy {
12391239
}
12401240

12411241
impl<I: Interner<InferTy = InferTy>> DebugWithInfcx<I> for InferTy {
1242-
fn fmt<InfCtx: InferCtxtLike<I>>(
1243-
this: OptWithInfcx<'_, I, InfCtx, &Self>,
1242+
fn fmt<Infcx: InferCtxtLike<I>>(
1243+
this: OptWithInfcx<'_, I, Infcx, &Self>,
12441244
f: &mut fmt::Formatter<'_>,
12451245
) -> fmt::Result {
12461246
use InferTy::*;

0 commit comments

Comments
 (0)