Fix #124478 - offset_of! returns a temporary
This was due to the must_use() call. Adding HIR's OffsetOf to the must_use checking within the compiler avoids this issue.
This commit is contained in:
@@ -176,6 +176,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults {
|
||||
| hir::BinOpKind::Shr => Some("bitwise operation"),
|
||||
},
|
||||
hir::ExprKind::AddrOf(..) => Some("borrow"),
|
||||
hir::ExprKind::OffsetOf(..) => Some("`offset_of` call"),
|
||||
hir::ExprKind::Unary(..) => Some("unary operation"),
|
||||
_ => None,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user