Repository navigation
view-types: handle field accesses - #165764
Conversation
This comment has been minimized.
This comment has been minimized.
3a6417a to
b489285
Compare
This comment has been minimized.
This comment has been minimized.
936e861 to
ddf89da
Compare
This comment has been minimized.
This comment has been minimized.
ddf89da to
211c9dd
Compare
|
force push contains:
|
This comment has been minimized.
This comment has been minimized.
211c9dd to
1375823
Compare
/!\ the test suite is has not been updated /!\
1375823 to
d5b8736
Compare
|
@rustbot label -S-blocked |
|
Reminder, once the PR becomes ready for a review, use |
/!\ the #legal revision of field-access.rs has not been updated /!\
/!\ the test suite is has not been updated /!\ the ICE we are currently fixing uses the debug print of view types, which was `unimplemented!()`, which triggered another ICE. this commit adds an implementation of `Debug` for `ty::View`, which gives us a much more interesting backtrace (which is fixed by the next commit).
/!\ the #legal revision still triggers an ICE, but a new one this time :fire: /!\
d5b8736 to
9655251
Compare
|
ci passed ✨ @bors r=oli-obk rollup |
…uwer Rollup of 6 pull requests Successful merges: - #164918 (Move lint validation to attribute parsing) - #166381 (`rust-analyzer` subtree update) - #166191 (Enable static-pie on all Musl targets) - #166390 (Turn `gca` into a macro 2.0 that expands to `k#gca(..)`) - #165764 (view-types: handle field accesses) - #166250 (Add a reason suggestion for malformed lint attributes) Failed merges: - #166374 (Undo accidental duplication checking for attributes on macro calls)
Rollup merge of #165764 - scrabsha:view-types/check-field-access, r=oli-obk view-types: handle field accesses
|
Note This PR was benchmarked as part of triage of its containing rollup: triage URL. Finished benchmarking commit (393ed47): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Our benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)This perf run didn't have relevant results for this metric. CyclesResults (secondary 1.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Artifact size: 406.40 MiB -> 405.75 MiB (-0.16%) |
the main idea of this commit is to handle the following code:
this plugs quite nicely in the deref step checking, allowing for access to
fooon types like&&&&&view_type(MyStruct.{ foo })as well as types that deref to reference to&view_type!(...)1. tuple structs are also supported.the first three commits are an attempt to refactor of
FnCtxt::check_expr_field. it was quite overwhelming for me to understand how this function works so i figured i could try to make the it easier for the next person that has to look at it. i kept the refactoring split in three commits because i think it eases review (the ui test suite passes for all three commit), but i'm happy to squash them into one, or drop them entirely.r? oli-obk
part of #155938.
Note
Footnotes
The reference is needed here because view types are
!MetaSized, which does not satisfies the!Sizedbound onDeref::Target. ↩