@@ -58,8 +58,7 @@ pub fn const_lit(cx: @CrateContext, e: @ast::expr, lit: ast::lit)
5858 }
5959 _ => {
6060 cx. sess . span_bug ( lit. span ,
61- ~"floating point literal doesn' t have the right \
62- type ") ;
61+ "floating point literal doesn't have the right type" ) ;
6362 }
6463 }
6564 }
@@ -281,7 +280,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
281280 else { llvm:: LLVMConstURem ( te1, te2) }
282281 }
283282 ast:: and |
284- ast:: or => cx. sess. span_unimpl( e. span, ~ "binop logic") ,
283+ ast:: or => cx. sess. span_unimpl( e. span, "binop logic" ) ,
285284 ast:: bitxor => llvm:: LLVMConstXor ( te1, te2) ,
286285 ast:: bitand => llvm:: LLVMConstAnd ( te1, te2) ,
287286 ast:: bitor => llvm:: LLVMConstOr ( te1, te2) ,
@@ -295,7 +294,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
295294 ast:: le |
296295 ast:: ne |
297296 ast:: ge |
298- ast:: gt => cx. sess. span_unimpl( e. span, ~ "binop comparator")
297+ ast:: gt => cx. sess. span_unimpl( e. span, "binop comparator" )
299298 }
300299 }
301300 ast:: expr_unary( u, e) => {
@@ -344,8 +343,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
344343 const_eval:: const_int( i) => i as u64,
345344 const_eval:: const_uint( u) => u,
346345 _ => cx. sess. span_bug( index. span,
347- ~"index is not an integer-constant \
348- expression")
346+ "index is not an integer-constant expression" )
349347 } ;
350348 let ( arr, len) = match ty:: get( bt) . sty {
351349 ty : : ty_evec( _, vstore) | ty:: ty_estr( vstore) =>
@@ -363,12 +361,10 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
363361 unit_sz) )
364362 } ,
365363 _ => cx. sess. span_bug( base. span,
366- ~"index-expr base must be \
367- fixed-size or slice")
364+ "index-expr base must be fixed-size or slice" )
368365 } ,
369366 _ => cx. sess. span_bug( base. span,
370- ~"index-expr base must be \
371- a vector or string type ")
367+ "index-expr base must be a vector or string type" )
372368 } ;
373369
374370 let len = llvm:: LLVMConstIntGetZExtValue ( len) as u64;
@@ -380,7 +376,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
380376 // FIXME #3170: report this earlier on in the const-eval
381377 // pass. Reporting here is a bit late.
382378 cx. sess. span_err( e. span,
383- ~ "const index-expr is out of bounds") ;
379+ "const index-expr is out of bounds" ) ;
384380 }
385381 const_get_elt( cx, arr, [ iv as c_uint] )
386382 }
@@ -454,8 +450,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
454450 match fs. find( |f| field_ty. ident == f. node. ident) {
455451 Some ( ref f) => const_expr( cx, ( * f) . node. expr) ,
456452 None => {
457- cx. tcx. sess. span_bug(
458- e. span, ~"missing struct field") ;
453+ cx. tcx. sess. span_bug( e. span, "missing struct field" ) ;
459454 }
460455 }
461456 } ) ;
@@ -471,8 +466,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
471466 ast : : expr_lit( ref lit) => {
472467 match lit. node {
473468 ast : : lit_str( * ) => { const_expr( cx, sub) }
474- _ => { cx. sess. span_bug( e. span,
475- ~"bad const-slice lit") }
469+ _ => { cx. sess. span_bug( e. span, "bad const-slice lit" ) }
476470 }
477471 }
478472 ast:: expr_vec( ref es, ast:: m_imm) => {
@@ -487,8 +481,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
487481 let p = const_ptrcast( cx, gv, llunitty) ;
488482 C_struct ( ~[ p, sz] )
489483 }
490- _ => cx. sess. span_bug( e. span,
491- ~"bad const-slice expr")
484+ _ => cx. sess. span_bug( e. span, "bad const-slice expr" )
492485 }
493486 }
494487 ast:: expr_path( pth) => {
@@ -520,8 +513,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
520513 C_null ( llty)
521514 }
522515 _ => {
523- cx. sess. span_bug( e. span, ~"expected a const , fn, \
524- struct , or variant def")
516+ cx. sess. span_bug( e. span, "expected a const, fn, struct, or variant def" )
525517 }
526518 }
527519 }
@@ -542,13 +534,12 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
542534 adt:: trans_const( cx, repr, vinfo. disr_val,
543535 args. map( |a| const_expr( cx, * a) ) )
544536 }
545- _ => cx. sess. span_bug( e. span, ~"expected a struct or \
546- variant def")
537+ _ => cx. sess. span_bug( e. span, "expected a struct or variant def" )
547538 }
548539 }
549540 ast:: expr_paren( e) => { return const_expr( cx, e) ; }
550541 _ => cx. sess. span_bug( e. span,
551- ~ "bad constant expression type in consts:: const_expr")
542+ "bad constant expression type in consts::const_expr" )
552543 } ;
553544 }
554545}
0 commit comments