@@ -14,7 +14,7 @@ use std::cmp::PartialOrd;
14
14
use std:: convert:: TryInto ;
15
15
use std:: hash:: { Hash , Hasher } ;
16
16
use syntax:: ast:: { FloatTy , LitKind } ;
17
- use syntax_pos:: symbol:: { LocalInternedString , Symbol } ;
17
+ use syntax_pos:: symbol:: Symbol ;
18
18
19
19
/// A `LitKind`-like enum to fold constant `Expr`s into.
20
20
#[ derive( Debug , Clone ) ]
@@ -250,14 +250,18 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
250
250
if let ExprKind :: Path ( qpath) = & callee. node;
251
251
let res = self . tables. qpath_res( qpath, callee. hir_id) ;
252
252
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, ) ;
254
254
let def_path = get_def_path
255
255
. iter( )
256
- . map( LocalInternedString :: get)
256
+ . copied( )
257
+ . map( Symbol :: as_str)
257
258
. 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 ;
259
263
then {
260
- let value = match impl_ty {
264
+ let value = match & * def_path [ 2 ] {
261
265
"<impl i8>" => i8 :: max_value( ) as u128 ,
262
266
"<impl i16>" => i16 :: max_value( ) as u128 ,
263
267
"<impl i32>" => i32 :: max_value( ) as u128 ,
0 commit comments