diff options
| author | bors <bors@rust-lang.org> | 2021-09-12 23:49:24 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-09-12 23:49:24 +0000 |
| commit | 00d45fe5b7915ce58a1c4a64871af09fbdc39494 (patch) | |
| tree | ee6f71d5003fb9b102c325c73660e90405bccd25 | |
| parent | 6da14613e7d18382f7ee16b474b3882aadbe50f5 (diff) | |
| parent | 5d93d9d0405b5bdef90addfc1fe2dd5f9b6a018e (diff) | |
| download | rust-00d45fe5b7915ce58a1c4a64871af09fbdc39494.tar.gz rust-00d45fe5b7915ce58a1c4a64871af09fbdc39494.zip | |
Auto merge of #88839 - nbdd0121:alignof, r=nagisa
Introduce NullOp::AlignOf This PR introduces `Rvalue::NullaryOp(NullOp::AlignOf, ty)`, which will be lowered from `align_of`, similar to `size_of` lowering to `Rvalue::NullaryOp(NullOp::SizeOf, ty)`. The changes are originally part of #88700 but since it's not dependent on other changes and could have performance impact on its own, it's separated into its own PR.
| -rw-r--r-- | clippy_utils/src/qualify_min_const_fn.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_utils/src/qualify_min_const_fn.rs b/clippy_utils/src/qualify_min_const_fn.rs index 8f14b590d27..e9a9895cb74 100644 --- a/clippy_utils/src/qualify_min_const_fn.rs +++ b/clippy_utils/src/qualify_min_const_fn.rs @@ -192,7 +192,7 @@ fn check_rvalue(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, def_id: DefId, rvalue: &Rv )) } }, - Rvalue::NullaryOp(NullOp::SizeOf, _) => Ok(()), + Rvalue::NullaryOp(NullOp::SizeOf | NullOp::AlignOf, _) => Ok(()), Rvalue::NullaryOp(NullOp::Box, _) => Err((span, "heap allocations are not allowed in const fn".into())), Rvalue::UnaryOp(_, operand) => { let ty = operand.ty(body, tcx); |
