]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/middle/typeck/infer/mod.rs
Replace all ~"" with "".to_owned()
[rust.git] / src / librustc / middle / typeck / infer / mod.rs
index d80a2518055898823b4d1dbb13a74ed8ed9100fe..b2143b7d7988c920047250a0a5e68546d6b79733 100644 (file)
@@ -248,10 +248,10 @@ pub enum fixup_err {
 
 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)
@@ -728,7 +728,7 @@ pub fn type_error_message_str_with_expected(&self,
                                                 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| {