-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
[wg-traits] pass around interned refs to goals and not goals #50580
Comments
I'd like to try my hand at this, please. |
@nikomatsakis I'm having some problems eliminating all errors. I'm fairly confident that I'm going in the right direction, but the lingering uncertainty has me wondering if this is why my code refuses to compile. My implementation of the mk_goal and mk_goals methods is frustrating the compiler. I'm receiving the error:
The slice_interners and intern_method macros are spitting out the following errors:
Am I even on the right track? I'm fairly sure that - along with the other edits to different sections of code - this code is correct, but the compiler begs to differ. |
@iancormac84 omg! I missed this comment completely. Sorry for the total radio silence! You still around? I'll take a look, but best would be if you can hop onto |
Currently we have a setup where we have an enum
Goal
:rust/src/librustc/traits/mod.rs
Lines 296 to 304 in ac287ed
This enum contains interned goals (
&'tcx Goal<'tcx>
). We also have slices of goals:rust/src/librustc/traits/mod.rs
Line 306 in ac287ed
This works ok as long as we pass around
Goal<'tcx>
enum values. But I suspect we might rather pass around pointers to interned goals, rather likeTy<'tcx>
is a reference. This would also allow us to do cheap equality testing, hashing and so forth if we cared to.Therefore, we probably ought to:
Goal
toGoalKind
Goal<'tcx> = &'tcx GoalKind<'tcx>
Goals<'tcx>
to a slice of interned refs.The text was updated successfully, but these errors were encountered: