Skip to content

Commit

Permalink
Rename ArgumentSizeMismatch to ScalarSizeMismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
samrat committed Apr 26, 2020
1 parent 91462db commit b8af409
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/librustc_middle/mir/interpret/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ pub enum UndefinedBehaviorInfo {
/// Working with a local that is not currently live.
DeadLocal,
/// Data size is not equal to target size
ArgumentSizeMismatch {
ScalarSizeMismatch {
target_size: u64,
data_size: u64,
},
Expand Down Expand Up @@ -427,9 +427,9 @@ impl fmt::Debug for UndefinedBehaviorInfo {
"using uninitialized data, but this operation requires initialized memory"
),
DeadLocal => write!(f, "accessing a dead local variable"),
ArgumentSizeMismatch { target_size, data_size } => write!(
ScalarSizeMismatch { target_size, data_size } => write!(
f,
"argument size mismatch: expected {} bytes but got {} bytes instead",
"scalar size mismatch: expected {} bytes but got {} bytes instead",
target_size, data_size
),
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_middle/mir/interpret/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,9 @@ impl<'tcx, Tag> Scalar<Tag> {
match self {
Scalar::Raw { data, size } => {
if target_size.bytes() != u64::from(size) {
throw_ub!(ArgumentSizeMismatch {
throw_ub!(ScalarSizeMismatch {
target_size: target_size.bytes(),
data_size: u64::from(size)
data_size: u64::from(size),
});
}
Scalar::check_data(data, size);
Expand Down

0 comments on commit b8af409

Please sign in to comment.