diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5b84f5bc8f8..777dfb823b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,9 +9,18 @@ env: DOC_PATH: target/doc jobs: + typos: + name: Typos + runs-on: ubuntu-latest + steps: + - name: Install typos + run: cargo install typos-cli + - name: Run typos + run: typos . tests: name: "LLVM ${{ matrix.llvm-version[0] }}: ${{ matrix.os }}" runs-on: ${{ matrix.os }} + needs: typos strategy: matrix: llvm-version: diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 00000000000..39787dae0b4 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,9 @@ +[default] +extend-ignore-identifiers-re = [ + "OLT", + "toi", + "isplay", + "BVE", + "olt", + "TRE", +] \ No newline at end of file diff --git a/src/builder.rs b/src/builder.rs index da47b4afcd1..60301cfeadf 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -66,8 +66,6 @@ enum PositionState { pub enum BuilderError { #[error("Builder position is not set")] UnsetPosition, - #[error("GEP error: does not point to a struct or index is out of bounds")] - GEPError, #[error("Alignment error")] AlignmentError(&'static str), #[error("Aggregate extract index out of range")] @@ -1104,13 +1102,13 @@ impl<'ctx> Builder<'ctx> { let pointee_ty = ptr_ty.get_element_type(); if !pointee_ty.is_struct_type() { - return Err(BuilderError::GEPError); + return Err(BuilderError::GEPPointee); } let struct_ty = pointee_ty.into_struct_type(); if index >= struct_ty.count_fields() { - return Err(BuilderError::GEPError); + return Err(BuilderError::GEPIndex); } let c_string = to_c_str(name);