File tree Expand file tree Collapse file tree 2 files changed +2
-13
lines changed
trunk/src/librustc/middle/trans Expand file tree Collapse file tree 2 files changed +2
-13
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: abae61257c4d866bb321bfb80ad16b7531736f7e
2
+ refs/heads/master: 349fa1e550905577fd9545aada328fb0806cf641
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
5
5
refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
Original file line number Diff line number Diff line change @@ -414,21 +414,10 @@ fn const_expr(cx: @crate_ctxt, e: @ast::expr) -> ValueRef {
414
414
// variant or we wouldn't have gotten here -- the constant
415
415
// checker forbids paths that don't map to C-like enum
416
416
// variants.
417
- let ety = ty:: expr_ty ( cx. tcx , e) ;
418
- let llty = type_of:: type_of ( cx, ety) ;
419
417
let lldiscrim = base:: get_discrim_val ( cx, e. span ,
420
418
enum_did,
421
419
variant_did) ;
422
-
423
- let fields = if ty:: enum_is_univariant ( cx. tcx , enum_did) {
424
- ~[ lldiscrim]
425
- } else {
426
- let llstructtys =
427
- lib:: llvm:: struct_element_types ( llty) ;
428
- ~[ lldiscrim, C_null ( llstructtys[ 1 ] ) ]
429
- } ;
430
-
431
- C_named_struct ( llty, fields)
420
+ C_struct ( ~[ lldiscrim] )
432
421
}
433
422
Some ( ast:: def_struct( _) ) => {
434
423
let ety = ty:: expr_ty ( cx. tcx , e) ;
You can’t perform that action at this time.
0 commit comments