@@ -12,7 +12,7 @@ use rustc_target::spec::{LinkerFlavor, MergeFunctions, PanicStrategy, RelroLevel
1212use rustc_target:: spec:: { Target , TargetTriple } ;
1313
1414use syntax;
15- use syntax:: ast:: { self , IntTy , UintTy } ;
15+ use syntax:: ast;
1616use syntax:: source_map:: { FileName , FilePathMapping } ;
1717use syntax:: edition:: { Edition , EDITION_NAME_LIST , DEFAULT_EDITION } ;
1818use syntax:: symbol:: { sym, Symbol } ;
@@ -36,8 +36,7 @@ use std::path::{Path, PathBuf};
3636
3737pub struct Config {
3838 pub target : Target ,
39- pub isize_ty : IntTy ,
40- pub usize_ty : UintTy ,
39+ pub ptr_width : u32 ,
4140}
4241
4342#[ derive( Clone , Hash , Debug ) ]
@@ -1570,10 +1569,10 @@ pub fn build_target_config(opts: &Options, sp: &Handler) -> Config {
15701569 FatalError . raise ( ) ;
15711570 } ) ;
15721571
1573- let ( isize_ty , usize_ty ) = match & target. target_pointer_width [ ..] {
1574- "16" => ( ast :: IntTy :: I16 , ast :: UintTy :: U16 ) ,
1575- "32" => ( ast :: IntTy :: I32 , ast :: UintTy :: U32 ) ,
1576- "64" => ( ast :: IntTy :: I64 , ast :: UintTy :: U64 ) ,
1572+ let ptr_width = match & target. target_pointer_width [ ..] {
1573+ "16" => 16 ,
1574+ "32" => 32 ,
1575+ "64" => 64 ,
15771576 w => sp. fatal ( & format ! (
15781577 "target specification was invalid: \
15791578 unrecognized target-pointer-width {}",
@@ -1583,8 +1582,7 @@ pub fn build_target_config(opts: &Options, sp: &Handler) -> Config {
15831582
15841583 Config {
15851584 target,
1586- isize_ty,
1587- usize_ty,
1585+ ptr_width,
15881586 }
15891587}
15901588
0 commit comments