From db1d11c2419382ad5781ab35396bb5c606c2b9fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= <121866228+aborgna-q@users.noreply.github.com> Date: Wed, 13 Mar 2024 16:09:47 +0000 Subject: [PATCH] chore: Re-enable missing-docs lint (#876) #868 didn't actually enable the lints in `quantinuum-hugr` when the config was moved to the workspace. --- quantinuum-hugr/Cargo.toml | 3 +++ quantinuum-hugr/benches/bench_main.rs | 1 + quantinuum-hugr/src/builder.rs | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/quantinuum-hugr/Cargo.toml b/quantinuum-hugr/Cargo.toml index a12b1766d..c79584ae8 100644 --- a/quantinuum-hugr/Cargo.toml +++ b/quantinuum-hugr/Cargo.toml @@ -13,6 +13,9 @@ description = "Quantinuum's Hierarchical Unified Graph Representation" keywords = ["Quantum", "Quantinuum"] categories = ["compilers"] +[lints] +workspace = true + [lib] name = "hugr" bench = false diff --git a/quantinuum-hugr/benches/bench_main.rs b/quantinuum-hugr/benches/bench_main.rs index d4c8f78b3..db6e5dc4e 100644 --- a/quantinuum-hugr/benches/bench_main.rs +++ b/quantinuum-hugr/benches/bench_main.rs @@ -1,3 +1,4 @@ +//! Benchmarks #[allow(dead_code)] mod benchmarks; diff --git a/quantinuum-hugr/src/builder.rs b/quantinuum-hugr/src/builder.rs index 3a0f94b2d..bfd361282 100644 --- a/quantinuum-hugr/src/builder.rs +++ b/quantinuum-hugr/src/builder.rs @@ -143,6 +143,7 @@ pub enum BuildError { EntryBuiltError(Node), /// Node was expected to have a certain type but was found to not. #[error("Node with index {node:?} does not have type {op_desc:?} as expected.")] + #[allow(missing_docs)] UnexpectedType { /// Index of node where error occurred. node: Node, @@ -163,6 +164,7 @@ pub enum BuildError { /// Invalid wires when setting outputs #[error("Found an error while setting the outputs of a {} container, {container_node}. {error}", .container_op.name())] + #[allow(missing_docs)] OutputWiring { container_op: OpType, container_node: Node, @@ -174,6 +176,7 @@ pub enum BuildError { /// /// The internal error message already contains the node index. #[error("Got an input wire while adding a {} to the circuit. {error}", .op.name())] + #[allow(missing_docs)] OperationWiring { op: OpType, #[source] @@ -187,6 +190,7 @@ pub enum BuildError { pub enum BuilderWiringError { /// Tried to copy a linear type. #[error("Cannot copy linear type {typ} from output {src_offset} of node {src}")] + #[allow(missing_docs)] NoCopyLinear { typ: Type, src: Node, @@ -194,6 +198,7 @@ pub enum BuilderWiringError { }, /// The ancestors of an inter-graph edge are not related. #[error("Cannot connect an inter-graph edge between unrelated nodes. Tried connecting {src} ({src_offset}) with {dst} ({dst_offset}).")] + #[allow(missing_docs)] NoRelationIntergraph { src: Node, src_offset: Port, @@ -202,6 +207,7 @@ pub enum BuilderWiringError { }, /// Inter-Graph edges can only carry copyable data. #[error("Inter-graph edges cannot carry non-copyable data {typ}. Tried connecting {src} ({src_offset}) with {dst} ({dst_offset}).")] + #[allow(missing_docs)] NonCopyableIntergraph { src: Node, src_offset: Port,