take TyCtxt by value

This commit is contained in:
Bastian Kauschke 2020-09-19 12:38:24 +02:00
parent a219ad64a6
commit 67f319c30b
2 changed files with 3 additions and 3 deletions

View File

@ -1179,7 +1179,7 @@ impl<'tcx> TyCtxt<'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)
}

View File

@ -851,7 +851,7 @@ fn foo(&self) -> Self::T { String::new() }
/// 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 foo(&self) -> Self::T { String::new() }
/// 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,