File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
src/librustc_codegen_llvm Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 1
1
use libc:: c_uint;
2
2
use llvm:: { self , SetUnnamedAddr , True } ;
3
3
use rustc:: hir:: def_id:: DefId ;
4
- use rustc:: mir:: interpret:: { ConstValue , Allocation , read_target_uint,
4
+ use rustc:: mir:: interpret:: { Allocation , read_target_uint,
5
5
Pointer , ErrorHandled , GlobalId } ;
6
6
use rustc:: hir:: Node ;
7
7
use debuginfo;
@@ -69,12 +69,11 @@ pub fn codegen_static_initializer(
69
69
} ;
70
70
let param_env = ty:: ParamEnv :: reveal_all ( ) ;
71
71
let static_ = cx. tcx . const_eval ( param_env. and ( cid) ) ?;
72
- let ( alloc, ptr) = static_. alloc . unwrap ( ) ;
73
- assert_eq ! ( ptr. offset. bytes( ) , 0 ) ;
74
- match static_. val {
75
- ConstValue :: ByRef => { } ,
72
+ let ( alloc, ptr) = match static_. alloc {
73
+ Some ( alloc) => alloc,
76
74
_ => bug ! ( "static const eval returned {:#?}" , static_) ,
77
- }
75
+ } ;
76
+ assert_eq ! ( ptr. offset. bytes( ) , 0 ) ;
78
77
Ok ( ( const_alloc_to_llvm ( cx, alloc) , alloc) )
79
78
}
80
79
You can’t perform that action at this time.
0 commit comments