Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/dyn_map.rs')
| -rw-r--r-- | crates/hir-def/src/dyn_map.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/hir-def/src/dyn_map.rs b/crates/hir-def/src/dyn_map.rs index b17a2b0a2e..eed1490a7a 100644 --- a/crates/hir-def/src/dyn_map.rs +++ b/crates/hir-def/src/dyn_map.rs @@ -112,6 +112,10 @@ pub struct Key<K, V, P = (K, V)> { } impl<K, V, P> Key<K, V, P> { + #[allow( + clippy::new_without_default, + reason = "this a const fn, so it can't be default yet. See <https://github.com/rust-lang/rust/issues/63065>" + )] pub(crate) const fn new() -> Key<K, V, P> { Key { _phantom: PhantomData } } @@ -148,16 +152,11 @@ impl<K: Hash + Eq + 'static, V: 'static> Policy for (K, V) { } } +#[derive(Default)] pub struct DynMap { pub(crate) map: Map, } -impl Default for DynMap { - fn default() -> Self { - DynMap { map: Map::new() } - } -} - #[repr(transparent)] pub struct KeyMap<KEY> { map: DynMap, |