Address more PR feedback

This commit is contained in:
Scott McMurray 2024-04-16 23:55:12 -07:00
parent bb8d6f790b
commit 1398fe7a5e
2 changed files with 5 additions and 4 deletions

View File

@ -121,7 +121,7 @@ impl<'tcx> InstSimplifyContext<'tcx, '_> {
if a.const_.ty().is_bool() { a.const_.try_to_bool() } else { None }
}
/// Transform "&(*a)" ==> "a".
/// Transform `&(*a)` ==> `a`.
fn simplify_ref_deref(&self, source_info: &SourceInfo, rvalue: &mut Rvalue<'tcx>) {
if let Rvalue::Ref(_, _, place) = rvalue {
if let Some((base, ProjectionElem::Deref)) = place.as_ref().last_projection() {
@ -141,7 +141,7 @@ impl<'tcx> InstSimplifyContext<'tcx, '_> {
}
}
/// Transform "Len([_; N])" ==> "N".
/// Transform `Len([_; N])` ==> `N`.
fn simplify_len(&self, source_info: &SourceInfo, rvalue: &mut Rvalue<'tcx>) {
if let Rvalue::Len(ref place) = *rvalue {
let place_ty = place.ty(self.local_decls, self.tcx).ty;
@ -157,7 +157,7 @@ impl<'tcx> InstSimplifyContext<'tcx, '_> {
}
}
/// Transform "Aggregate(RawPtr, \[p, ()\])" ==> "Cast(PtrToPtr, p)".
/// Transform `Aggregate(RawPtr, [p, ()])` ==> `Cast(PtrToPtr, p)`.
fn simplify_ptr_aggregate(&self, source_info: &SourceInfo, rvalue: &mut Rvalue<'tcx>) {
if let Rvalue::Aggregate(box AggregateKind::RawPtr(pointee_ty, mutability), fields) = rvalue
{

View File

@ -2791,7 +2791,8 @@ pub unsafe fn vtable_align(_ptr: *const ()) -> usize {
#[rustc_intrinsic_must_be_overridden]
#[cfg(not(bootstrap))]
pub const fn aggregate_raw_ptr<P: AggregateRawPtr<D, Metadata = M>, D, M>(_data: D, _meta: M) -> P {
// No fallback because `libcore` doesn't want to know the layout
// To implement a fallback we'd have to assume the layout of the pointer,
// but the whole point of this intrinsic is that we shouldn't do that.
unreachable!()
}