Stream: wg-traits

Topic: learning chalk


Aaron Hill (Jan 29 2020 at 04:02, on Zulip):

I'm incredibly confused by this struct: https://github.com/rust-lang/chalk/blob/master/chalk-integration/src/db.rs#L34-L36

Aaron Hill (Jan 29 2020 at 04:02, on Zulip):

Where is set_solver_choice defined?

Aaron Hill (Jan 29 2020 at 04:05, on Zulip):

I see that there's some derive-macro magic happening with salsa - it looks like it's defining methods of the form set_#name. However, I don't really understand how everything connects up

Aaron Hill (Jan 29 2020 at 04:41, on Zulip):

I noticed that the NoSolution type is an empty struct. Are the plans to extend it with some kind of "cause" or "message", similar to how things work in rustc?

detrumi (Jan 29 2020 at 07:18, on Zulip):

For set_solver_choice, the setter is created because LoweringDatabase has a fn solver_choice with a #[salsa::input] annotation. Not entirely sure though how ChalkDatabase gets linked to LoweringDatabase, though (I see impl RustIrDatabase<ChalkIr> for ChalkDatabase, but LoweringDatabase is a subtrait)

detrumi (Jan 29 2020 at 07:19, on Zulip):

The examples in the salsa repo explain it a bit better

Jack Huey (Jan 29 2020 at 17:37, on Zulip):

Yeah, honestly the db-related things are salsa-magic

Jack Huey (Jan 29 2020 at 17:38, on Zulip):

I noticed that the NoSolution type is an empty struct. Are the plans to extend it with some kind of "cause" or "message", similar to how things work in rustc?

I don't think there are currently any plans. But maybe in the future?

Aaron Hill (Jan 29 2020 at 23:18, on Zulip):

It looks like auto-trait support (emitting the proper clauses) is currently only handled by the 'standalone' part of chalk (chalk_rust_ir, chalk_ir), and not by rustc. Would that be a reasonable thing for me to work on?

Jack Huey (Jan 29 2020 at 23:59, on Zulip):

So, auto-trait support sort of overlaps with the idea of "well-known" traits (like Sized, see this issue)

Jack Huey (Jan 30 2020 at 00:00, on Zulip):

But, I'm not 100% sure what needs to specifically be addressed for auto-traits in particular

Last update: Feb 25 2020 at 02:20UTC