diff --git a/_typos.toml b/_typos.toml index 98af6e1aa..51a0598d0 100644 --- a/_typos.toml +++ b/_typos.toml @@ -6,4 +6,11 @@ strat = "strat" # common abbreviation for strategy # some arithmetic op names: inot = "inot" fle = "fle" +flt = "flt" +olt = "olt" +OLT = "OLT" +FLT = "FLT" ine = "ine" +# llvm generic parameters +OT = "OT" +ot = "ot" diff --git a/hugr-cli/tests/validate.rs b/hugr-cli/tests/validate.rs index be85f67bd..54a8fa57d 100644 --- a/hugr-cli/tests/validate.rs +++ b/hugr-cli/tests/validate.rs @@ -169,7 +169,7 @@ fn test_no_std(test_hugr_string: String, mut val_cmd: Command) { val_cmd.write_stdin(test_hugr_string); val_cmd.arg("-"); val_cmd.arg("--no-std"); - // test hugr doesn't have any standard extensions, so this should succceed + // test hugr doesn't have any standard extensions, so this should succeed val_cmd.assert().success().stderr(contains(VALID_PRINT)); } diff --git a/hugr-llvm/src/emit/func.rs b/hugr-llvm/src/emit/func.rs index 0a09dc9b3..f64883e2e 100644 --- a/hugr-llvm/src/emit/func.rs +++ b/hugr-llvm/src/emit/func.rs @@ -33,7 +33,7 @@ pub use mailbox::{RowMailBox, RowPromise}; /// One of the primary interfaces for implementing codegen extensions. /// We have methods for: /// * Converting from hugr [Type]s to LLVM [Type](BasicTypeEnum)s; -/// * Maintaing [MailBox](RowMailBox) for each [Wire] in the [FuncDefn]; +/// * Maintaining [MailBox](RowMailBox) for each [Wire] in the [FuncDefn]; /// * Accessing the [CodegenExtsMap]; /// * Accessing an in internal [Builder]. /// @@ -231,7 +231,7 @@ impl<'c, 'a, H: HugrView> EmitFuncContext<'c, 'a, H> { r } - /// Returns a [RowMailBox] mapped to thie input wires of `node`. When emitting a node + /// Returns a [RowMailBox] mapped to the input wires of `node`. When emitting a node /// input values are from this mailbox. pub fn node_ins_rmb<'hugr, OT: 'hugr>( &mut self, @@ -252,7 +252,7 @@ impl<'c, 'a, H: HugrView> EmitFuncContext<'c, 'a, H> { Ok(r) } - /// Returns a [RowMailBox] mapped to thie ouput wires of `node`. When emitting a node + /// Returns a [RowMailBox] mapped to the output wires of `node`. When emitting a node /// output values are written to this mailbox. pub fn node_outs_rmb<'hugr, OT: 'hugr>( &mut self, diff --git a/hugr-llvm/src/emit/ops.rs b/hugr-llvm/src/emit/ops.rs index 5fdbd5a76..53c189a20 100644 --- a/hugr-llvm/src/emit/ops.rs +++ b/hugr-llvm/src/emit/ops.rs @@ -45,7 +45,7 @@ where } } - /// safe because we are guarenteed only one input or output node + /// safe because we are guaranteed only one input or output node fn take_input(&mut self) -> Result>> { self.inputs .take() diff --git a/hugr-llvm/src/extension/prelude.rs b/hugr-llvm/src/extension/prelude.rs index 793621349..8ef6952eb 100644 --- a/hugr-llvm/src/extension/prelude.rs +++ b/hugr-llvm/src/extension/prelude.rs @@ -162,7 +162,7 @@ pub trait PreludeCodegen: Clone { /// The default implementation emits calls to libc's `printf` and `abort`. /// /// Note that implementations of `emit_panic` must not emit `unreachable` - /// terminators, that, if appropriate, is the responsibilitiy of the caller. + /// terminators, that, if appropriate, is the responsibility of the caller. fn emit_panic( &self, ctx: &mut EmitFuncContext, diff --git a/hugr-llvm/src/test.rs b/hugr-llvm/src/test.rs index 94d18bb8a..6268deee5 100644 --- a/hugr-llvm/src/test.rs +++ b/hugr-llvm/src/test.rs @@ -76,7 +76,7 @@ impl< type MakeCodegenExtsMapBox = Box; // We would like to just stor a CodegenExtsMap, but we can't because it's // lifetime parameter would need to be the lifetime of TestContext, which is -// prohibitted. Instead, we store a factory function as below. +// prohibited. Instead, we store a factory function as below. pub struct TestContext { context: Context, mk_exts: MakeCodegenExtsMapBox, diff --git a/hugr-llvm/src/utils/fat.rs b/hugr-llvm/src/utils/fat.rs index 3a45ec4ad..3ccaf4e2a 100644 --- a/hugr-llvm/src/utils/fat.rs +++ b/hugr-llvm/src/utils/fat.rs @@ -71,7 +71,7 @@ where /// Create a general `FatNode` from a specific one. pub fn generalise(self) -> FatNode<'hugr, OpType, H> { - // guaranteed to be valid becasue self is valid + // guaranteed to be valid because self is valid FatNode { hugr: self.hugr, node: self.node, diff --git a/hugr-llvm/src/utils/type_map.rs b/hugr-llvm/src/utils/type_map.rs index e39e2e2b2..17286033a 100644 --- a/hugr-llvm/src/utils/type_map.rs +++ b/hugr-llvm/src/utils/type_map.rs @@ -34,7 +34,7 @@ impl<'a, TM: TypeMapping, F: for<'c> TypeMapFnHelper<'c, TM> + 'a> TypeMappingFn /// Defines a mapping from [HugrType] to `OutV`; pub trait TypeMapping { - /// Auxilliary data provided when mapping from a [HugrType]. + /// Auxiliary data provided when mapping from a [HugrType]. type InV<'c>: Clone; /// The target type of the mapping. type OutV<'c>; @@ -45,7 +45,7 @@ pub trait TypeMapping { /// convertible to `OutV` via `func_into_out`. type FuncOutV<'c>; - /// Returns the result of the mapping on `sum_type`, with auxilliary data + /// Returns the result of the mapping on `sum_type`, with auxiliary data /// `inv`, and when the result of mapping all fields of all variants is /// given by `variants`. fn map_sum_type<'c>( @@ -55,7 +55,7 @@ pub trait TypeMapping { variants: impl IntoIterator>>, ) -> Result>; - /// Returns the result of the mapping on `function_type`, with auxilliary data + /// Returns the result of the mapping on `function_type`, with auxiliary data /// `inv`, and when the result of mapping all inputs is given by `inputs` /// and the result of mapping all outputs is given by `outputs`. fn map_function_type<'c>( @@ -113,7 +113,7 @@ impl<'a, TM: TypeMapping + 'a> TypeMap<'a, TM> { } /// Map `hugr_type` using the [TypeMapping] `TM`, the registered callbacks, - /// and the auxilliary data `inv`. + /// and the auxiliary data `inv`. pub fn map_type<'c>(&self, hugr_type: &HugrType, inv: TM::InV<'c>) -> Result> { match hugr_type.as_type_enum() { TypeEnum::Extension(custom_type) => { diff --git a/hugr-model/src/v0/text/print.rs b/hugr-model/src/v0/text/print.rs index ac35b4cd4..4132338d9 100644 --- a/hugr-model/src/v0/text/print.rs +++ b/hugr-model/src/v0/text/print.rs @@ -86,7 +86,7 @@ impl<'p, 'a: 'p> PrintContext<'p, 'a> { result } - /// Print a sequence of elements that are preferrably laid out together in the same line. + /// Print a sequence of elements that are preferably laid out together in the same line. #[inline] fn print_group(&mut self, f: impl FnOnce(&mut Self) -> T) -> T { self.print_delimited("", "", 0, f) diff --git a/hugr-passes/src/const_fold.rs b/hugr-passes/src/const_fold.rs index 82af5e1dc..cdba48d80 100644 --- a/hugr-passes/src/const_fold.rs +++ b/hugr-passes/src/const_fold.rs @@ -61,7 +61,7 @@ impl ConstantFoldPass { } /// Specifies any number of external inputs to provide to the Hugr (on root-node - /// in-ports). Each supercedes any previous value on the same in-port. + /// in-ports). Each supersedes any previous value on the same in-port. pub fn with_inputs( mut self, inputs: impl IntoIterator, Value)>, @@ -120,15 +120,15 @@ impl ConstantFoldPass { }) .collect::>(); - for (n, inport, v) in wires_to_break { + for (n, import, v) in wires_to_break { let parent = hugr.get_parent(n).unwrap(); let datatype = v.get_type(); // We could try hash-consing identical Consts, but not ATM let cst = hugr.add_node_with_parent(parent, Const::new(v)); let lcst = hugr.add_node_with_parent(parent, LoadConstant { datatype }); hugr.connect(cst, OutgoingPort::from(0), lcst, IncomingPort::from(0)); - hugr.disconnect(n, inport); - hugr.connect(lcst, OutgoingPort::from(0), n, inport); + hugr.disconnect(n, import); + hugr.connect(lcst, OutgoingPort::from(0), n, import); } for n in remove_nodes { hugr.remove_node(n); diff --git a/hugr/Cargo.toml b/hugr/Cargo.toml index 534e88f27..d4f499ca0 100644 --- a/hugr/Cargo.toml +++ b/hugr/Cargo.toml @@ -44,4 +44,3 @@ bumpalo = { workspace = true, features = ["collections"] } [[bench]] name = "bench_main" harness = false -