]> git.lizzy.rs Git - rust.git/commitdiff
take `TyCtxt` by value
authorBastian Kauschke <bastian_kauschke@hotmail.de>
Sat, 19 Sep 2020 10:38:24 +0000 (12:38 +0200)
committerBastian Kauschke <bastian_kauschke@hotmail.de>
Sat, 19 Sep 2020 10:41:12 +0000 (12:41 +0200)
compiler/rustc_middle/src/ty/context.rs
compiler/rustc_middle/src/ty/error.rs

index 39bf5472b76f83c8c36bac57ea6526e7a32596aa..5a575677f9e4a27459934b704ef28cfef7a88dc1 100644 (file)
@@ -1179,7 +1179,7 @@ pub fn const_error(self, ty: Ty<'tcx>) -> &'tcx Const<'tcx> {
         self.mk_const(ty::Const { val: ty::ConstKind::Error(DelaySpanBugEmitted(())), ty })
     }
 
-    pub fn consider_optimizing<T: Fn() -> String>(&self, msg: T) -> bool {
+    pub fn consider_optimizing<T: Fn() -> String>(self, msg: T) -> bool {
         let cname = self.crate_name(LOCAL_CRATE).as_str();
         self.sess.consider_optimizing(&cname, msg)
     }
index 475c3101c1e98eefbc7697137b90bd94836913c7..82d2e9b987472362af9f1e026fed86ab76dcea2a 100644 (file)
@@ -851,7 +851,7 @@ trait defining them",
     /// Given a slice of `hir::GenericBound`s, if any of them corresponds to the `trait_ref`
     /// requirement, provide a strucuted suggestion to constrain it to a given type `ty`.
     fn constrain_generic_bound_associated_type_structured_suggestion(
-        &self,
+        self,
         db: &mut DiagnosticBuilder<'_>,
         trait_ref: &ty::TraitRef<'tcx>,
         bounds: hir::GenericBounds<'_>,
@@ -875,7 +875,7 @@ fn constrain_generic_bound_associated_type_structured_suggestion(
     /// Given a span corresponding to a bound, provide a structured suggestion to set an
     /// associated type to a given type `ty`.
     fn constrain_associated_type_structured_suggestion(
-        &self,
+        self,
         db: &mut DiagnosticBuilder<'_>,
         span: Span,
         assoc: &ty::AssocItem,