pub fn fixup_err_to_str(f: fixup_err) -> ~str {
match f {
- unresolved_int_ty(_) => ~"unconstrained integral type",
- unresolved_ty(_) => ~"unconstrained type",
- cyclic_ty(_) => ~"cyclic type of infinite size",
- unresolved_region(_) => ~"unconstrained region",
+ unresolved_int_ty(_) => "unconstrained integral type".to_owned(),
+ unresolved_ty(_) => "unconstrained type".to_owned(),
+ cyclic_ty(_) => "cyclic type of infinite size".to_owned(),
+ unresolved_region(_) => "unconstrained region".to_owned(),
region_var_bound_by_region_var(r1, r2) => {
format!("region var {:?} bound by another region var {:?}; this is \
a bug in rustc", r1, r2)
err: Option<&ty::type_err>) {
debug!("hi! expected_ty = {:?}, actual_ty = {}", expected_ty, actual_ty);
- let error_str = err.map_or(~"", |t_err| {
+ let error_str = err.map_or("".to_owned(), |t_err| {
format!(" ({})", ty::type_err_to_str(self.tcx, t_err))
});
let resolved_expected = expected_ty.map(|e_ty| {