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:
parent
6c90ac8d8f
commit
ca79086c87
7 changed files with 28 additions and 26 deletions
|
@ -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,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue