From e89b41416175f1ee962c727e2baeeb371efbb607 Mon Sep 17 00:00:00 2001 From: Alexander Fedotov Date: Thu, 26 Sep 2024 19:28:57 +0100 Subject: [PATCH] chore: fixes from formatting and clippy upgrade --- compiler/hash-ast/src/ast.rs | 1 - compiler/hash-codegen-llvm/src/misc.rs | 1 - compiler/hash-codegen-llvm/src/translation/mod.rs | 2 +- compiler/hash-repr/src/ty.rs | 7 ------- compiler/hash-semantics/src/passes/resolution/pats.rs | 4 +--- compiler/hash-tir/src/building.rs | 2 +- 6 files changed, 3 insertions(+), 14 deletions(-) diff --git a/compiler/hash-ast/src/ast.rs b/compiler/hash-ast/src/ast.rs index 7c20d92e2..3a739d68e 100644 --- a/compiler/hash-ast/src/ast.rs +++ b/compiler/hash-ast/src/ast.rs @@ -69,7 +69,6 @@ impl Hunk { /// [`AstNode`] itself in order for other data structures to be able /// to query the [Span] of a node simply by using the [AstNodeId] of the /// node. - static SPAN_MAP: Lazy>> = Lazy::new(|| { // We initialise the map with a NULL node-id so we can use it as the default // for items that need a node, but don't have one. diff --git a/compiler/hash-codegen-llvm/src/misc.rs b/compiler/hash-codegen-llvm/src/misc.rs index 775ff1928..d068b6209 100644 --- a/compiler/hash-codegen-llvm/src/misc.rs +++ b/compiler/hash-codegen-llvm/src/misc.rs @@ -244,7 +244,6 @@ impl AttributeKind { /// A wrapper type to convert the generic [CodeModel] into the /// [inkwell::targets::CodeModel] equivalent type. - pub struct CodeModelWrapper(pub inkwell::targets::CodeModel); impl From for CodeModelWrapper { diff --git a/compiler/hash-codegen-llvm/src/translation/mod.rs b/compiler/hash-codegen-llvm/src/translation/mod.rs index 13266471e..2b0dcd457 100644 --- a/compiler/hash-codegen-llvm/src/translation/mod.rs +++ b/compiler/hash-codegen-llvm/src/translation/mod.rs @@ -28,7 +28,7 @@ mod statics; pub(crate) mod ty; /// An empty c-string. -const EMPTY_C_STR: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"\0") }; +const EMPTY_C_STR: &CStr = c""; /// Used to fill in names where LLVM requires a name for an instruction, or some /// value. We don't care about the names, so we just use an empty c-string. diff --git a/compiler/hash-repr/src/ty.rs b/compiler/hash-repr/src/ty.rs index 8c3925d14..e486a6352 100644 --- a/compiler/hash-repr/src/ty.rs +++ b/compiler/hash-repr/src/ty.rs @@ -699,13 +699,6 @@ impl fmt::Display for &ReprTy { } } -// new_sequence_store_key_indirect!(pub ReprTyListId, ReprTyId, derives = -// Debug); - -/// Define the [TyListStore], which is a sequence of [ReprTy]s associated -/// with a [ReprTyListId]. -// pub type TyListStore = DefaultSequenceStore; - impl fmt::Display for ReprTyListId { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let value = self.value(); diff --git a/compiler/hash-semantics/src/passes/resolution/pats.rs b/compiler/hash-semantics/src/passes/resolution/pats.rs index fe69d9967..e39774521 100644 --- a/compiler/hash-semantics/src/passes/resolution/pats.rs +++ b/compiler/hash-semantics/src/passes/resolution/pats.rs @@ -374,9 +374,7 @@ impl ResolutionPass<'_, E> { let resolved_path = self.resolve_ast_path(&path)?; self.make_pat_from_resolved_ast_path(&resolved_path, node.id()) } - ast::Pat::Macro(invocation) => { - return self.make_pat_from_ast_pat(invocation.subject.ast_ref()) - } + ast::Pat::Macro(invocation) => self.make_pat_from_ast_pat(invocation.subject.ast_ref()), ast::Pat::Module(_) => { // This should be handled earlier panic_on_span!(node.span(), "Found module pattern during symbol resolution") diff --git a/compiler/hash-tir/src/building.rs b/compiler/hash-tir/src/building.rs index 33f53a0d8..81f188492 100644 --- a/compiler/hash-tir/src/building.rs +++ b/compiler/hash-tir/src/building.rs @@ -1,4 +1,4 @@ -/// Building utilities for TIR nodes. +//! Building utilities for TIR nodes. /// Building utilities for TIR nodes which do not have an origin, i.e. are /// "generated".