Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix some typos #1765

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion hugr-cli/tests/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
6 changes: 3 additions & 3 deletions hugr-llvm/src/emit/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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].
///
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion hugr-llvm/src/emit/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Vec<BasicValueEnum<'c>>> {
self.inputs
.take()
Expand Down
2 changes: 1 addition & 1 deletion hugr-llvm/src/extension/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<H: HugrView>(
&self,
ctx: &mut EmitFuncContext<H>,
Expand Down
2 changes: 1 addition & 1 deletion hugr-llvm/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl<
type MakeCodegenExtsMapBox = Box<dyn MakeCodegenExtsMapFn>;
// 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,
Expand Down
2 changes: 1 addition & 1 deletion hugr-llvm/src/utils/fat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions hugr-llvm/src/utils/type_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand All @@ -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>(
Expand All @@ -55,7 +55,7 @@ pub trait TypeMapping {
variants: impl IntoIterator<Item = Vec<Self::OutV<'c>>>,
) -> Result<Self::SumOutV<'c>>;

/// 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>(
Expand Down Expand Up @@ -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<TM::OutV<'c>> {
match hugr_type.as_type_enum() {
TypeEnum::Extension(custom_type) => {
Expand Down
2 changes: 1 addition & 1 deletion hugr-model/src/v0/text/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(&mut self, f: impl FnOnce(&mut Self) -> T) -> T {
self.print_delimited("", "", 0, f)
Expand Down
8 changes: 4 additions & 4 deletions hugr-passes/src/const_fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item = (impl Into<IncomingPort>, Value)>,
Expand Down Expand Up @@ -120,15 +120,15 @@ impl ConstantFoldPass {
})
.collect::<Vec<_>>();

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);
Expand Down
1 change: 0 additions & 1 deletion hugr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,3 @@ bumpalo = { workspace = true, features = ["collections"] }
[[bench]]
name = "bench_main"
harness = false

Loading