@@ -17,11 +17,11 @@ use rustc::lint::LateContext;
1717use rustc:: ty:: subst:: { Subst , Substs } ;
1818use rustc:: ty:: { self , Instance , Ty , TyCtxt } ;
1919use rustc:: { bug, span_bug} ;
20+ use rustc_data_structures:: sync:: Lrc ;
2021use std:: cmp:: Ordering :: { self , Equal } ;
2122use std:: cmp:: PartialOrd ;
2223use std:: convert:: TryInto ;
2324use std:: hash:: { Hash , Hasher } ;
24- use std:: rc:: Rc ;
2525use syntax:: ast:: { FloatTy , LitKind } ;
2626use syntax:: ptr:: P ;
2727
@@ -31,7 +31,7 @@ pub enum Constant {
3131 /// a String "abc"
3232 Str ( String ) ,
3333 /// a Binary String b"abc"
34- Binary ( Rc < Vec < u8 > > ) ,
34+ Binary ( Lrc < Vec < u8 > > ) ,
3535 /// a single char 'a'
3636 Char ( char ) ,
3737 /// an integer's bit representation
@@ -156,7 +156,7 @@ pub fn lit_to_constant<'tcx>(lit: &LitKind, ty: Ty<'tcx>) -> Constant {
156156 match * lit {
157157 LitKind :: Str ( ref is, _) => Constant :: Str ( is. to_string ( ) ) ,
158158 LitKind :: Byte ( b) => Constant :: Int ( u128:: from ( b) ) ,
159- LitKind :: ByteStr ( ref s) => Constant :: Binary ( Rc :: clone ( s) ) ,
159+ LitKind :: ByteStr ( ref s) => Constant :: Binary ( Lrc :: clone ( s) ) ,
160160 LitKind :: Char ( c) => Constant :: Char ( c) ,
161161 LitKind :: Int ( n, _) => Constant :: Int ( n) ,
162162 LitKind :: Float ( ref is, _) | LitKind :: FloatUnsuffixed ( ref is) => match ty. sty {
@@ -304,7 +304,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
304304 } ;
305305
306306 let result = self . tcx . const_eval ( self . param_env . and ( gid) ) . ok ( ) ?;
307- let ret = miri_to_const ( self . tcx , result) ;
307+ let ret = miri_to_const ( self . tcx , & result) ;
308308 if ret. is_some ( ) {
309309 self . needed_resolution = true ;
310310 }
0 commit comments