Rollup merge of #115730 - bjorn3:some_driver_refactors, r=compiler-errors

Some more small driver refactors

To improve clarity and simplify some code.
This commit is contained in:
Matthias Krüger 2023-09-11 21:16:22 +02:00 committed by GitHub
commit c943ec2fba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 11 deletions

View file

@ -114,6 +114,7 @@ impl<'tcx> Queries<'tcx> {
.compute(|| passes::parse(self.session()).map_err(|mut parse_error| parse_error.emit()))
}
#[deprecated = "pre_configure may be made private in the future. If you need it please open an issue with your use case."]
pub fn pre_configure(&self) -> Result<QueryResult<'_, (ast::Crate, ast::AttrVec)>> {
self.pre_configure.compute(|| {
let mut krate = self.parse()?.steal();
@ -171,6 +172,7 @@ impl<'tcx> Queries<'tcx> {
pub fn global_ctxt(&'tcx self) -> Result<QueryResult<'_, &'tcx GlobalCtxt<'tcx>>> {
self.gcx.compute(|| {
let sess = self.session();
#[allow(deprecated)]
let (krate, pre_configured_attrs) = self.pre_configure()?.steal();
// parse `#[crate_name]` even if `--crate-name` was passed, to make sure it matches.