if r_borrow_var.is_none() { // create var lazilly, at most once
let coercion = Coercion(span);
let r = self.next_region_var(coercion);
- r_borrow_var = Some(self.tcx.mk_region(r)); // [4] above
+ r_borrow_var = Some(r); // [4] above
}
r_borrow_var.unwrap()
};
let coercion = Coercion(self.origin.span());
let r_borrow = self.next_region_var(coercion);
- let region = self.tcx.mk_region(r_borrow);
- (mt_a.ty, Some(AutoPtr(region, mt_b.mutbl)))
+ (mt_a.ty, Some(AutoPtr(r_borrow, mt_b.mutbl)))
}
(&ty::TyRef(_, mt_a), &ty::TyRawPtr(mt_b)) => {
coerce_mutbls(mt_a.mutbl, mt_b.mutbl)?;
coerce_unsized_did,
0,
source,
- vec![target]));
+ &[target]));
// Keep resolving `CoerceUnsized` and `Unsize` predicates to avoid
// emitting a coercion in cases like `Foo<$1>` -> `Foo<$2>`, where
// Object safety violations or miscellaneous.
Err(err) => {
- self.report_selection_error(&obligation, &err, None);
+ self.report_selection_error(&obligation, &err);
// Treat this like an obligation and follow through
// with the unsizing - the lack of a coercion should
// be silent, as it causes a type mismatch later.