@@ -14,7 +14,7 @@ use std::cmp::PartialOrd;
1414use std:: convert:: TryInto ;
1515use std:: hash:: { Hash , Hasher } ;
1616use syntax:: ast:: { FloatTy , LitKind } ;
17- use syntax_pos:: symbol:: { LocalInternedString , Symbol } ;
17+ use syntax_pos:: symbol:: Symbol ;
1818
1919/// A `LitKind`-like enum to fold constant `Expr`s into.
2020#[ derive( Debug , Clone ) ]
@@ -250,14 +250,18 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
250250 if let ExprKind :: Path ( qpath) = & callee. node;
251251 let res = self . tables. qpath_res( qpath, callee. hir_id) ;
252252 if let Some ( def_id) = res. opt_def_id( ) ;
253- let get_def_path = self . lcx. get_def_path( def_id) ;
253+ let get_def_path = self . lcx. get_def_path( def_id, ) ;
254254 let def_path = get_def_path
255255 . iter( )
256- . map( LocalInternedString :: get)
256+ . copied( )
257+ . map( Symbol :: as_str)
257258 . collect:: <Vec <_>>( ) ;
258- if let & [ "core" , "num" , impl_ty, "max_value" ] = & def_path[ ..] ;
259+ if def_path[ 0 ] == "core" ;
260+ if def_path[ 1 ] == "num" ;
261+ if def_path[ 3 ] == "max_value" ;
262+ if def_path. len( ) == 4 ;
259263 then {
260- let value = match impl_ty {
264+ let value = match & * def_path [ 2 ] {
261265 "<impl i8>" => i8 :: max_value( ) as u128 ,
262266 "<impl i16>" => i16 :: max_value( ) as u128 ,
263267 "<impl i32>" => i32 :: max_value( ) as u128 ,
0 commit comments