@@ -58,8 +58,7 @@ pub fn const_lit(cx: @CrateContext, e: @ast::expr, lit: ast::lit)
58
58
}
59
59
_ => {
60
60
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" ) ;
63
62
}
64
63
}
65
64
}
@@ -281,7 +280,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
281
280
else { llvm:: LLVMConstURem ( te1, te2) }
282
281
}
283
282
ast:: and |
284
- ast:: or => cx. sess. span_unimpl( e. span, ~ "binop logic") ,
283
+ ast:: or => cx. sess. span_unimpl( e. span, "binop logic" ) ,
285
284
ast:: bitxor => llvm:: LLVMConstXor ( te1, te2) ,
286
285
ast:: bitand => llvm:: LLVMConstAnd ( te1, te2) ,
287
286
ast:: bitor => llvm:: LLVMConstOr ( te1, te2) ,
@@ -295,7 +294,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
295
294
ast:: le |
296
295
ast:: ne |
297
296
ast:: ge |
298
- ast:: gt => cx. sess. span_unimpl( e. span, ~ "binop comparator")
297
+ ast:: gt => cx. sess. span_unimpl( e. span, "binop comparator" )
299
298
}
300
299
}
301
300
ast:: expr_unary( u, e) => {
@@ -344,8 +343,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
344
343
const_eval:: const_int( i) => i as u64,
345
344
const_eval:: const_uint( u) => u,
346
345
_ => cx. sess. span_bug( index. span,
347
- ~"index is not an integer-constant \
348
- expression")
346
+ "index is not an integer-constant expression" )
349
347
} ;
350
348
let ( arr, len) = match ty:: get( bt) . sty {
351
349
ty : : ty_evec( _, vstore) | ty:: ty_estr( vstore) =>
@@ -363,12 +361,10 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
363
361
unit_sz) )
364
362
} ,
365
363
_ => 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" )
368
365
} ,
369
366
_ => 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" )
372
368
} ;
373
369
374
370
let len = llvm:: LLVMConstIntGetZExtValue ( len) as u64;
@@ -380,7 +376,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
380
376
// FIXME #3170: report this earlier on in the const-eval
381
377
// pass. Reporting here is a bit late.
382
378
cx. sess. span_err( e. span,
383
- ~ "const index-expr is out of bounds") ;
379
+ "const index-expr is out of bounds" ) ;
384
380
}
385
381
const_get_elt( cx, arr, [ iv as c_uint] )
386
382
}
@@ -454,8 +450,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
454
450
match fs. find( |f| field_ty. ident == f. node. ident) {
455
451
Some ( ref f) => const_expr( cx, ( * f) . node. expr) ,
456
452
None => {
457
- cx. tcx. sess. span_bug(
458
- e. span, ~"missing struct field") ;
453
+ cx. tcx. sess. span_bug( e. span, "missing struct field" ) ;
459
454
}
460
455
}
461
456
} ) ;
@@ -471,8 +466,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
471
466
ast : : expr_lit( ref lit) => {
472
467
match lit. node {
473
468
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" ) }
476
470
}
477
471
}
478
472
ast:: expr_vec( ref es, ast:: m_imm) => {
@@ -487,8 +481,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
487
481
let p = const_ptrcast( cx, gv, llunitty) ;
488
482
C_struct ( ~[ p, sz] )
489
483
}
490
- _ => cx. sess. span_bug( e. span,
491
- ~"bad const-slice expr")
484
+ _ => cx. sess. span_bug( e. span, "bad const-slice expr" )
492
485
}
493
486
}
494
487
ast:: expr_path( pth) => {
@@ -520,8 +513,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
520
513
C_null ( llty)
521
514
}
522
515
_ => {
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" )
525
517
}
526
518
}
527
519
}
@@ -542,13 +534,12 @@ fn const_expr_unadjusted(cx: @CrateContext, e: @ast::expr) -> ValueRef {
542
534
adt:: trans_const( cx, repr, vinfo. disr_val,
543
535
args. map( |a| const_expr( cx, * a) ) )
544
536
}
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" )
547
538
}
548
539
}
549
540
ast:: expr_paren( e) => { return const_expr( cx, e) ; }
550
541
_ => cx. sess. span_bug( e. span,
551
- ~ "bad constant expression type in consts:: const_expr")
542
+ "bad constant expression type in consts::const_expr" )
552
543
} ;
553
544
}
554
545
}
0 commit comments