diff --git a/.github/workflows/nostd.yml b/.github/workflows/nostd.yml deleted file mode 100644 index 93a1698..0000000 --- a/.github/workflows/nostd.yml +++ /dev/null @@ -1,30 +0,0 @@ -# This workflow checks whether the library is able to run without the std library (e.g., embedded). -# This entire file should be removed if this crate does not support no-std. See check.yml for -# information about how the concurrency cancelation and workflow triggering works -permissions: - contents: read -on: - push: - branches: [main] - pull_request: -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true -name: no-std -jobs: - nostd: - runs-on: ubuntu-latest - name: ${{ matrix.target }} - strategy: - matrix: - target: [thumbv7m-none-eabi, aarch64-unknown-none] - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install stable - uses: dtolnay/rust-toolchain@stable - - name: rustup target add ${{ matrix.target }} - run: rustup target add ${{ matrix.target }} - - name: cargo check - run: cargo check --target ${{ matrix.target }} --no-default-features diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml deleted file mode 100644 index afea8df..0000000 --- a/.github/workflows/safety.yml +++ /dev/null @@ -1,84 +0,0 @@ -# This workflow runs checks for unsafe code. In crates that don't have any unsafe code, this can be -# removed. Runs: -# - miri - detects undefined behavior and memory leaks -# - address santizer - detects memory errors -# - leak sanitizer - detects memory leaks -# - loom - Permutation testing for concurrent code https://crates.io/crates/loom -# See check.yml for information about how the concurrency cancelation and workflow triggering works -permissions: - contents: read -on: - push: - branches: [main] - pull_request: -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true -name: safety -jobs: - sanitizers: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install nightly - uses: dtolnay/rust-toolchain@nightly - - run: | - # to get the symbolizer for debug symbol resolution - sudo apt install llvm - # to fix buggy leak analyzer: - # https://github.com/japaric/rust-san#unrealiable-leaksanitizer - # ensure there's a profile.dev section - if ! grep -qE '^[ \t]*[profile.dev]' Cargo.toml; then - echo >> Cargo.toml - echo '[profile.dev]' >> Cargo.toml - fi - # remove pre-existing opt-levels in profile.dev - sed -i '/^\s*\[profile.dev\]/,/^\s*\[/ {/^\s*opt-level/d}' Cargo.toml - # now set opt-level to 1 - sed -i '/^\s*\[profile.dev\]/a opt-level = 1' Cargo.toml - cat Cargo.toml - name: Enable debug symbols - - name: cargo test -Zsanitizer=address - # only --lib --tests b/c of https://github.com/rust-lang/rust/issues/53945 - run: cargo test --lib --tests --all-features --target x86_64-unknown-linux-gnu - env: - ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0" - RUSTFLAGS: "-Z sanitizer=address" - - name: cargo test -Zsanitizer=leak - if: always() - run: cargo test --all-features --target x86_64-unknown-linux-gnu - env: - LSAN_OPTIONS: "suppressions=lsan-suppressions.txt" - RUSTFLAGS: "-Z sanitizer=leak" - miri: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - run: | - echo "NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" >> $GITHUB_ENV - - name: Install ${{ env.NIGHTLY }} - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ env.NIGHTLY }} - components: miri - - name: cargo miri test - run: cargo miri test - env: - MIRIFLAGS: "" - loom: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install stable - uses: dtolnay/rust-toolchain@stable - - name: cargo test --test loom - run: cargo test --release --test loom - env: - LOOM_MAX_PREEMPTIONS: 2 - RUSTFLAGS: "--cfg loom" diff --git a/Cargo.lock b/Cargo.lock index c2365b4..e08db26 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -99,7 +99,7 @@ dependencies = [ [[package]] name = "tcplscan" -version = "0.1.3" +version = "0.1.4" dependencies = [ "colored", "lazy_static", diff --git a/src/indexing/parser.rs b/src/indexing/parser.rs index 4b8651c..133ce0e 100644 --- a/src/indexing/parser.rs +++ b/src/indexing/parser.rs @@ -571,7 +571,7 @@ impl Parser { let token = self.next_token(); if token.token_type != TokenType::Identifier { // hack to get over things like $this->match() - if vec![TokenType::ColonColon, TokenType::ThinArrow].contains(&token.token_type) { + if [TokenType::ColonColon, TokenType::ThinArrow].contains(&token.token_type) { self.next_token(); self.next_token(); self.next_token();