Skip to content

Commit 67f319c

Browse files
committed
take TyCtxt by value
1 parent a219ad6 commit 67f319c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_middle/src/ty/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ impl<'tcx> TyCtxt<'tcx> {
11791179
self.mk_const(ty::Const { val: ty::ConstKind::Error(DelaySpanBugEmitted(())), ty })
11801180
}
11811181

1182-
pub fn consider_optimizing<T: Fn() -> String>(&self, msg: T) -> bool {
1182+
pub fn consider_optimizing<T: Fn() -> String>(self, msg: T) -> bool {
11831183
let cname = self.crate_name(LOCAL_CRATE).as_str();
11841184
self.sess.consider_optimizing(&cname, msg)
11851185
}

compiler/rustc_middle/src/ty/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ fn foo(&self) -> Self::T { String::new() }
851851
/// Given a slice of `hir::GenericBound`s, if any of them corresponds to the `trait_ref`
852852
/// requirement, provide a strucuted suggestion to constrain it to a given type `ty`.
853853
fn constrain_generic_bound_associated_type_structured_suggestion(
854-
&self,
854+
self,
855855
db: &mut DiagnosticBuilder<'_>,
856856
trait_ref: &ty::TraitRef<'tcx>,
857857
bounds: hir::GenericBounds<'_>,
@@ -875,7 +875,7 @@ fn foo(&self) -> Self::T { String::new() }
875875
/// Given a span corresponding to a bound, provide a structured suggestion to set an
876876
/// associated type to a given type `ty`.
877877
fn constrain_associated_type_structured_suggestion(
878-
&self,
878+
self,
879879
db: &mut DiagnosticBuilder<'_>,
880880
span: Span,
881881
assoc: &ty::AssocItem,

0 commit comments

Comments
 (0)