rust/compiler/rustc_const_eval/src/const_eval
Nicholas Nethercote e661514bda Remove hook calling via TyCtxtAt.
All hooks receive a `TyCtxtAt` argument.

Currently hooks can be called through `TyCtxtAt` or `TyCtxt`. In the
latter case, a `TyCtxtAt` is constructed with a dummy span and passed to
the hook.

However, in practice hooks are never called through `TyCtxtAt`, and
always receive a dummy span. (I confirmed this via code inspection, and
double-checked it by temporarily making the `TyCtxtAt` code path panic
and running all the tests.)

This commit removes all the `TyCtxtAt` machinery for hooks. All hooks
now receive `TyCtxt` instead of `TyCtxtAt`. There are two existing hooks
that use `TyCtxtAt::span`: `const_caller_location_provider` and
`try_destructure_mir_constant_for_user_output`. For both hooks the span
is always a dummy span, probably unintentionally. This dummy span use is
now explicit. If a non-dummy span is needed for these two hooks it would
be easy to add it as an extra argument because hooks are less
constrained than queries.
2025-02-03 17:02:33 +11:00
..
dummy_machine.rs Pass FnAbi to find_mir_or_eval_fn 2024-12-19 14:10:37 +00:00
error.rs Add TooGeneric variant to LayoutError and emit Unknown one 2025-01-27 00:37:34 +01:00
eval_queries.rs fix ICE on type error in promoted 2024-12-09 15:17:26 +01:00
fn_queries.rs Methods of const traits are const 2025-01-15 15:57:06 +00:00
machine.rs Insert null checks for pointer dereferences when debug assertions are enabled 2025-01-31 11:13:34 +00:00
mod.rs Remove hook calling via TyCtxtAt. 2025-02-03 17:02:33 +11:00
valtrees.rs add comments 2025-01-30 18:13:16 +01:00