Skip to content

Commit 80e616e

Browse files
committed
Auto merge of rust-lang#13936 - danieleades:static-mod-depth-limit, r=lnicola
interior-mutable types should be 'static' rather than 'const with the 'tracking' feature enabled, `limit::Limit` is interior mutable, so the `const` `hir_def::nameres::mod_resolution::MOD_DEPTH_LIMIT` is probably meant to be `static` rather than `const`. with `const` you get a new copy of it everywhere it's used, instead of the shared, global value that seems to be the intent. This fix brought to you by the catchily-named `clippy::declare_interior_mutable_const` lint.
2 parents 09aceea + 7413a99 commit 80e616e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/hir-def/src/nameres/mod_resolution.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use syntax::SmolStr;
77

88
use crate::{db::DefDatabase, HirFileId};
99

10-
const MOD_DEPTH_LIMIT: Limit = Limit::new(32);
10+
static MOD_DEPTH_LIMIT: Limit = Limit::new(32);
1111

1212
#[derive(Clone, Debug)]
1313
pub(super) struct ModDir {

0 commit comments

Comments
 (0)