about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/bounds.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-09-22 19:05:04 -0400
committerMichael Goulet <michael@errs.io>2024-09-22 19:11:29 -0400
commitc682aa162b0d41e21cc6748f4fecfe01efb69d1f (patch)
tree0c31b640e3faacfb187a1509e3da5d5b6ba0109c /compiler/rustc_hir_analysis/src/bounds.rs
parent1173204b364841b51598744fc69d7c80be10f956 (diff)
downloadrust-c682aa162b0d41e21cc6748f4fecfe01efb69d1f.tar.gz
rust-c682aa162b0d41e21cc6748f4fecfe01efb69d1f.zip
Reformat using the new identifier sorting from rustfmt
Diffstat (limited to 'compiler/rustc_hir_analysis/src/bounds.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/bounds.rs27
1 files changed, 12 insertions, 15 deletions
diff --git a/compiler/rustc_hir_analysis/src/bounds.rs b/compiler/rustc_hir_analysis/src/bounds.rs
index 14ea7816291..caf9960741d 100644
--- a/compiler/rustc_hir_analysis/src/bounds.rs
+++ b/compiler/rustc_hir_analysis/src/bounds.rs
@@ -2,12 +2,12 @@
 //! [`rustc_middle::ty`] form.
 
 use rustc_data_structures::fx::FxIndexMap;
-use rustc_hir::def::DefKind;
 use rustc_hir::LangItem;
+use rustc_hir::def::DefKind;
 use rustc_middle::ty::fold::FnMutDelegate;
 use rustc_middle::ty::{self, Ty, TyCtxt, Upcast};
-use rustc_span::def_id::DefId;
 use rustc_span::Span;
+use rustc_span::def_id::DefId;
 
 use crate::hir_ty_lowering::OnlySelfBounds;
 
@@ -112,14 +112,11 @@ impl<'tcx> Bounds<'tcx> {
                 // This should work for any bound variables as long as they don't have any
                 // bounds e.g. `for<T: Trait>`.
                 // FIXME(effects) reconsider this approach to allow compatibility with `for<T: Tr>`
-                let ty = tcx.replace_bound_vars_uncached(
-                    ty,
-                    FnMutDelegate {
-                        regions: &mut |_| tcx.lifetimes.re_static,
-                        types: &mut |_| tcx.types.unit,
-                        consts: &mut |_| unimplemented!("`~const` does not support const binders"),
-                    },
-                );
+                let ty = tcx.replace_bound_vars_uncached(ty, FnMutDelegate {
+                    regions: &mut |_| tcx.lifetimes.re_static,
+                    types: &mut |_| tcx.types.unit,
+                    consts: &mut |_| unimplemented!("`~const` does not support const binders"),
+                });
 
                 self.effects_min_tys.insert(ty, span);
                 return;
@@ -152,11 +149,11 @@ impl<'tcx> Bounds<'tcx> {
         };
         let self_ty = Ty::new_projection(tcx, assoc, bound_trait_ref.skip_binder().args);
         // make `<T as Tr>::Effects: Compat<runtime>`
-        let new_trait_ref = ty::TraitRef::new(
-            tcx,
-            tcx.require_lang_item(LangItem::EffectsCompat, Some(span)),
-            [ty::GenericArg::from(self_ty), compat_val.into()],
-        );
+        let new_trait_ref =
+            ty::TraitRef::new(tcx, tcx.require_lang_item(LangItem::EffectsCompat, Some(span)), [
+                ty::GenericArg::from(self_ty),
+                compat_val.into(),
+            ]);
         self.clauses.push((bound_trait_ref.rebind(new_trait_ref).upcast(tcx), span));
     }