pub struct ResolvedPrelude {
pub root: ResolvedPreludeFile,
pub prelude_dir: Vec<ResolvedPreludeFile>,
pub other_std_files: Vec<ResolvedPreludeFile>,
}Expand description
Result of locating the prelude.
The compiler stages every entry in aux_files into the compilation
unit’s file_paths so @import resolution finds them. prelude_dir
lists the files under prelude/ (excluding the root) — the ones
referenced by _prelude.gruel’s re-exports — so test fixtures that
bypass CompilationUnit::parse can inline their items without
dragging in unrelated stdlib modules (which would have unresolved
@import references in a test environment).
Fields§
§root: ResolvedPreludeFileprelude/_prelude.gruel itself — the file the compiler implicitly imports.
prelude_dir: Vec<ResolvedPreludeFile>Files under prelude/, in dependency-aware order.
other_std_files: Vec<ResolvedPreludeFile>Stdlib files under std/ (e.g. _std.gruel, math.gruel).
Pre-staged for @import("std") and friends. Empty in test
fixtures.
Implementations§
Source§impl ResolvedPrelude
impl ResolvedPrelude
Sourcepub fn aux_files(&self) -> impl Iterator<Item = &ResolvedPreludeFile>
pub fn aux_files(&self) -> impl Iterator<Item = &ResolvedPreludeFile>
Every file other than the root, in load order. Used by the compilation driver to register all stdlib paths.
Auto Trait Implementations§
impl Freeze for ResolvedPrelude
impl RefUnwindSafe for ResolvedPrelude
impl Send for ResolvedPrelude
impl Sync for ResolvedPrelude
impl Unpin for ResolvedPrelude
impl UnsafeUnpin for ResolvedPrelude
impl UnwindSafe for ResolvedPrelude
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more