Improve the build_shift_expr_rhs
comment
This commit is contained in:
parent
0601f0c66d
commit
327aa199dd
1 changed files with 7 additions and 4 deletions
|
@ -300,12 +300,15 @@ pub fn coerce_unsized_into<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns `rhs` sufficiently masked, truncated, and/or extended so that
|
||||||
|
/// it can be used to shift `lhs`.
|
||||||
|
///
|
||||||
/// Shifts in MIR are all allowed to have mismatched LHS & RHS types.
|
/// Shifts in MIR are all allowed to have mismatched LHS & RHS types.
|
||||||
|
/// The shift methods in `BuilderMethods`, however, are fully homogeneous
|
||||||
|
/// (both parameters and the return type are all the same type).
|
||||||
///
|
///
|
||||||
/// This does all the appropriate conversions needed to pass it to the builder's
|
/// If `is_unchecked` is false, this masks the RHS to ensure it stays in-bounds,
|
||||||
/// shift methods, which are UB for out-of-range shifts.
|
/// as the `BuilderMethods` shifts are UB for out-of-bounds shift amounts.
|
||||||
///
|
|
||||||
/// If `is_unchecked` is false, this masks the RHS to ensure it stays in-bounds.
|
|
||||||
/// For 32- and 64-bit types, this matches the semantics
|
/// For 32- and 64-bit types, this matches the semantics
|
||||||
/// of Java. (See related discussion on #1877 and #10183.)
|
/// of Java. (See related discussion on #1877 and #10183.)
|
||||||
///
|
///
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue