diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-07-19 11:02:59 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-07-19 13:26:48 +1000 |
| commit | c5dadd0408bc5654f001efe0f2224ff67e5e90a7 (patch) | |
| tree | 90d34a6285c04d679c9d6141374b0c1142636bb3 /compiler/rustc_const_eval/src/interpret/validity.rs | |
| parent | 5affbb17153bc69a9d5d8d2faa4e399a014a211e (diff) | |
| download | rust-c5dadd0408bc5654f001efe0f2224ff67e5e90a7.tar.gz rust-c5dadd0408bc5654f001efe0f2224ff67e5e90a7.zip | |
Use `#[rustfmt::skip]` on some `use` groups to prevent reordering.
`use` declarations will be reformatted in #125443. Very rarely, there is a desire to force a group of `use` declarations together in a way that auto-formatting will break up. E.g. when you want a single comment to apply to a group. #126776 dealt with all of these in the codebase, ensuring that no comments intended for multiple `use` declarations would end up in the wrong place. But some people were unhappy with it. This commit uses `#[rustfmt::skip]` to create these custom `use` groups in an idiomatic way for a few of the cases changed in #126776. This works because rustfmt treats any `use` item annotated with `#[rustfmt::skip]` as a barrier and won't reorder other `use` items around it.
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/validity.rs')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/validity.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/validity.rs b/compiler/rustc_const_eval/src/interpret/validity.rs index 4da7e233889..3dc3e6c8833 100644 --- a/compiler/rustc_const_eval/src/interpret/validity.rs +++ b/compiler/rustc_const_eval/src/interpret/validity.rs @@ -34,6 +34,8 @@ use super::{ Pointer, Projectable, Scalar, ValueVisitor, }; +// for the validation errors +#[rustfmt::skip] use super::InterpError::UndefinedBehavior as Ub; use super::InterpError::Unsupported as Unsup; use super::UndefinedBehaviorInfo::*; |
