about summary refs log tree commit diff
path: root/tests/rustdoc-js/auxiliary/interner.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-06-03 17:35:56 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-06-04 14:15:06 +1000
commitc6fb703c05a47a7f20c59c5315fe704c536084d0 (patch)
tree08d610a0b2d7fb99c745ae61f36d3cb685b62094 /tests/rustdoc-js/auxiliary/interner.rs
parent98d65d62c511777d6372ae0115d40f82d0a42857 (diff)
downloadrust-c6fb703c05a47a7f20c59c5315fe704c536084d0.tar.gz
rust-c6fb703c05a47a7f20c59c5315fe704c536084d0.zip
rustfmt `tests/rustdoc-js/`.
Diffstat (limited to 'tests/rustdoc-js/auxiliary/interner.rs')
-rw-r--r--tests/rustdoc-js/auxiliary/interner.rs67
1 files changed, 27 insertions, 40 deletions
diff --git a/tests/rustdoc-js/auxiliary/interner.rs b/tests/rustdoc-js/auxiliary/interner.rs
index c95029be9f0..e4e4ff6276d 100644
--- a/tests/rustdoc-js/auxiliary/interner.rs
+++ b/tests/rustdoc-js/auxiliary/interner.rs
@@ -77,17 +77,14 @@ pub trait Interner: Sized {
     type ClosureKind: Copy + Debug + Hash + Eq;
 
     // Required method
-    fn mk_canonical_var_infos(
-        self,
-        infos: &[CanonicalVarInfo<Self>]
-    ) -> Self::CanonicalVars;
+    fn mk_canonical_var_infos(self, infos: &[CanonicalVarInfo<Self>]) -> Self::CanonicalVars;
 }
 
 pub trait DebugWithInfcx<I: Interner>: Debug {
     // Required method
     fn fmt<Infcx: InferCtxtLike<Interner = I>>(
         this: WithInfcx<'_, Infcx, &Self>,
-        f: &mut Formatter<'_>
+        f: &mut Formatter<'_>,
     ) -> std::fmt::Result;
 }
 
@@ -130,11 +127,7 @@ pub struct TypeFlags;
 
 pub trait Ty<I: Interner<Ty = Self>> {
     // Required method
-    fn new_anon_bound(
-        interner: I,
-        debruijn: DebruijnIndex,
-        var: BoundVar
-    ) -> Self;
+    fn new_anon_bound(interner: I, debruijn: DebruijnIndex, var: BoundVar) -> Self;
 }
 
 pub trait PlaceholderLike {
@@ -152,12 +145,7 @@ pub struct BoundVar;
 pub struct ConstKind<I>(std::marker::PhantomData<I>);
 pub trait Const<I: Interner<Const = Self>> {
     // Required method
-    fn new_anon_bound(
-        interner: I,
-        debruijn: DebruijnIndex,
-        var: BoundVar,
-        ty: I::Ty
-    ) -> Self;
+    fn new_anon_bound(interner: I, debruijn: DebruijnIndex, var: BoundVar, ty: I::Ty) -> Self;
 }
 
 pub trait ConstTy<I: Interner> {
@@ -170,25 +158,28 @@ pub struct DebruijnIndex;
 pub struct RegionKind<I>(std::marker::PhantomData<I>);
 pub trait Region<I: Interner<Region = Self>> {
     // Required method
-    fn new_anon_bound(
-        interner: I,
-        debruijn: DebruijnIndex,
-        var: BoundVar
-    ) -> Self;
+    fn new_anon_bound(interner: I, debruijn: DebruijnIndex, var: BoundVar) -> Self;
 }
 
 pub trait TypeVisitor<I: Interner>: Sized {
     type Result: VisitorResult = ();
 
     // Provided methods
-    fn visit_binder<T: TypeVisitable<I>>(
-        &mut self,
-        t: &I::Binder<T>
-    ) -> Self::Result { unimplemented!() }
-    fn visit_ty(&mut self, t: I::Ty) -> Self::Result { unimplemented!() }
-    fn visit_region(&mut self, _r: I::Region) -> Self::Result { unimplemented!() }
-    fn visit_const(&mut self, c: I::Const) -> Self::Result { unimplemented!() }
-    fn visit_predicate(&mut self, p: I::Predicate) -> Self::Result { unimplemented!() }
+    fn visit_binder<T: TypeVisitable<I>>(&mut self, t: &I::Binder<T>) -> Self::Result {
+        unimplemented!()
+    }
+    fn visit_ty(&mut self, t: I::Ty) -> Self::Result {
+        unimplemented!()
+    }
+    fn visit_region(&mut self, _r: I::Region) -> Self::Result {
+        unimplemented!()
+    }
+    fn visit_const(&mut self, c: I::Const) -> Self::Result {
+        unimplemented!()
+    }
+    fn visit_predicate(&mut self, p: I::Predicate) -> Self::Result {
+        unimplemented!()
+    }
 }
 
 pub trait VisitorResult {
@@ -206,7 +197,9 @@ impl VisitorResult for () {
     fn output() -> Self {}
     fn from_residual(_: Self::Residual) -> Self {}
     fn from_branch(_: ControlFlow<Self::Residual>) -> Self {}
-    fn branch(self) -> ControlFlow<Self::Residual> { ControlFlow::Continue(()) }
+    fn branch(self) -> ControlFlow<Self::Residual> {
+        ControlFlow::Continue(())
+    }
 }
 
 pub struct WithInfcx<'a, Infcx: InferCtxtLike, T> {
@@ -221,24 +214,18 @@ pub trait InferCtxtLike {
     fn interner(&self) -> Self::Interner;
     fn universe_of_ty(&self, ty: TyVid) -> Option<UniverseIndex>;
     fn root_ty_var(&self, vid: TyVid) -> TyVid;
-    fn probe_ty_var(
-        &self,
-        vid: TyVid
-    ) -> Option<<Self::Interner as Interner>::Ty>;
+    fn probe_ty_var(&self, vid: TyVid) -> Option<<Self::Interner as Interner>::Ty>;
     fn universe_of_lt(
         &self,
-        lt: <Self::Interner as Interner>::InferRegion
+        lt: <Self::Interner as Interner>::InferRegion,
     ) -> Option<UniverseIndex>;
     fn opportunistic_resolve_lt_var(
         &self,
-        vid: <Self::Interner as Interner>::InferRegion
+        vid: <Self::Interner as Interner>::InferRegion,
     ) -> Option<<Self::Interner as Interner>::Region>;
     fn universe_of_ct(&self, ct: ConstVid) -> Option<UniverseIndex>;
     fn root_ct_var(&self, vid: ConstVid) -> ConstVid;
-    fn probe_ct_var(
-        &self,
-        vid: ConstVid
-    ) -> Option<<Self::Interner as Interner>::Const>;
+    fn probe_ct_var(&self, vid: ConstVid) -> Option<<Self::Interner as Interner>::Const>;
 }
 
 pub struct TyVid;