Skip to content

Add "The Query Evaluation Model in Detail" Chapter. #270

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

Merged

Conversation

michaelwoerister
Copy link
Member

This chapter contains some more detailed information about the theory behind queries.

r? @nikomatsakis

Copy link
Member

@mark-i-m mark-i-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from the typo!

Thanks for writing this up!

@michaelwoerister
Copy link
Member Author

michaelwoerister commented Jan 23, 2019

Thanks for taking a look, @mark-i-m!

The typo should be fixed.

@mark-i-m
Copy link
Member

Personally, I think this is ready to merge, but I can wait for Niko if you want.

let hir_map = ...;

// Create the query context `tcx`
let tcx = TyCtxt::new(cli_options, hir_map);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably a dumb question, but why is the query context called TyCtxt? I'd have thought it would be called QryCtxt or QCtxt or something.

It's been that way as long as I can remember and I assumed it was short for "type context" or something.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tcx is called "type context" or "type checking context" purely for historical reasons, I'd say. There's been talk about renaming to "query context" (e.g. qx or qcx) for a while. For now, the tcx acts the query context (and does a few other things too).

@petrochenkov
Copy link
Contributor

It would be good to document how to find implementations (local and cross-crate) for a specific query.

For a query foo search fn foo leads to its "declaration" without implementation, and just foo usually gives too many results.

@michaelwoerister
Copy link
Member Author

I just added a chapter with a more detailed description of incremental compilation. It is not entirely complete yet but I think it would be good to merge anyway so that people can read it before the All Hands. The most important parts are already there.

Copy link
Member

@mark-i-m mark-i-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mark-i-m
Copy link
Member

@michaelwoerister r=me, but travis is failing due to a broken link.

`DefPath`. The two contain the same information and we mostly use the
`DefPathHash` because it simpler to handle, being `Copy` and self-contained.

This principle of stable identifiers is used to make the data in the on-disk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This principle of stable identifiers is used to make the data in the on-disk
This principle of stable identifiers is used to make the data on disk

src/SUMMARY.md Outdated
@@ -20,7 +20,9 @@
- [The Rustc Driver](./rustc-driver.md)
- [Rustdoc](./rustdoc.md)
- [Queries: demand-driven compilation](./query.md)
- [The Query Evaluation Model in Detail](./queries/query-evaluation-model-in-detail.md)
- [Incremental compilation](./incremental-compilation.md)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps move the Incremental Compilation chapter to the queries/ directory too?

@michaelwoerister michaelwoerister force-pushed the query-eval-model-update branch 3 times, most recently from 92c5497 to c6f1f96 Compare January 30, 2019 11:59
@michaelwoerister michaelwoerister merged commit 0ffc56b into rust-lang:master Jan 30, 2019
@michaelwoerister
Copy link
Member Author

@mark-i-m, the mentioned problems should all be addressed.

@michaelwoerister
Copy link
Member Author

Do changes show up automatically at https://rust-lang.github.io/rustc-guide/?

@mark-i-m
Copy link
Member

In theory, yes... I’m not sure why they aren’t.

@mark-i-m
Copy link
Member

It was a spurious failure in CI. It should deploy shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants