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 11use libc:: c_uint;
22use llvm:: { self , SetUnnamedAddr , True } ;
33use rustc:: hir:: def_id:: DefId ;
4- use rustc:: mir:: interpret:: { ConstValue , Allocation , read_target_uint,
4+ use rustc:: mir:: interpret:: { Allocation , read_target_uint,
55 Pointer , ErrorHandled , GlobalId } ;
66use rustc:: hir:: Node ;
77use debuginfo;
@@ -69,12 +69,11 @@ pub fn codegen_static_initializer(
6969 } ;
7070 let param_env = ty:: ParamEnv :: reveal_all ( ) ;
7171 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,
7674 _ => bug ! ( "static const eval returned {:#?}" , static_) ,
77- }
75+ } ;
76+ assert_eq ! ( ptr. offset. bytes( ) , 0 ) ;
7877 Ok ( ( const_alloc_to_llvm ( cx, alloc) , alloc) )
7978}
8079
You can’t perform that action at this time.
0 commit comments