File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -261,7 +261,7 @@ pub fn layout_of_ty_query(
261261 }
262262 // Potentially-wide pointers.
263263 TyKind :: Ref ( _, _, pointee) | TyKind :: Raw ( _, pointee) => {
264- let mut data_ptr = scalar_unit ( dl, Primitive :: Pointer ( AddressSpace :: DATA ) ) ;
264+ let mut data_ptr = scalar_unit ( dl, Primitive :: Pointer ( AddressSpace :: ZERO ) ) ;
265265 if matches ! ( ty. kind( Interner ) , TyKind :: Ref ( ..) ) {
266266 data_ptr. valid_range_mut ( ) . start = 1 ;
267267 }
@@ -285,7 +285,7 @@ pub fn layout_of_ty_query(
285285 scalar_unit ( dl, Primitive :: Int ( dl. ptr_sized_integer ( ) , false ) )
286286 }
287287 TyKind :: Dyn ( ..) => {
288- let mut vtable = scalar_unit ( dl, Primitive :: Pointer ( AddressSpace :: DATA ) ) ;
288+ let mut vtable = scalar_unit ( dl, Primitive :: Pointer ( AddressSpace :: ZERO ) ) ;
289289 vtable. valid_range_mut ( ) . start = 1 ;
290290 vtable
291291 }
Original file line number Diff line number Diff line change 22
33use base_db:: Crate ;
44use hir_def:: layout:: TargetDataLayout ;
5- use rustc_abi:: { AlignFromBytesError , TargetDataLayoutErrors } ;
5+ use rustc_abi:: { AlignFromBytesError , TargetDataLayoutErrors , AddressSpace } ;
66use triomphe:: Arc ;
77
88use crate :: db:: HirDatabase ;
@@ -12,7 +12,7 @@ pub fn target_data_layout_query(
1212 krate : Crate ,
1313) -> Result < Arc < TargetDataLayout > , Arc < str > > {
1414 match & krate. workspace_data ( db) . data_layout {
15- Ok ( it) => match TargetDataLayout :: parse_from_llvm_datalayout_string ( it) {
15+ Ok ( it) => match TargetDataLayout :: parse_from_llvm_datalayout_string ( it, AddressSpace :: ZERO ) {
1616 Ok ( it) => Ok ( Arc :: new ( it) ) ,
1717 Err ( e) => {
1818 Err ( match e {
@@ -39,6 +39,7 @@ pub fn target_data_layout_query(
3939 target,
4040 } => format ! ( r#"inconsistent target specification: "data-layout" claims pointers are {pointer_size}-bit, while "target-pointer-width" is `{target}`"# ) ,
4141 TargetDataLayoutErrors :: InvalidBitsSize { err } => err,
42+ TargetDataLayoutErrors :: UnknownPointerSpecification { err } => format ! ( r#"use of unknown pointer specifer in "data-layout": {err}"# ) ,
4243 } . into ( ) )
4344 }
4445 } ,
Original file line number Diff line number Diff line change @@ -630,7 +630,7 @@ impl Evaluator<'_> {
630630 Ok ( target_data_layout) => target_data_layout,
631631 Err ( e) => return Err ( MirEvalError :: TargetDataLayoutNotAvailable ( e) ) ,
632632 } ;
633- let cached_ptr_size = target_data_layout. pointer_size . bytes_usize ( ) ;
633+ let cached_ptr_size = target_data_layout. pointer_size ( ) . bytes_usize ( ) ;
634634 Ok ( Evaluator {
635635 target_data_layout,
636636 stack : vec ! [ 0 ] ,
You can’t perform that action at this time.
0 commit comments