diff options
| author | bors <bors@rust-lang.org> | 2024-03-10 01:23:54 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-10 01:23:54 +0000 |
| commit | 45f87a0627be46ec38e4c4d0d17c750abae64c77 (patch) | |
| tree | ea781b295933feb7dcdeb79edfb7cb1525b7cd54 | |
| parent | 689040738a56346097453bbd3c4126d2be262992 (diff) | |
| parent | 158b70a1eda04c9e8ffd9a3eea99958ccea380df (diff) | |
| download | rust-45f87a0627be46ec38e4c4d0d17c750abae64c77.tar.gz rust-45f87a0627be46ec38e4c4d0d17c750abae64c77.zip | |
Auto merge of #121662 - saethlin:precondition-unification, r=RalfJung
Distinguish between library and lang UB in assert_unsafe_precondition As described in https://github.com/rust-lang/rust/pull/121583#issuecomment-1963168186, `assert_unsafe_precondition` now explicitly distinguishes between language UB (conditions we explicitly optimize on) and library UB (things we document you shouldn't do, and maybe some library internals assume you don't do). `debug_assert_nounwind` was originally added to avoid the "only at runtime" aspect of `assert_unsafe_precondition`. Since then the difference between the macros has gotten muddied. This totally revamps the situation. Now _all_ preconditions shall be checked with `assert_unsafe_precondition`. If you have a precondition that's only checkable at runtime, do a `const_eval_select` hack, as done in this PR. r? RalfJung
| -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 e369cb9d0a4..dadb0d662ce 100644 --- a/clippy_utils/src/qualify_min_const_fn.rs +++ b/clippy_utils/src/qualify_min_const_fn.rs @@ -174,7 +174,7 @@ fn check_rvalue<'tcx>( )) } }, - Rvalue::NullaryOp(NullOp::SizeOf | NullOp::AlignOf | NullOp::OffsetOf(_) | NullOp::DebugAssertions, _) + Rvalue::NullaryOp(NullOp::SizeOf | NullOp::AlignOf | NullOp::OffsetOf(_) | NullOp::UbCheck(_), _) | Rvalue::ShallowInitBox(_, _) => Ok(()), Rvalue::UnaryOp(_, operand) => { let ty = operand.ty(body, tcx); |
