]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #6174 : sanxiyn/rust/static-string, r=brson
authorbors <bors@rust-lang.org>
Thu, 2 May 2013 05:06:37 +0000 (22:06 -0700)
committerbors <bors@rust-lang.org>
Thu, 2 May 2013 05:06:37 +0000 (22:06 -0700)
12 files changed:
src/librustc/driver/session.rs
src/librustc/middle/check_const.rs
src/librustc/middle/check_loop.rs
src/librustc/middle/check_match.rs
src/librustc/middle/kind.rs
src/librustc/middle/lint.rs
src/librustc/middle/liveness.rs
src/librustc/middle/mem_categorization.rs
src/librustc/middle/moves.rs
src/librustc/middle/privacy.rs
src/librustc/middle/region.rs
src/librustc/middle/ty.rs

index b9e0eeb3466696d88583f5129ce007ff8f459eeb..237b03bc20fb377aa44e837a58c39f2af42c4b64 100644 (file)
@@ -175,16 +175,16 @@ pub struct Session_ {
 pub type Session = @Session_;
 
 pub impl Session_ {
-    fn span_fatal(@self, sp: span, msg: ~str) -> ! {
+    fn span_fatal(@self, sp: span, msg: &str) -> ! {
         self.span_diagnostic.span_fatal(sp, msg)
     }
-    fn fatal(@self, msg: ~str) -> ! {
+    fn fatal(@self, msg: &str) -> ! {
         self.span_diagnostic.handler().fatal(msg)
     }
-    fn span_err(@self, sp: span, msg: ~str) {
+    fn span_err(@self, sp: span, msg: &str) {
         self.span_diagnostic.span_err(sp, msg)
     }
-    fn err(@self, msg: ~str) {
+    fn err(@self, msg: &str) {
         self.span_diagnostic.handler().err(msg)
     }
     fn has_errors(@self) -> bool {
@@ -193,31 +193,31 @@ fn has_errors(@self) -> bool {
     fn abort_if_errors(@self) {
         self.span_diagnostic.handler().abort_if_errors()
     }
-    fn span_warn(@self, sp: span, msg: ~str) {
+    fn span_warn(@self, sp: span, msg: &str) {
         self.span_diagnostic.span_warn(sp, msg)
     }
-    fn warn(@self, msg: ~str) {
+    fn warn(@self, msg: &str) {
         self.span_diagnostic.handler().warn(msg)
     }
-    fn span_note(@self, sp: span, msg: ~str) {
+    fn span_note(@self, sp: span, msg: &str) {
         self.span_diagnostic.span_note(sp, msg)
     }
-    fn note(@self, msg: ~str) {
+    fn note(@self, msg: &str) {
         self.span_diagnostic.handler().note(msg)
     }
-    fn span_bug(@self, sp: span, msg: ~str) -> ! {
+    fn span_bug(@self, sp: span, msg: &str) -> ! {
         self.span_diagnostic.span_bug(sp, msg)
     }
-    fn bug(@self, msg: ~str) -> ! {
+    fn bug(@self, msg: &str) -> ! {
         self.span_diagnostic.handler().bug(msg)
     }
-    fn span_unimpl(@self, sp: span, msg: ~str) -> ! {
+    fn span_unimpl(@self, sp: span, msg: &str) -> ! {
         self.span_diagnostic.span_unimpl(sp, msg)
     }
-    fn unimpl(@self, msg: ~str) -> ! {
+    fn unimpl(@self, msg: &str) -> ! {
         self.span_diagnostic.handler().unimpl(msg)
     }
-    fn span_lint_level(@self, level: lint::level, sp: span, msg: ~str) {
+    fn span_lint_level(@self, level: lint::level, sp: span, msg: &str) {
         match level {
           lint::allow => { },
           lint::warn => self.span_warn(sp, msg),
@@ -230,7 +230,7 @@ fn span_lint(@self, lint_mode: lint::lint,
                  expr_id: ast::node_id,
                  item_id: ast::node_id,
                  span: span,
-                 msg: ~str) {
+                 msg: &str) {
         let level = lint::get_lint_settings_level(
             self.lint_settings, lint_mode, expr_id, item_id);
         self.span_lint_level(level, span, msg);
index 36be65ed63f5b30cd3dc135ad397ac39483bf3a2..4e21fcb5bd97dce13d846235d3cefd9a5f3bc59a 100644 (file)
@@ -92,13 +92,13 @@ pub fn check_expr(sess: Session,
           expr_unary(deref, _) => { }
           expr_unary(box(_), _) | expr_unary(uniq(_), _) => {
             sess.span_err(e.span,
-                          ~"disallowed operator in constant expression");
+                          "disallowed operator in constant expression");
             return;
           }
           expr_lit(@codemap::spanned {node: lit_str(_), _}) => { }
           expr_binary(_, _, _) | expr_unary(_, _) => {
             if method_map.contains_key(&e.id) {
-                sess.span_err(e.span, ~"user-defined operators are not \
+                sess.span_err(e.span, "user-defined operators are not \
                                        allowed in constant expressions");
             }
           }
@@ -118,8 +118,8 @@ pub fn check_expr(sess: Session,
             // a path in trans::callee that only works in block contexts.
             if pth.types.len() != 0 {
                 sess.span_err(
-                    e.span, ~"paths in constants may only refer to \
-                              items without type parameters");
+                    e.span, "paths in constants may only refer to \
+                             items without type parameters");
             }
             match def_map.find(&e.id) {
               Some(&def_const(_)) |
@@ -131,11 +131,11 @@ pub fn check_expr(sess: Session,
                 debug!("(checking const) found bad def: %?", def);
                 sess.span_err(
                     e.span,
-                    fmt!("paths in constants may only refer to \
-                          constants or functions"));
+                    "paths in constants may only refer to \
+                     constants or functions");
               }
               None => {
-                sess.span_bug(e.span, ~"unbound path in const?!");
+                sess.span_bug(e.span, "unbound path in const?!");
               }
             }
           }
@@ -146,8 +146,8 @@ pub fn check_expr(sess: Session,
                 _ => {
                     sess.span_err(
                         e.span,
-                        ~"function calls in constants are limited to \
-                          struct and enum constructors");
+                        "function calls in constants are limited to \
+                         struct and enum constructors");
                 }
             }
           }
@@ -163,12 +163,12 @@ pub fn check_expr(sess: Session,
           expr_addr_of(*) => {
                 sess.span_err(
                     e.span,
-                    ~"borrowed pointers in constants may only refer to \
-                      immutable values");
+                    "borrowed pointers in constants may only refer to \
+                     immutable values");
           }
           _ => {
             sess.span_err(e.span,
-                          ~"constant contains unimplemented expression type");
+                          "constant contains unimplemented expression type");
             return;
           }
         }
@@ -178,14 +178,14 @@ pub fn check_expr(sess: Session,
         if t != ty_char {
             if (v as u64) > ast_util::int_ty_max(
                 if t == ty_i { sess.targ_cfg.int_type } else { t }) {
-                sess.span_err(e.span, ~"literal out of range for its type");
+                sess.span_err(e.span, "literal out of range for its type");
             }
         }
       }
       expr_lit(@codemap::spanned {node: lit_uint(v, t), _}) => {
         if v > ast_util::uint_ty_max(
             if t == ty_u { sess.targ_cfg.uint_type } else { t }) {
-            sess.span_err(e.span, ~"literal out of range for its type");
+            sess.span_err(e.span, "literal out of range for its type");
         }
       }
       _ => ()
@@ -224,7 +224,7 @@ struct env {
 
     fn visit_item(it: @item, env: env, v: visit::vt<env>) {
         if env.idstack.contains(&(it.id)) {
-            env.sess.span_fatal(env.root_it.span, ~"recursive constant");
+            env.sess.span_fatal(env.root_it.span, "recursive constant");
         }
         env.idstack.push(it.id);
         visit::visit_item(it, env, v);
index 9f26f7f83724f0276d03789a92767a2d6c21a9a3..e3b816fceb8bb49540b66e6e89288fd172c62ec3 100644 (file)
@@ -54,17 +54,17 @@ pub fn check_crate(tcx: ty::ctxt, crate: @crate) {
               }
               expr_break(_) => {
                 if !cx.in_loop {
-                    tcx.sess.span_err(e.span, ~"`break` outside of loop");
+                    tcx.sess.span_err(e.span, "`break` outside of loop");
                 }
               }
               expr_again(_) => {
                 if !cx.in_loop {
-                    tcx.sess.span_err(e.span, ~"`again` outside of loop");
+                    tcx.sess.span_err(e.span, "`again` outside of loop");
                 }
               }
               expr_ret(oe) => {
                 if !cx.can_ret {
-                    tcx.sess.span_err(e.span, ~"`return` in block function");
+                    tcx.sess.span_err(e.span, "`return` in block function");
                 }
                 visit::visit_expr_opt(oe, cx, v);
               }
index e412a0e51027cf8c9cafdedf86b592160d53cac7..479271cf458dd6fe4e06d4d1def28ca03e193514 100644 (file)
@@ -94,7 +94,7 @@ pub fn check_expr(cx: @MatchCheckCtxt, ex: @expr, s: (), v: visit::vt<()>) {
        }
        let arms = vec::concat(arms.filter_mapped(unguarded_pat));
        if arms.is_empty() {
-           cx.tcx.sess.span_err(ex.span, ~"non-exhaustive patterns");
+           cx.tcx.sess.span_err(ex.span, "non-exhaustive patterns");
        } else {
            check_exhaustive(cx, ex.span, arms);
        }
@@ -111,7 +111,7 @@ pub fn check_arms(cx: @MatchCheckCtxt, arms: &[arm]) {
             let v = ~[*pat];
             match is_useful(cx, &seen, v) {
               not_useful => {
-                cx.tcx.sess.span_err(pat.span, ~"unreachable pattern");
+                cx.tcx.sess.span_err(pat.span, "unreachable pattern");
               }
               _ => ()
             }
@@ -685,7 +685,7 @@ pub fn check_local(cx: @MatchCheckCtxt,
     visit::visit_local(loc, s, v);
     if is_refutable(cx, loc.node.pat) {
         cx.tcx.sess.span_err(loc.node.pat.span,
-                          ~"refutable pattern in local binding");
+                             "refutable pattern in local binding");
     }
 
     // Check legality of move bindings.
@@ -708,7 +708,7 @@ pub fn check_fn(cx: @MatchCheckCtxt,
     for decl.inputs.each |input| {
         if is_refutable(cx, input.pat) {
             cx.tcx.sess.span_err(input.pat.span,
-                              ~"refutable pattern in function argument");
+                                 "refutable pattern in function argument");
         }
     }
 }
@@ -780,24 +780,24 @@ pub fn check_legality_of_move_bindings(cx: @MatchCheckCtxt,
         if sub.is_some() {
             tcx.sess.span_err(
                 p.span,
-                ~"cannot bind by-move with sub-bindings");
+                "cannot bind by-move with sub-bindings");
         } else if has_guard {
             tcx.sess.span_err(
                 p.span,
-                ~"cannot bind by-move into a pattern guard");
+                "cannot bind by-move into a pattern guard");
         } else if by_ref_span.is_some() {
             tcx.sess.span_err(
                 p.span,
-                ~"cannot bind by-move and by-ref \
-                  in the same pattern");
+                "cannot bind by-move and by-ref \
+                 in the same pattern");
             tcx.sess.span_note(
                 by_ref_span.get(),
-                ~"by-ref binding occurs here");
+                "by-ref binding occurs here");
         } else if is_lvalue {
             tcx.sess.span_err(
                 p.span,
-                ~"cannot bind by-move when \
-                  matching an lvalue");
+                "cannot bind by-move when \
+                 matching an lvalue");
         }
     };
 
@@ -837,9 +837,9 @@ pub fn check_legality_of_move_bindings(cx: @MatchCheckCtxt,
                         {
                             cx.tcx.sess.span_err(
                                 pat.span,
-                                ~"by-move pattern \
-                                  bindings may not occur \
-                                  behind @ or & bindings");
+                                "by-move pattern \
+                                 bindings may not occur \
+                                 behind @ or & bindings");
                         }
 
                         match sub {
index 90e6f7c6af92b7eebc261cc639f90ee4e8cf3072..6cdc96f7809a9ef29f1315bd0631eb3ef6a7bb3a 100644 (file)
@@ -97,21 +97,21 @@ fn check_struct_safe_for_destructor(cx: Context,
         });
         if !ty::type_is_owned(cx.tcx, struct_ty) {
             cx.tcx.sess.span_err(span,
-                                 ~"cannot implement a destructor on a struct \
-                                   that is not Owned");
+                                 "cannot implement a destructor on a struct \
+                                  that is not Owned");
             cx.tcx.sess.span_note(span,
-                                  ~"use \"#[unsafe_destructor]\" on the \
-                                    implementation to force the compiler to \
-                                    allow this");
+                                  "use \"#[unsafe_destructor]\" on the \
+                                   implementation to force the compiler to \
+                                   allow this");
         }
     } else {
         cx.tcx.sess.span_err(span,
-                             ~"cannot implement a destructor on a struct \
-                               with type parameters");
+                             "cannot implement a destructor on a struct \
+                              with type parameters");
         cx.tcx.sess.span_note(span,
-                              ~"use \"#[unsafe_destructor]\" on the \
-                                implementation to force the compiler to \
-                                allow this");
+                              "use \"#[unsafe_destructor]\" on the \
+                               implementation to force the compiler to \
+                               allow this");
     }
 }
 
@@ -143,10 +143,10 @@ fn check_item(item: @item, cx: Context, visitor: visit::vt<Context>) {
                                 }
                                 _ => {
                                     cx.tcx.sess.span_bug(self_type.span,
-                                                         ~"the self type for \
-                                                           the Drop trait \
-                                                           impl is not a \
-                                                           path");
+                                                         "the self type for \
+                                                          the Drop trait \
+                                                          impl is not a \
+                                                          path");
                                 }
                             }
                         }
@@ -193,7 +193,7 @@ fn check_for_block(_cx: Context, _fv: @freevar_entry) {
     fn check_for_bare(cx: Context, fv: @freevar_entry) {
         cx.tcx.sess.span_err(
             fv.span,
-            ~"attempted dynamic environment capture");
+            "attempted dynamic environment capture");
     }
 
     let fty = ty::node_id_to_type(cx.tcx, id);
@@ -409,7 +409,7 @@ fn check_imm_free_var(cx: Context, def: def, sp: span) {
             if is_mutbl {
                 cx.tcx.sess.span_err(
                     sp,
-                    ~"mutable variables cannot be implicitly captured");
+                    "mutable variables cannot be implicitly captured");
             }
         }
         def_arg(*) => { /* ok */ }
@@ -451,12 +451,12 @@ pub fn check_durable(tcx: ty::ctxt, ty: ty::t, sp: span) -> bool {
     if !ty::type_is_durable(tcx, ty) {
         match ty::get(ty).sty {
           ty::ty_param(*) => {
-            tcx.sess.span_err(sp, ~"value may contain borrowed \
-                                    pointers; use `'static` bound");
+            tcx.sess.span_err(sp, "value may contain borrowed \
+                                   pointers; use `'static` bound");
           }
           _ => {
-            tcx.sess.span_err(sp, ~"value may contain borrowed \
-                                    pointers");
+            tcx.sess.span_err(sp, "value may contain borrowed \
+                                   pointers");
           }
         }
         false
@@ -581,7 +581,7 @@ pub fn check_kind_bounds_of_cast(cx: Context, source: @expr, target: @expr) {
             if !ty::type_is_owned(cx.tcx, source_ty) {
                 cx.tcx.sess.span_err(
                     target.span,
-                    ~"uniquely-owned trait objects must be sendable");
+                    "uniquely-owned trait objects must be sendable");
             }
         }
         _ => {} // Nothing to do.
index f6db25065b7a8450a7a2df25cbc0c397c74172d0..265d6b0c7677cdf3c68e44d101ec1aa351b08e0f 100644 (file)
@@ -338,14 +338,14 @@ fn with_lint_attrs(&self, attrs: ~[ast::attribute], f: &fn(Context)) {
                           _ => {
                             self.sess.span_err(
                                 meta.span,
-                                ~"malformed lint attribute");
+                                "malformed lint attribute");
                           }
                         }
                     }
                   }
                   _  => {
                     self.sess.span_err(meta.span,
-                                       ~"malformed lint attribute");
+                                       "malformed lint attribute");
                   }
                 }
             }
@@ -485,8 +485,8 @@ fn check_item_while_true(cx: ty::ctxt, it: @ast::item) {
                                 cx.sess.span_lint(
                                     while_true, e.id, it.id,
                                     e.span,
-                                    ~"denote infinite loops \
-                                      with loop { ... }");
+                                    "denote infinite loops \
+                                     with loop { ... }");
                             }
                             _ => ()
                         }
@@ -603,7 +603,7 @@ fn is_comparison(binop: ast::binop) -> bool {
                     && !check_limits(cx, *binop, l, r) {
                     cx.sess.span_lint(
                         type_limits, e.id, it.id, e.span,
-                        ~"comparison is useless due to type limits");
+                        "comparison is useless due to type limits");
                 }
             }
             _ => ()
@@ -630,7 +630,7 @@ fn check_item_default_methods(cx: ty::ctxt, item: @ast::item) {
                             item.id,
                             item.id,
                             item.span,
-                            ~"default methods are experimental");
+                            "default methods are experimental");
                     }
                 }
             }
@@ -649,7 +649,7 @@ fn check_item_deprecated_mutable_fields(cx: ty::ctxt, item: @ast::item) {
                                           item.id,
                                           item.id,
                                           field.span,
-                                          ~"mutable fields are deprecated");
+                                          "mutable fields are deprecated");
                     }
                     ast::named_field(*) | ast::unnamed_field => {}
                 }
@@ -672,14 +672,14 @@ fn check_foreign_fn(cx: ty::ctxt, fn_id: ast::node_id,
                     cx.sess.span_lint(
                         ctypes, id, fn_id,
                         ty.span,
-                        ~"found rust type `int` in foreign module, while \
+                        "found rust type `int` in foreign module, while \
                          libc::c_int or libc::c_long should be used");
                   }
                   ast::def_prim_ty(ast::ty_uint(ast::ty_u)) => {
                     cx.sess.span_lint(
                         ctypes, id, fn_id,
                         ty.span,
-                        ~"found rust type `uint` in foreign module, while \
+                        "found rust type `uint` in foreign module, while \
                          libc::c_uint or libc::c_ulong should be used");
                   }
                   _ => ()
@@ -795,7 +795,7 @@ fn check_item_path_statement(cx: ty::ctxt, it: @ast::item) {
                         cx.sess.span_lint(
                             path_statement, id, it.id,
                             s.span,
-                            ~"path statement with no effect");
+                            "path statement with no effect");
                     }
                     _ => ()
                 }
@@ -835,8 +835,8 @@ fn check_case(cx: ty::ctxt, ident: ast::ident,
         if !is_camel_case(cx, ident) {
             cx.sess.span_lint(
                 non_camel_case_types, expr_id, item_id, span,
-                ~"type, variant, or trait should have \
-                  a camel case identifier");
+                "type, variant, or trait should have \
+                 a camel case identifier");
         }
     }
 
@@ -863,7 +863,7 @@ fn check_item_unused_unsafe(cx: ty::ctxt, it: @ast::item) {
                 if !cx.used_unsafe.contains(&blk.node.id) {
                     cx.sess.span_lint(unused_unsafe, blk.node.id, it.id,
                                       blk.span,
-                                      ~"unnecessary `unsafe` block");
+                                      "unnecessary `unsafe` block");
                 }
             }
             _ => ()
@@ -888,9 +888,9 @@ fn check_item_unused_mut(tcx: ty::ctxt, it: @ast::item) {
         }
         if !used {
             let msg = if bindings == 1 {
-                ~"variable does not need to be mutable"
+                "variable does not need to be mutable"
             } else {
-                ~"variables do not need to be mutable"
+                "variables do not need to be mutable"
             };
             tcx.sess.span_lint(unused_mut, p.id, it.id, p.span, msg);
         }
index 0df10c59a8aac7ffbb4dfa280d51475684655dde..40d62cac3572d98b942fd1a37b8b2a12cd8f5377 100644 (file)
@@ -359,7 +359,7 @@ fn captures(&mut self, expr: @expr) -> @~[CaptureInfo] {
         match self.capture_info_map.find(&expr.id) {
           Some(&caps) => caps,
           None => {
-            self.tcx.sess.span_bug(expr.span, ~"no registered caps");
+            self.tcx.sess.span_bug(expr.span, "no registered caps");
           }
         }
     }
@@ -687,7 +687,7 @@ fn variable_from_def_map(&self, node_id: node_id,
           }
           None => {
             self.tcx.sess.span_bug(
-                span, ~"Not present in def map")
+                span, "Not present in def map")
           }
         }
     }
@@ -804,15 +804,15 @@ fn find_loop_scope(&self, opt_label: Option<ident>, id: node_id, sp: span)
                       // to find with one
                 match self.tcx.def_map.find(&id) {
                     Some(&def_label(loop_id)) => loop_id,
-                    _ => self.tcx.sess.span_bug(sp, ~"Label on break/loop \
-                                                    doesn't refer to a loop")
+                    _ => self.tcx.sess.span_bug(sp, "Label on break/loop \
+                                                     doesn't refer to a loop")
                 },
             None => {
                 // Vanilla 'break' or 'loop', so use the enclosing
                 // loop scope
                 let loop_scope = &mut *self.loop_scope;
                 if loop_scope.len() == 0 {
-                    self.tcx.sess.span_bug(sp, ~"break outside loop");
+                    self.tcx.sess.span_bug(sp, "break outside loop");
                 }
                 else {
                     // FIXME(#5275): this shouldn't have to be a method...
@@ -994,7 +994,7 @@ fn propagate_through_stmt(&self, stmt: @stmt, succ: LiveNode)
           }
 
           stmt_mac(*) => {
-            self.tcx.sess.span_bug(stmt.span, ~"unexpanded macro");
+            self.tcx.sess.span_bug(stmt.span, "unexpanded macro");
           }
         }
     }
@@ -1164,7 +1164,7 @@ fn propagate_through_expr(&self, expr: @expr, succ: LiveNode)
               match self.break_ln.find(&sc) {
                   Some(&b) => b,
                   None => self.tcx.sess.span_bug(expr.span,
-                                ~"Break to unknown label")
+                                                 "Break to unknown label")
               }
           }
 
@@ -1178,7 +1178,7 @@ fn propagate_through_expr(&self, expr: @expr, succ: LiveNode)
               match self.cont_ln.find(&sc) {
                   Some(&b) => b,
                   None => self.tcx.sess.span_bug(expr.span,
-                                ~"Loop to unknown label")
+                                                 "Loop to unknown label")
               }
           }
 
@@ -1304,7 +1304,7 @@ fn propagate_through_expr(&self, expr: @expr, succ: LiveNode)
           }
 
           expr_mac(*) => {
-            self.tcx.sess.span_bug(expr.span, ~"unexpanded macro");
+            self.tcx.sess.span_bug(expr.span, "unexpanded macro");
           }
         }
     }
@@ -1618,10 +1618,10 @@ fn check_ret(@self, id: node_id, sp: span, _fk: &visit::fn_kind,
             } else if ty::type_is_bot(t_ret) {
                 // for bot return types, not ok.  Function should fail.
                 self.tcx.sess.span_err(
-                    sp, ~"some control paths may return");
+                    sp, "some control paths may return");
             } else {
                 self.tcx.sess.span_err(
-                    sp, ~"not all control paths return a value");
+                    sp, "not all control paths return a value");
             }
         }
     }
@@ -1712,10 +1712,10 @@ fn check_for_reassignment(@self, ln: LiveNode, var: Variable,
               None => {
                 self.tcx.sess.span_err(
                     span,
-                    ~"re-assignment of immutable variable");
+                    "re-assignment of immutable variable");
                 self.tcx.sess.span_note(
                     orig_span,
-                    ~"prior assignment occurs here");
+                    "prior assignment occurs here");
               }
             }
           }
index 7fa198be1d47fa75b14f616b5c73eefd0f428f04..866bd5377b9bac060004495e24376fd75c74eef0 100644 (file)
@@ -928,7 +928,7 @@ fn cat_pattern(&self,
                 _ => {
                     self.tcx.sess.span_bug(
                         pat.span,
-                        ~"enum pattern didn't resolve to enum or struct");
+                        "enum pattern didn't resolve to enum or struct");
                 }
             }
           }
index fe1466bf808a372d99f985943eee75c6ba581b82..ecee2ea1a2fb264191d755511a9c292c0a381110 100644 (file)
@@ -424,7 +424,7 @@ fn use_expr(&self,
                     MoveInWhole => {
                         self.tcx.sess.span_bug(
                             expr.span,
-                            fmt!("Component mode can never be MoveInWhole"));
+                            "Component mode can never be MoveInWhole");
                     }
                 }
             }
@@ -647,7 +647,7 @@ fn use_expr(&self,
             expr_mac(*) => {
                 self.tcx.sess.span_bug(
                     expr.span,
-                    ~"macro expression remains after expansion");
+                    "macro expression remains after expansion");
             }
         }
     }
index a37ebdcfaa263345260123f5c382cb1979e32c9f..be98195621902b8980899223e66630847e71e6b9 100644 (file)
@@ -99,8 +99,8 @@ pub fn check_crate(tcx: ty::ctxt,
                                          parental_privacy == Public)
                                          == Private {
             tcx.sess.span_err(span,
-                ~"can only dereference enums \
-                  with a single, public variant");
+                "can only dereference enums \
+                 with a single, public variant");
         }
     };
 
@@ -121,8 +121,8 @@ pub fn check_crate(tcx: ty::ctxt,
                                             tcx.sess.parse_sess.interner)));
             }
             None => {
-                tcx.sess.span_bug(span, ~"method not found in \
-                                          AST map?!");
+                tcx.sess.span_bug(span, "method not found in \
+                                         AST map?!");
             }
         }
     };
@@ -140,8 +140,8 @@ pub fn check_crate(tcx: ty::ctxt,
                 // Look up the enclosing impl.
                 if container_id.crate != local_crate {
                     tcx.sess.span_bug(span,
-                                      ~"local method isn't in local \
-                                        impl?!");
+                                      "local method isn't in local \
+                                       impl?!");
                 }
 
                 match tcx.items.find(&container_id.node) {
@@ -155,10 +155,10 @@ pub fn check_crate(tcx: ty::ctxt,
                         }
                     }
                     Some(_) => {
-                        tcx.sess.span_bug(span, ~"impl wasn't an item?!");
+                        tcx.sess.span_bug(span, "impl wasn't an item?!");
                     }
                     None => {
-                        tcx.sess.span_bug(span, ~"impl wasn't in AST map?!");
+                        tcx.sess.span_bug(span, "impl wasn't in AST map?!");
                     }
                 }
             }
@@ -185,8 +185,8 @@ pub fn check_crate(tcx: ty::ctxt,
                                             tcx.sess.parse_sess.interner)));
             }
             None => {
-                tcx.sess.span_bug(span, ~"method not found in \
-                                          AST map?!");
+                tcx.sess.span_bug(span, "method not found in \
+                                         AST map?!");
             }
         }
     };
@@ -219,7 +219,7 @@ pub fn check_crate(tcx: ty::ctxt,
                                                    .interner)));
                 }
                 None => {
-                    tcx.sess.span_bug(span, ~"item not found in AST map?!");
+                    tcx.sess.span_bug(span, "item not found in AST map?!");
                 }
             }
         };
@@ -333,10 +333,10 @@ pub fn check_crate(tcx: ty::ctxt,
                             match item.node {
                                 item_trait(_, _, ref methods) => {
                                     if method_num >= (*methods).len() {
-                                        tcx.sess.span_bug(span, ~"method \
-                                                                  number \
-                                                                  out of \
-                                                                  range?!");
+                                        tcx.sess.span_bug(span, "method \
+                                                                 number \
+                                                                 out of \
+                                                                 range?!");
                                     }
                                     match (*methods)[method_num] {
                                         provided(method)
@@ -363,20 +363,20 @@ pub fn check_crate(tcx: ty::ctxt,
                                     }
                                 }
                                 _ => {
-                                    tcx.sess.span_bug(span, ~"trait wasn't \
-                                                              actually a \
-                                                              trait?!");
+                                    tcx.sess.span_bug(span, "trait wasn't \
+                                                             actually a \
+                                                             trait?!");
                                 }
                             }
                         }
                         Some(_) => {
-                            tcx.sess.span_bug(span, ~"trait wasn't an \
-                                                      item?!");
+                            tcx.sess.span_bug(span, "trait wasn't an \
+                                                     item?!");
                         }
                         None => {
-                            tcx.sess.span_bug(span, ~"trait item wasn't \
-                                                      found in the AST \
-                                                      map?!");
+                            tcx.sess.span_bug(span, "trait item wasn't \
+                                                     found in the AST \
+                                                     map?!");
                         }
                     }
                 } else {
@@ -465,8 +465,8 @@ pub fn check_crate(tcx: ty::ctxt,
                             match method_map.find(&expr.id) {
                                 None => {
                                     tcx.sess.span_bug(expr.span,
-                                                      ~"method call not in \
-                                                        method map");
+                                                      "method call not in \
+                                                       method map");
                                 }
                                 Some(ref entry) => {
                                     debug!("(privacy checking) checking \
@@ -512,18 +512,18 @@ struct variant \
                                     }
                                     _ => {
                                         tcx.sess.span_bug(expr.span,
-                                                          ~"resolve didn't \
-                                                            map enum struct \
-                                                            constructor to a \
-                                                            variant def");
+                                                          "resolve didn't \
+                                                           map enum struct \
+                                                           constructor to a \
+                                                           variant def");
                                     }
                                 }
                             }
                         }
                         _ => {
-                            tcx.sess.span_bug(expr.span, ~"struct expr \
-                                                           didn't have \
-                                                           struct type?!");
+                            tcx.sess.span_bug(expr.span, "struct expr \
+                                                          didn't have \
+                                                          struct type?!");
                         }
                     }
                 }
@@ -579,18 +579,18 @@ struct variant \
                                     }
                                     _ => {
                                         tcx.sess.span_bug(pattern.span,
-                                                          ~"resolve didn't \
-                                                            map enum struct \
-                                                            pattern to a \
-                                                            variant def");
+                                                          "resolve didn't \
+                                                           map enum struct \
+                                                           pattern to a \
+                                                           variant def");
                                     }
                                 }
                             }
                         }
                         _ => {
                             tcx.sess.span_bug(pattern.span,
-                                              ~"struct pattern didn't have \
-                                                struct type?!");
+                                              "struct pattern didn't have \
+                                               struct type?!");
                         }
                     }
                 }
index 88e201fb5f4385de044ce49b849109f33915e426..4faa2150003f02d4c5fd0c4941c92b15ac7024ea 100644 (file)
@@ -320,7 +320,7 @@ fn ancestors_of(self: &RegionMaps, scope: ast::node_id)
 pub fn parent_id(cx: ctxt, span: span) -> ast::node_id {
     match cx.parent {
       None => {
-        cx.sess.span_bug(span, ~"crate should not be parent here");
+        cx.sess.span_bug(span, "crate should not be parent here");
       }
       Some(parent_id) => {
         parent_id
index 1546c885a6d624b7b5609aa3311f8a091be7c7a3..3c8f100d1c9337645ca5aad1920f1a7d4fa8c608 100644 (file)
@@ -3261,7 +3261,7 @@ pub fn expr_kind(tcx: ctxt,
         ast::expr_mac(*) => {
             tcx.sess.span_bug(
                 expr.span,
-                ~"macro expression remains after expansion");
+                "macro expression remains after expansion");
         }
     }
 }
@@ -4242,27 +4242,27 @@ pub fn eval_repeat_count(tcx: ctxt, count_expr: @ast::expr) -> uint {
         const_eval::const_uint(count) => return count as uint,
         const_eval::const_float(count) => {
             tcx.sess.span_err(count_expr.span,
-                              ~"expected signed or unsigned integer for \
-                                repeat count but found float");
+                              "expected signed or unsigned integer for \
+                               repeat count but found float");
             return count as uint;
         }
         const_eval::const_str(_) => {
             tcx.sess.span_err(count_expr.span,
-                              ~"expected signed or unsigned integer for \
-                                repeat count but found string");
+                              "expected signed or unsigned integer for \
+                               repeat count but found string");
             return 0;
         }
         const_eval::const_bool(_) => {
             tcx.sess.span_err(count_expr.span,
-                              ~"expected signed or unsigned integer for \
-                                repeat count but found boolean");
+                              "expected signed or unsigned integer for \
+                               repeat count but found boolean");
             return 0;
         }
       },
       Err(*) => {
         tcx.sess.span_err(count_expr.span,
-                          ~"expected constant integer for repeat count \
-                            but found variable");
+                          "expected constant integer for repeat count \
+                           but found variable");
         return 0;
       }
     }