// some cases applied on the RHS, on top of which we need
// to autoref, which is not allowed by apply_adjustments.
// self.apply_adjustments(rhs_expr, vec![autoref]);
- self.tables
+ self.typeck_results
.borrow_mut()
.adjustments_mut()
.entry(rhs_expr.hir_id)
err.span_label(span, ty.to_string());
if let FnDef(def_id, _) = ty.kind {
let source_map = self.tcx.sess.source_map();
- if !self.tcx.has_typeck_tables(def_id) {
+ if !self.tcx.has_typeck_results(def_id) {
return false;
}
// We're emitting a suggestion, so we can just ignore regions
let fn_sig = self.tcx.fn_sig(def_id).skip_binder();
let other_ty = if let FnDef(def_id, _) = other_ty.kind {
- if !self.tcx.has_typeck_tables(def_id) {
+ if !self.tcx.has_typeck_results(def_id) {
return false;
}
// We're emitting a suggestion, so we can just ignore regions
on the left and may require reallocation. This \
requires ownership of the string on the left";
- let is_std_string = |ty| &format!("{:?}", ty) == "std::string::String";
+ let string_type = self.tcx.get_diagnostic_item(sym::string_type);
+ let is_std_string = |ty: Ty<'tcx>| match ty.ty_adt_def() {
+ Some(ty_def) => Some(ty_def.did) == string_type,
+ None => false,
+ };
match (&lhs_ty.kind, &rhs_ty.kind) {
(&Ref(_, l_ty, _), &Ref(_, r_ty, _)) // &str or &String + &str, &String or &&str