Use field init shorthand where possible
Field init shorthand allows writing initializers like `tcx: tcx` as `tcx`. The compiler already uses it extensively. Fix the last few places where it isn't yet used.
This commit is contained in:
@@ -325,7 +325,7 @@ where
|
||||
let actual_to = if from_end {
|
||||
if from.checked_add(to).is_none_or(|to| to > len) {
|
||||
// This can only be reached in ConstProp and non-rustc-MIR.
|
||||
throw_ub!(BoundsCheckFailed { len: len, index: from.saturating_add(to) });
|
||||
throw_ub!(BoundsCheckFailed { len, index: from.saturating_add(to) });
|
||||
}
|
||||
len.checked_sub(to).unwrap()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user