about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/query.rs
diff options
context:
space:
mode:
authordianne <diannes.gm@gmail.com>2024-12-23 02:31:54 -0800
committerdianne <diannes.gm@gmail.com>2025-01-08 00:07:18 -0800
commitc0e8bada734d41fa9941fd7989f277639bcf0c23 (patch)
treea7c986a1c65ec68f0698247da33b98537ff70eba /compiler/rustc_mir_transform/src/coverage/query.rs
parente2f3ce956809dd98adf271afe0b024c7febdf47f (diff)
downloadrust-c0e8bada734d41fa9941fd7989f277639bcf0c23.tar.gz
rust-c0e8bada734d41fa9941fd7989f277639bcf0c23.zip
cleanup: de-tangle experimental pattern typing rules some
The goal of this cleanup is to make it more apparent which feature gates
correspond to which typing rules, and which typing rules correspond to
what code. My intent is for calls to the "which typing rules do we
have?" functions to be replaced by comments (and edition checks, as
appropriate), but as long as we're experimenting with multiple rulesets,
this seemed to me to be the easiest to document and read. There's still
some nontrivial control flow, but I've added comments to try and make it
clearer.

There's some logic that looks like it could be de-duplicated across
different ways of matching against inherited references; however, the
duplication is intentional. Once we choose which rulesets we want, we
can make this more clever, but until then, my priorities are clarity and
ease of modification/extension. That said, I think the diagnostics could
use some work; factoring out commonalities there (and separating them
from the typing logic) would be ideal. I've opted not to include that
here both since it'd make this refactor less obvious and since it
affects test output.

Also, this doesn't get quite as fine-grained as Typing Rust Patterns, so
there's some instances where certain rules are conflated. I'd prefer to
minimize dead/untested codepaths for rulesets we're not interested in,
so as a compromise I've added comments wherever some aspect of the
typing rules is assumed from another. I'm not totally happy with it, but
I think it's at least better than plain checks against the feature gates
and edition.
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/query.rs')
0 files changed, 0 insertions, 0 deletions