Use a submodule as safety boundary for BoxedResolver
This commit is contained in:
parent
86c2d1a2a7
commit
5e148200d4
1 changed files with 60 additions and 55 deletions
|
@ -86,6 +86,10 @@ fn count_nodes(krate: &ast::Crate) -> usize {
|
|||
counter.count
|
||||
}
|
||||
|
||||
pub use boxed_resolver::BoxedResolver;
|
||||
mod boxed_resolver {
|
||||
use super::*;
|
||||
|
||||
pub struct BoxedResolver(Pin<Box<BoxedResolverInner>>);
|
||||
|
||||
// Note: Drop order is important to prevent dangling references. Resolver must be dropped first,
|
||||
|
@ -100,7 +104,7 @@ struct BoxedResolverInner {
|
|||
}
|
||||
|
||||
impl BoxedResolver {
|
||||
fn new<F>(session: Lrc<Session>, make_resolver: F) -> Result<(ast::Crate, Self)>
|
||||
pub(super) fn new<F>(session: Lrc<Session>, make_resolver: F) -> Result<(ast::Crate, Self)>
|
||||
where
|
||||
F: for<'a> FnOnce(
|
||||
&'a Session,
|
||||
|
@ -149,6 +153,7 @@ impl BoxedResolver {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Runs the "early phases" of the compiler: initial `cfg` processing, loading compiler plugins,
|
||||
/// syntax expansion, secondary `cfg` expansion, synthesis of a test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue