mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
unreachable-pub
This commit is contained in:
parent
bc5823d5bb
commit
def5a1d0c4
2 changed files with 5 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
||||||
pub(crate) struct Parenthesized<T>(pub T);
|
pub(crate) struct Parenthesized<T>(pub(crate) T);
|
||||||
|
|
||||||
impl<T> syn::parse::Parse for Parenthesized<T>
|
impl<T> syn::parse::Parse for Parenthesized<T>
|
||||||
where
|
where
|
||||||
|
|
|
@ -62,7 +62,7 @@ where
|
||||||
Node: LruNode,
|
Node: LruNode,
|
||||||
{
|
{
|
||||||
/// Creates a new LRU list where LRU caching is disabled.
|
/// Creates a new LRU list where LRU caching is disabled.
|
||||||
pub fn new() -> Self {
|
pub(crate) fn new() -> Self {
|
||||||
Self::with_seed(LRU_SEED)
|
Self::with_seed(LRU_SEED)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ where
|
||||||
|
|
||||||
/// Adjust the total number of nodes permitted to have a value at
|
/// Adjust the total number of nodes permitted to have a value at
|
||||||
/// once. If `len` is zero, this disables LRU caching completely.
|
/// once. If `len` is zero, this disables LRU caching completely.
|
||||||
pub fn set_lru_capacity(&self, len: usize) {
|
pub(crate) fn set_lru_capacity(&self, len: usize) {
|
||||||
let mut data = self.data.lock();
|
let mut data = self.data.lock();
|
||||||
|
|
||||||
// We require each zone to have at least 1 slot. Therefore,
|
// We require each zone to have at least 1 slot. Therefore,
|
||||||
|
@ -102,7 +102,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Records that `node` was used. This may displace an old node (if the LRU limits are
|
/// Records that `node` was used. This may displace an old node (if the LRU limits are
|
||||||
pub fn record_use(&self, node: &Arc<Node>) -> Option<Arc<Node>> {
|
pub(crate) fn record_use(&self, node: &Arc<Node>) -> Option<Arc<Node>> {
|
||||||
tracing::debug!("record_use(node={:?})", node);
|
tracing::debug!("record_use(node={:?})", node);
|
||||||
|
|
||||||
// Load green zone length and check if the LRU cache is even enabled.
|
// Load green zone length and check if the LRU cache is even enabled.
|
||||||
|
@ -125,7 +125,7 @@ where
|
||||||
self.data.lock().record_use(node)
|
self.data.lock().record_use(node)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn purge(&self) {
|
pub(crate) fn purge(&self) {
|
||||||
self.green_zone.store(0, Ordering::SeqCst);
|
self.green_zone.store(0, Ordering::SeqCst);
|
||||||
*self.data.lock() = LruData::with_seed(LRU_SEED);
|
*self.data.lock() = LruData::with_seed(LRU_SEED);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue