-
Notifications
You must be signed in to change notification settings - Fork 0
Add new "types" map to smir json #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Looks like there's lots of nondeterminism in various numbers that get assigned to things which breaks the golden tests, even after sorting the types array by the type id. So far, this is just dumping every type in the |
@@ -970,7 +972,7 @@ pub fn collect_smir(tcx: TyCtxt<'_>) -> SmirJson { | |||
.collect::<Vec<_>>(); | |||
Some(SmirJsonDebugInfo { | |||
fn_sources, | |||
types: visited_tys, | |||
types: visited_tys.clone(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably just delete this? (adapting SmirJsonDebugInfo
, of course)
types: visited_tys.clone(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess so. I only put this here to suppress the compiler from erroring on using an already moved value. This line is on the debug path so I didn't feel the need to think too much about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really mind what it printed in the debug path, is it handy to have it or is it bloating the output?
Yes, the problem seems to be that the entries refer to each other, so just sorting by type ID won't straighten everything.
Are there any problems besides the golden tests with the more complex types? EDIT: However, from looking closer at the CI failures, another issue is |
Jost is right, similar to how I removed the other ids with |
I'm seeing a larger problem than these fields. The I'm surprised this wasn't an issue before, but it appears as if some Here's what I prefer for this PR. |
Agree. The
I am not sure whether these are actually stable, TBH, maybe they are just statistically more stable because the base types are used early and often so their Either way:
👍 we can definitely work with this as a first step. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM.
We can modify the debug content in a follow-up PR (and maybe also use a more idiomatic solution for it...)
fixes: #45
This adds a new mapping to the SMIR Json that maps
stable_mir::ty:Ty
values to their correspondingstable_mir::ty::TyKind
values in the context.