ruff/crates/ty_test/src
Douglas Creager 77b2cee223
[ty] Add functions for revealing assignability/subtyping constraints (#20217)
This PR adds two new `ty_extensions` functions,
`reveal_when_assignable_to` and `reveal_when_subtype_of`. These are
closely related to the existing `is_assignable_to` and `is_subtype_of`,
but instead of returning when the property (always) holds, it produces a
diagnostic that describes _when_ the property holds. (This will let us
construct mdtests that print out constraints that are not always true or
always false — though we don't currently have any instances of those.)

I did not replace _every_ occurrence of the `is_property` variants in
the mdtest suite, instead focusing on the generics-related tests where
it will be important to see the full detail of the constraint sets.

As part of this, I also updated the mdtest harness to accept the shorter
`# revealed:` assertion format for more than just `reveal_type`, and
updated the existing uses of `reveal_protocol_interface` to take
advantage of this.
2025-09-03 16:44:35 -04:00
..
assertion.rs Update Rust toolchain to 1.89 (#19807) 2025-08-07 18:21:50 +02:00
config.rs Remove extra dot in rule documentation (#18871) 2025-06-23 00:33:21 +00:00
db.rs [ty] Disallow std::env and io methods in most ty crates (#20046) 2025-08-22 11:13:47 -07:00
diagnostic.rs Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
lib.rs Fix mdtest ignore python code blocks (#20139) 2025-08-28 09:59:03 -07:00
matcher.rs [ty] Add functions for revealing assignability/subtyping constraints (#20217) 2025-09-03 16:44:35 -04:00
parser.rs [ty] Pull types on synthesized Python files created by mdtest (#18539) 2025-06-12 10:32:17 +01:00