pub struct CppNamespaceForwardScan { /* private fields */ }Expand description
The namespace forward declarations one tree’s prefix holds, folded in as the walk asks about them.
scope_for_recovered_exported_class asks the same question once per
recovered class, and the answer depends only on the part of the tree that
starts before the asking node. Rescanning that prefix per question is
quadratic in the file, and a generated header whose parse recovery leaves
thousands of class-like declarations at file scope pays all of it: 1,904
questions over 1.13 billion node visits on one 7.25 MB Vulkan header
(#2754). This carries the scan forward instead. Each question advances the
traversal from wherever the last one stopped to the asking node’s start byte,
so a whole walk pays at most one pass over the prefix its furthest question
reaches, and each question then costs a name lookup.
Trait Implementations§
Source§impl Default for CppNamespaceForwardScan
impl Default for CppNamespaceForwardScan
Source§fn default() -> CppNamespaceForwardScan
fn default() -> CppNamespaceForwardScan
Auto Trait Implementations§
impl Freeze for CppNamespaceForwardScan
impl RefUnwindSafe for CppNamespaceForwardScan
impl Send for CppNamespaceForwardScan
impl Sync for CppNamespaceForwardScan
impl Unpin for CppNamespaceForwardScan
impl UnsafeUnpin for CppNamespaceForwardScan
impl UnwindSafe for CppNamespaceForwardScan
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
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