From 9582172964608c7eed72a79d05a7e0ed58b23bca Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 17 Nov 2023 09:44:28 +1100 Subject: [PATCH] Make `Compiler::sess` private. Like `Compiler::codegen_backend`. --- compiler/rustc_interface/src/interface.rs | 2 +- compiler/rustc_interface/src/queries.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs index 6db26b976d9..6225424fe4a 100644 --- a/compiler/rustc_interface/src/interface.rs +++ b/compiler/rustc_interface/src/interface.rs @@ -38,7 +38,7 @@ pub type Result = result::Result; /// Can be used to run `rustc_interface` queries. /// Created by passing [`Config`] to [`run_compiler`]. pub struct Compiler { - pub(crate) sess: Session, + sess: Session, codegen_backend: Box, pub(crate) override_queries: Option, } diff --git a/compiler/rustc_interface/src/queries.rs b/compiler/rustc_interface/src/queries.rs index 9762e924cc4..fbf2dbcdae5 100644 --- a/compiler/rustc_interface/src/queries.rs +++ b/compiler/rustc_interface/src/queries.rs @@ -102,7 +102,7 @@ impl<'tcx> Queries<'tcx> { } fn session(&self) -> &Session { - &self.compiler.sess + &self.compiler.session() } fn codegen_backend(&self) -> &dyn CodegenBackend {