Commit graph

318402 commits

Author SHA1 Message Date
Jacob Pratt
79adcd1375
Rollup merge of #150424 - xonx4l:suggest_param_env_shadowing, r=lcnr
diagnostics: add note when param-env shadows global impl

 This PR adds a diagnostics note when param-env shadows global impl as discussed in https://github.com/rust-lang/rust/issues/149910

It adds a note explaining that the definition is hidden by the generic bound.

r?lcnr
2026-02-14 23:17:30 -05:00
bors
7bee525095 Auto merge of #152632 - JonathanBrouwer:rollup-hVWecYA, r=JonathanBrouwer
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#152622 (Update GCC subtree)
 - rust-lang/rust#145024 (Optimize indexing slices and strs with inclusive ranges)
 - rust-lang/rust#151365 (UnsafePinned: implement opsem effects of UnsafeUnpin)
 - rust-lang/rust#152381 (Do not require `'static` for obtaining reflection information.)
 - rust-lang/rust#143575 (Remove named lifetimes in some `PartialOrd` & `PartialEq` `impl`s)
 - rust-lang/rust#152404 (tests: adapt align-offset.rs for InstCombine improvements in LLVM 23)
 - rust-lang/rust#152582 (rustc_query_impl: Use `ControlFlow` in `visit_waiters` instead of nested options)
2026-02-14 23:32:04 +00:00
xonx
1be41648d4 move and add comment 2026-02-14 21:32:57 +00:00
Jonathan Brouwer
7c36d152b4
Rollup merge of #152582 - petrochenkov:waitvisit, r=TaKO8Ki
rustc_query_impl: Use `ControlFlow` in `visit_waiters` instead of nested options

Noticed when reviewing https://github.com/rust-lang/rust/pull/152229.
2026-02-14 22:11:55 +01:00
Jonathan Brouwer
e6ca590153
Rollup merge of #152404 - durin42:llvm-23-instcombine-shrink-constant, r=Mark-Simulacrum
tests: adapt align-offset.rs for InstCombine improvements in LLVM 23

Upstream [has improved InstCombine](8d2078332c) so that it can shrink added constants using known zeroes, which caused a little bit of change in this test. As far as I can tell either output is fine, so we just accept both.

@rustbot label: +llvm-main
2026-02-14 22:11:54 +01:00
Jonathan Brouwer
96066cb5b5
Rollup merge of #143575 - GrigorenkoPV:unused_lifetimes, r=Mark-Simulacrum
Remove named lifetimes in some `PartialOrd` & `PartialEq` `impl`s

Makes [the docs](https://doc.rust-lang.org/1.88.0/std/cmp/trait.PartialOrd.html#impl-PartialOrd%3CPathBuf%3E-for-Cow%3C'a,+Path%3E) way easier to look at, gets rid of a few `#[allow(unused_lifetimes)]`, and AFAICT is completely equivalent.
2026-02-14 22:11:54 +01:00
Jonathan Brouwer
16da3ab2ea
Rollup merge of #152381 - oli-obk:non_static_reflection, r=Mark-Simulacrum
Do not require `'static` for obtaining reflection information.

tracking issue rust-lang/rust#142577

This does not affect the stable `TypeId::of`, as that has its own `'static` bound.

But it will allow obtaining `TypeId`s for non-static types via the reflection API. To obtain such a `TypeId` for any type, just use `Type::of::<(T,)>().kind` to extract the first field of a tuple.

This effectively reintroduces rust-lang/rust#41875, which @rust-lang/lang decided against allowing back in 2018 due to lack of sound use cases. We will thus need to have a T-lang meeting specifically about `TypeId` for non-static types before *stabilizing* any part of reflection (in addition to T-lang meetings about reflection in general). I'm adding an explicit point about this to the tracking issue.

cc @scottmcm @joshtriplett @9SonSteroids @SpriteOvO @izagawd @BD103
2026-02-14 22:11:53 +01:00
Jonathan Brouwer
33c2a6eba9
Rollup merge of #151365 - RalfJung:unsafe-unpin-opsem, r=BoxyUwU
UnsafePinned: implement opsem effects of UnsafeUnpin

This implements the next step for https://github.com/rust-lang/rust/issues/125735: actually making `UnsafePinned` have special opsem effects by suppressing the `noalias` *even if* the type is wrapped in an `Unpin` wrapper.

For backwards compatibility we also still keep the `Unpin` hack, i.e. a type must be both `Unpin` and `UnsafeUnpin` to get `noalias`.
2026-02-14 22:11:53 +01:00
Jonathan Brouwer
6d625cc074
Rollup merge of #145024 - Kmeakin:km/optimize-slice-index/v3, r=Mark-Simulacrum
Optimize indexing slices and strs with inclusive ranges

Instead of separately checking for `end == usize::MAX` and `end + 1 > slice.len()`, we can check for `end >= slice.len()`. Also consolidate all the str indexing related panic functions into a single function which reports the correct error depending on the arguments, as the slice indexing code already does.

The downside of all this is that the panic message is slightly less specific when trying to index with `[..=usize::MAX]`: instead of saying "attempted to index str up to maximum usize" it just says "end byte index {end} out of bounds". But this is a rare enough case that I think it is acceptable
2026-02-14 22:11:52 +01:00
Jonathan Brouwer
0318407e30
Rollup merge of #152622 - GuillaumeGomez:subtree-update_cg_gcc_2026-02-14, r=GuillaumeGomez
Update GCC subtree

cc @antoyo
r? ghost
2026-02-14 22:11:52 +01:00
bors
a33907a7a5 Auto merge of #152627 - JonathanBrouwer:rollup-wjHXhK0, r=JonathanBrouwer
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#152618 (stdarch subtree update)
 - rust-lang/rust#152001 (mGCA: Validate const literal against expected type)
 - rust-lang/rust#152120 (Don't ICE on layout error in vtable computation)
 - rust-lang/rust#152531 (`proc_macro::bridge`: simplify `ExecutionStrategy` and `DispatcherTrait`)
 - rust-lang/rust#152577 (Port #[rustc_proc_macro_decls] to the new attribute parser.)
 - rust-lang/rust#152570 (Port #[rustc_test_marker] to the attribute parser)
 - rust-lang/rust#152590 (DepGraphQuery: correctly skip adding edges with not-yet-added nodes)
 - rust-lang/rust#152612 (Rename `inline_fluent!` to `msg!`)
2026-02-14 17:56:54 +00:00
Jonathan Brouwer
38cc50b6e4
Rollup merge of #152612 - JonathanBrouwer:rename_to_msg, r=jdonszelmann
Rename `inline_fluent!` to `msg!`

This was the most popular name for the macro as voted in [#t-compiler > Bikeshed the new &#96;inline_fluent!&#96; macro @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Bikeshed.20the.20new.20.60inline_fluent!.60.20macro/near/572751863)
2026-02-14 18:55:38 +01:00
Jonathan Brouwer
3f3c6fda3d
Rollup merge of #152590 - petrochenkov:skipedge, r=mati865
DepGraphQuery: correctly skip adding edges with not-yet-added nodes

Fixes https://github.com/rust-lang/rust/issues/142152.

The current logic already skips some edges, so I'm not sure how critical it is to have *all* the edges recorded, the logic seems to only be used for debug dumping.
Recording all edges requires supporting holes in the `LinkedGraph` data structure, to add nodes and edges out of order, https://github.com/rust-lang/rust/pull/151821 implements that at cost of complicating the data structure.
2026-02-14 18:55:38 +01:00
Jonathan Brouwer
923fb76303
Rollup merge of #152570 - Ozzy1423:attr-parse, r=JonathanBrouwer
Port #[rustc_test_marker] to the attribute parser

Tracking issue: https://github.com/rust-lang/rust/issues/131229

Targets:
Const is for normal tests (const test::TestDescAndFn is inserted before the test fn)
Const/Static/Fn is for custom_test_framework's #[test_case] e.g. tests/ui/custom_test_frameworks/full.rs

r? @JonathanBrouwer

Again I left the use-sites as is since they are early uses.
2026-02-14 18:55:37 +01:00
Jonathan Brouwer
cf0cb74612
Rollup merge of #152577 - Ozzy1423:macro-attr, r=JonathanBrouwer
Port #[rustc_proc_macro_decls] to the new attribute parser.

Tracking issue: https://github.com/rust-lang/rust/issues/131229

r? @JonathanBrouwer
2026-02-14 18:55:36 +01:00
Jonathan Brouwer
8a03b5f3ec
Rollup merge of #152531 - cyrgani:pm-yet-another-cleanup, r=petrochenkov
`proc_macro::bridge`: simplify `ExecutionStrategy` and `DispatcherTrait`

Also includes another tiny cleanup (functions can only have one return type).
2026-02-14 18:55:36 +01:00
Jonathan Brouwer
2c4656ac66
Rollup merge of #152120 - meithecatte:push-ltvwvkqrytno, r=petrochenkov
Don't ICE on layout error in vtable computation

Fixes rust-lang/rust#152030.

Note: I'm including a more general testcase that doesn't use the feature in the original report, but only reproduces with debuginfo disabled. Does it make sense to also include the original testcase?
2026-02-14 18:55:36 +01:00
Jonathan Brouwer
5ae6bb3faf
Rollup merge of #152001 - reddevilmidzy:mgca-i, r=BoxyUwU
mGCA: Validate const literal against expected type

close: rust-lang/rust#151625
close: rust-lang/rust#150983

also fix: https://github.com/rust-lang/rust/issues/133966 (moved crashes test)
2026-02-14 18:55:35 +01:00
Jonathan Brouwer
6213acdbb8
Rollup merge of #152618 - folkertdev:stdarch-sync-2026-02-14, r=folkertdev
stdarch subtree update

Subtree update of `stdarch` to 1239a9f83a.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-02-14 18:55:34 +01:00
Guillaume Gomez
1f94802603 Fix libgccjit version 2026-02-14 17:12:51 +01:00
Guillaume Gomez
27d5b14aef Update GCC submodule 2026-02-14 16:59:09 +01:00
Guillaume Gomez
6ea369cfee Merge commit '70ae207ff5' into subtree-update_cg_gcc_2026-02-14 2026-02-14 16:45:12 +01:00
Vadim Petrochenkov
b0366ce935 DepGraphQuery: correctly skip adding edges with not-yet-added nodes 2026-02-14 16:17:42 +03:00
Oscar Bray
6ed7615608 Port #[rustc_test_marker] to the attribute parser 2026-02-14 13:14:57 +00:00
antoyo
70ae207ff5
Merge pull request #852 from rust-lang/sync_from_rust_2026_02_13
Sync from rust 2026/02/13
2026-02-14 08:11:41 -05:00
bors
f8463896a9 Auto merge of #150681 - meithecatte:always-discriminate, r=JonathanBrouwer,Nadrieril
Make operational semantics of pattern matching independent of crate and module

The question of "when does matching an enum against a pattern of one of its variants read its discriminant" is currently an underspecified part of the language, causing weird behavior around borrowck, drop order, and UB.

Of course, in the common cases, the discriminant must be read to distinguish the variant of the enum, but currently the following exceptions are implemented:

1. If the enum has only one variant, we currently skip the discriminant read.
     - This has the advantage that single-variant enums behave the same way as structs in this regard.
     - However, it means that if the discriminant exists in the layout, we can't say that this discriminant being invalid is UB. This makes me particularly uneasy in its interactions with niches – consider the following example ([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=5904a6155cbdd39af4a2e7b1d32a9b1a)), where miri currently doesn't detect any UB (because the semantics don't specify any):

        <details><summary>Example 1</summary>

        ```rust
        #![allow(dead_code)]
        use core::mem::{size_of, transmute};
        
        #[repr(u8)]
        enum Inner {
            X(u8),
        }
        
        enum Outer {
            A(Inner),
            B(u8),
        }
        
        fn f(x: &Inner) {
            match x {
                Inner::X(v) => {
                    println!("{v}");
                }
            }
        }
        
        fn main() {
            assert_eq!(size_of::<Inner>(), 2);
            assert_eq!(size_of::<Outer>(), 2);
            let x = Outer::B(42);
            let y = &x;
            f(unsafe { transmute(y) });
        }
        ```

      </details>

2. For the purpose of the above, enums with marked with `#[non_exhaustive]` are always considered to have multiple variants when observed from foreign crates, but the actual number of variants is considered in the current crate.
    - This means that whether code has UB can depend on which crate it is in: https://github.com/rust-lang/rust/issues/147722
    - In another case of `#[non_exhaustive]` affecting the runtime semantics, its presence or absence can change what gets captured by a closure, and by extension, the drop order: https://github.com/rust-lang/rust/issues/147722#issuecomment-3674554872
    - Also at the above link, there is an example where removing `#[non_exhaustive]` can cause borrowck to suddenly start failing in another crate.
3. Moreover, we currently make a more specific check: we only read the discriminant if there is more than one *inhabited* variant in the enum.
    - This means that the semantics can differ between `foo<!>`, and a copy of `foo` where `T` was manually replaced with `!`: rust-lang/rust#146803
    - Moreover, due to the privacy rules for inhabitedness, it means that the semantics of code can depend on the *module* in which it is located.
    - Additionally, this inhabitedness rule is even uglier due to the fact that closure capture analysis needs to happen before we can determine whether types are uninhabited, which means that whether the discriminant read happens has a different answer specifically for capture analysis.
    - For the two above points, see the following example ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=a07d8a3ec0b31953942e96e2130476d9)):

        <details><summary>Example 2</summary>

        ```rust
        #![allow(unused)]
        
        mod foo {
            enum Never {}
            struct PrivatelyUninhabited(Never);
            pub enum A {
                V(String, String),
                Y(PrivatelyUninhabited),
            }
            
            fn works(mut x: A) {
                let a = match x {
                    A::V(ref mut a, _) => a,
                    _ => unreachable!(),
                };
                
                let b = match x {
                    A::V(_, ref mut b) => b,
                    _ => unreachable!(),
                };
            
                a.len(); b.len();
            }
            
            fn fails(mut x: A) {
                let mut f = || match x {
                    A::V(ref mut a, _) => (),
                    _ => unreachable!(),
                };
                
                let mut g = || match x {
                    A::V(_, ref mut b) => (),
                    _ => unreachable!(),
                };
            
                f(); g();
            }
        }
        
        use foo::A;
        
        fn fails(mut x: A) {
            let a = match x {
                A::V(ref mut a, _) => a,
                _ => unreachable!(),
            };
            
            let b = match x {
                A::V(_, ref mut b) => b,
                _ => unreachable!(),
            };
        
            a.len(); b.len();
        }
        
        
        fn fails2(mut x: A) {
            let mut f = || match x {
                A::V(ref mut a, _) => (),
                _ => unreachable!(),
            };
            
            let mut g = || match x {
                A::V(_, ref mut b) => (),
                _ => unreachable!(),
            };
        
            f(); g();
        }
        ```

        </details>

In light of the above, and following the discussion at rust-lang/rust#138961 and rust-lang/rust#147722, this PR ~~makes it so that, operationally, matching on an enum *always* reads its discriminant.~~ introduces the following changes to this behavior:

 - matching on a `#[non_exhaustive]` enum will always introduce a discriminant read, regardless of whether the enum is from an external crate
 - uninhabited variants now count just like normal ones, and don't get skipped in the checks

As per the discussion below, the resolution for point (1) above is that it should land as part of a separate PR, so that the subtler decision can be more carefully considered.

Note that this is a breaking change, due to the aforementioned changes in borrow checking behavior, new UB (or at least UB newly detected by miri), as well as drop order around closure captures. However, it seems to me that the combination of this PR with rust-lang/rust#138961 should have smaller real-world impact than rust-lang/rust#138961 by itself.

Fixes rust-lang/rust#142394 
Fixes rust-lang/rust#146590
Fixes rust-lang/rust#146803 (though already marked as duplicate)
Fixes parts of rust-lang/rust#147722
Fixes rust-lang/miri#4778

r? @Nadrieril @RalfJung 

@rustbot label +A-closures +A-patterns +T-opsem +T-lang
2026-02-14 12:53:09 +00:00
Antoni Boucher
3fdb366140 Fix clippy warning 2026-02-14 07:47:54 -05:00
Jonathan Brouwer
018a5efcf7
Rename inline_fluent! to msg! 2026-02-14 13:47:52 +01:00
Antoni Boucher
d29c931c9d Update to nightly-2026-02-14 2026-02-14 07:43:15 -05:00
bors
5d04477ea8 Auto merge of #152516 - nnethercote:mv-query-system-code-3, r=Zalathar
Move `rustc_query_system` code, part 3

Following on from rust-lang/rust#152419.

r? @Zalathar
2026-02-14 09:38:24 +00:00
Nicholas Nethercote
ed091aaf5d Move rustc_query_system::query::dep_graph to rustc_middle.
Most of the files within the `dep_graph` module can be moved wholesale
into `rustc_middle`. But two of them (`mod.rs` and `dep_node.rs`) have
the same name as existing files in `rustc_middle`, so for those I just
copied the contents into the existing files.

The commit also moves `QueryContext` and `incremental_verify_ich*`
because they are tightly intertwined with the dep graph code. And a
couple of error structs moved as well.
2026-02-14 18:46:05 +11:00
Nicholas Nethercote
fa3b046aa5 Move QueryMode.
From `rustc_query_system::query::plumbing` to
`rustc_middle::query::plumbing`.
2026-02-14 18:38:33 +11:00
Nicholas Nethercote
924dbc46d9 Move CycleErrorHandling.
From `rustc_query_system` to `rustc_middle`.
2026-02-14 18:38:33 +11:00
Nicholas Nethercote
940f30792c Move rustc_query_system::query::caches to rustc_middle::query.
This one is straightforward.
2026-02-14 18:38:30 +11:00
Nicholas Nethercote
8b0dc1ece0 Move rustc_query_system::query::job to rustc_middle.
This includes the types `QueryInfo`, `QueryJob`, `QueryJobId`,
`QueryWaiter`, `QueryLatch`, and `QueryLatchInfo`.

`CycleError` and `QueryStack*` had to come along too, due to type
interdependencies. The `QueryStack*` types are put into a new submodule
`rustc_middle::query::stack`.
2026-02-14 18:33:13 +11:00
Nicholas Nethercote
1ac199af0a Move QueryState/ActiveKeyStatus.
From `rustc_query_state` to `rustc_middle`.
2026-02-14 18:24:47 +11:00
bors
3f808f29e6 Auto merge of #152602 - jhpratt:rollup-uaxGseW, r=jhpratt
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#151998 (Set hidden visibility on naked functions in compiler-builtins)
 - rust-lang/rust#149460 (rustdoc: sort stable items first)
 - rust-lang/rust#152076 (Feed `ErrorGuaranteed` from late lifetime resolution errors through to bound variable resolution)
 - rust-lang/rust#152471 (improve associated-type suggestions from bounds)
 - rust-lang/rust#152573 (move `escape_symbol_name` to `cg_ssa`)
 - rust-lang/rust#152594 (c-variadic: implement `va_arg` for `wasm64`)
 - rust-lang/rust#151386 (rustdoc: more js cleanup)
 - rust-lang/rust#152567 (nix-dev-shell: fix a typo)
 - rust-lang/rust#152568 (Port `#[lang]` and `#[panic_handler]` to the new attribute parsers)
 - rust-lang/rust#152575 (layout_of unexpected rigid alias delayed bug)
 - rust-lang/rust#152587 (A couple of tiny polonius things)
2026-02-14 06:23:09 +00:00
reddevilmidzy
01d48c62a5 Move LitToConstInput into ty::consts
Relocate LitToConstInput and const_lit_matches_ty from mir::interpret
to ty::consts::lit
2026-02-14 04:12:46 +00:00
reddevilmidzy
b4ee9953d8 modify error comment and bless test, delete tests/ui/const-generics/generic_const_exprs/lit_type_mismatch.rs 2026-02-14 04:12:46 +00:00
reddevilmidzy
8af02e230a mGCA: Validate const literal against expected type
Co-authored-by: Boxy <rust@boxyuwu.dev>
2026-02-14 04:12:40 +00:00
Jacob Pratt
4bcbf6274a
Rollup merge of #152587 - lqd:tiny-things, r=jackh726
A couple of tiny polonius things

Here's a couple of tiny things I had ready to go @jackh726
- a tiny cleanup to avoid round-tripping through `Location`s to check for liveness, since we're already working with points
- while I was there, I fixed the doc which wasn't showing up properly (maybe a rustdoc or bootstrap bug when we build locally or during dist, either way, both don't show up correctly linked most of the time) for `PointIndex`es.
- and in the second commit slightly expand test coverage with [an example](https://internals.rust-lang.org/t/get-mut-map-back-from-entry-api/24003) that would have needed stdlib changes (cc author @Darksonn for visibility here)

More soon.

r? @jackh726
2026-02-13 22:26:36 -05:00
Jacob Pratt
8125a56f07
Rollup merge of #152575 - lcnr:layout-error-to-delayed-bug, r=jackh726
layout_of unexpected rigid alias delayed bug

fixes rust-lang/rust#152545. The trait solver can keep aliases as rigid even if they are not well-formed d7daac06d8/compiler/rustc_next_trait_solver/src/solve/normalizes_to/mod.rs (L315-L345)

r? types
2026-02-13 22:26:36 -05:00
Jacob Pratt
22f973db34
Rollup merge of #152568 - JonathanBrouwer:port_lang, r=jdonszelmann
Port `#[lang]` and `#[panic_handler]` to the new attribute parsers

For https://github.com/rust-lang/rust/issues/131229#issuecomment-2971351163

r? @jdonszelmann
2026-02-13 22:26:35 -05:00
Jacob Pratt
7719d63f01
Rollup merge of #152567 - makai410:nix-typo, r=WaffleLapkin
nix-dev-shell: fix a typo

meow

r? @WaffleLapkin
2026-02-13 22:26:35 -05:00
Jacob Pratt
9f3f83bfee
Rollup merge of #151386 - lolbinarycat:rustdoc-ts-cleanup, r=GuillaumeGomez
rustdoc: more js cleanup

Continuing the effort of removing `@ts-expect-error` from the codebase wherever possible, this time focusing on `main.js`.  Found some oddities with `register_type_impls`, fixed most of them, but the one that I couldn't figure out is what's going on with `sidebarTraitList`.  It's queried, then if there are any trait imps, unconditionally overwritten, then latter code assumes that one of these two things has initialized it, but it's not obvious why this would be the case, or if there's a reason this wasn't done in a more straightforwards way.

r? @GuillaumeGomez
2026-02-13 22:26:34 -05:00
Jacob Pratt
61dee57441
Rollup merge of #152594 - folkertdev:va-list-wasm64, r=alexcrichton
c-variadic: implement `va_arg` for `wasm64`

tracking issue: https://github.com/rust-lang/rust/issues/44930

A LLVM maintainer of the wasm backend confirmed that the behavior on wasm64 is intented: the slot size is 4 on both wasm32 and wasm64. https://github.com/llvm/llvm-project/pull/173580#issuecomment-3900118960

r? workingjubilee
cc @alexcrichton as target maintainer
2026-02-13 22:26:34 -05:00
Jacob Pratt
202f102914
Rollup merge of #152573 - usamoi:escape-2, r=bjorn3
move `escape_symbol_name` to `cg_ssa`

followup of rust-lang/rust#151955

r? @bjorn3
2026-02-13 22:26:33 -05:00
Jacob Pratt
b80512462f
Rollup merge of #152471 - JohnTitor:sugg-assoc-items-from-bounds, r=estebank
improve associated-type suggestions from bounds

Should address invalid suggestions I could come up with, but the suggestion is too hand-crafted and invalid patterns may exist.
r? @estebank
Fix https://github.com/rust-lang/rust/issues/73321
2026-02-13 22:26:33 -05:00
Jacob Pratt
000d1f18bc
Rollup merge of #152076 - eggyal:undeclared-object-lifetime, r=fmease
Feed `ErrorGuaranteed` from late lifetime resolution errors through to bound variable resolution

If late lifetime resolution fails for whatever reason, forward to RBV the guarantee that an error was emitted - thereby eliminating the need for a "hack" to suppress subsequent/superfluous error diagnostics.

Fixes rust-lang/rust#152014
r? fmease
2026-02-13 22:26:32 -05:00
Jacob Pratt
9b4219baad
Rollup merge of #149460 - lolbinarycat:rustdoc-search-sort-stable-first, r=notriddle
rustdoc: sort stable items first

Finally tackling this again now that the search system refactor is done.  The tests and the general approach were taken from the original PR.
2026-02-13 22:26:32 -05:00