diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_abi/src/lib.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_hir_analysis/messages.ftl | 2 | ||||
| -rw-r--r-- | compiler/rustc_hir_typeck/src/intrinsicck.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/messages.ftl | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/layout.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs | 4 | 
6 files changed, 10 insertions, 12 deletions
| diff --git a/compiler/rustc_abi/src/lib.rs b/compiler/rustc_abi/src/lib.rs index 7bd2507d1ad..904c5933a18 100644 --- a/compiler/rustc_abi/src/lib.rs +++ b/compiler/rustc_abi/src/lib.rs @@ -337,23 +337,21 @@ impl TargetDataLayout { Ok(dl) } - /// Returns exclusive upper bound on object size. + /// Returns **exclusive** upper bound on object size in bytes. /// /// The theoretical maximum object size is defined as the maximum positive `isize` value. /// This ensures that the `offset` semantics remain well-defined by allowing it to correctly /// index every address within an object along with one byte past the end, along with allowing /// `isize` to store the difference between any two pointers into an object. /// - /// The upper bound on 64-bit currently needs to be lower because LLVM uses a 64-bit integer - /// to represent object size in bits. It would need to be 1 << 61 to account for this, but is - /// currently conservatively bounded to 1 << 47 as that is enough to cover the current usable - /// address space on 64-bit ARMv8 and x86_64. + /// LLVM uses a 64-bit integer to represent object size in *bits*, but we care only for bytes, + /// so we adopt such a more-constrained size bound due to its technical limitations. #[inline] pub fn obj_size_bound(&self) -> u64 { match self.pointer_size.bits() { 16 => 1 << 15, 32 => 1 << 31, - 64 => 1 << 47, + 64 => 1 << 61, bits => panic!("obj_size_bound: unknown pointer bit size {bits}"), } } diff --git a/compiler/rustc_hir_analysis/messages.ftl b/compiler/rustc_hir_analysis/messages.ftl index 633ccacedfc..0fe1e348498 100644 --- a/compiler/rustc_hir_analysis/messages.ftl +++ b/compiler/rustc_hir_analysis/messages.ftl @@ -478,7 +478,7 @@ hir_analysis_tait_forward_compat2 = item does not constrain `{$opaque_type}`, bu hir_analysis_target_feature_on_main = `main` function is not allowed to have `#[target_feature]` -hir_analysis_too_large_static = extern static is too large for the current architecture +hir_analysis_too_large_static = extern static is too large for the target architecture hir_analysis_track_caller_on_main = `main` function is not allowed to be `#[track_caller]` .suggestion = remove this annotation diff --git a/compiler/rustc_hir_typeck/src/intrinsicck.rs b/compiler/rustc_hir_typeck/src/intrinsicck.rs index f39d83a2a6f..81d940a3f9b 100644 --- a/compiler/rustc_hir_typeck/src/intrinsicck.rs +++ b/compiler/rustc_hir_typeck/src/intrinsicck.rs @@ -95,7 +95,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { format!("{v} bits") } else { // `u128` should definitely be able to hold the size of different architectures - // larger sizes should be reported as error `are too big for the current architecture` + // larger sizes should be reported as error `are too big for the target architecture` // otherwise we have a bug somewhere bug!("{:?} overflow for u128", size) } diff --git a/compiler/rustc_middle/messages.ftl b/compiler/rustc_middle/messages.ftl index 2b9d9a07a98..39485a324f2 100644 --- a/compiler/rustc_middle/messages.ftl +++ b/compiler/rustc_middle/messages.ftl @@ -103,5 +103,5 @@ middle_unknown_layout = the type `{$ty}` has an unknown layout middle_values_too_big = - values of the type `{$ty}` are too big for the current architecture + values of the type `{$ty}` are too big for the target architecture middle_written_to_path = the full type name has been written to '{$path}' diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs index 877c54c5649..9ed5dc87be4 100644 --- a/compiler/rustc_middle/src/ty/layout.rs +++ b/compiler/rustc_middle/src/ty/layout.rs @@ -264,7 +264,7 @@ impl<'tcx> fmt::Display for LayoutError<'tcx> { match *self { LayoutError::Unknown(ty) => write!(f, "the type `{ty}` has an unknown layout"), LayoutError::SizeOverflow(ty) => { - write!(f, "values of the type `{ty}` are too big for the current architecture") + write!(f, "values of the type `{ty}` are too big for the target architecture") } LayoutError::NormalizationFailure(t, e) => write!( f, diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs index 2de6ee9cf91..1f11ee3f939 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs @@ -2269,12 +2269,12 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { } rustc_transmute::Reason::SrcSizeOverflow => { format!( - "values of the type `{src}` are too big for the current architecture" + "values of the type `{src}` are too big for the target architecture" ) } rustc_transmute::Reason::DstSizeOverflow => { format!( - "values of the type `{dst}` are too big for the current architecture" + "values of the type `{dst}` are too big for the target architecture" ) } rustc_transmute::Reason::DstHasStricterAlignment { | 
