From 9ac6740b21b87eca327b4e3acad5a6b647b3636c Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Fri, 22 Jan 2021 19:23:44 +0000 Subject: chore: fix clippy warnings --- dhall/src/operations/typecheck.rs | 6 ++---- dhall/src/semantics/nze/nir.rs | 8 ++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dhall/src/operations/typecheck.rs b/dhall/src/operations/typecheck.rs index 9b19c84..e62a8cc 100644 --- a/dhall/src/operations/typecheck.rs +++ b/dhall/src/operations/typecheck.rs @@ -219,10 +219,8 @@ fn typecheck_merge<'cx>( // TODO: this actually doesn't check anything yet match closure.remove_binder() { - Ok(v) => Type::new_infer_universe(env, v.clone())?, - Err(()) => { - return span_err("MergeReturnTypeIsDependent") - } + Some(v) => Type::new_infer_universe(env, v.clone())?, + None => return span_err("MergeReturnTypeIsDependent"), } } _ => { diff --git a/dhall/src/semantics/nze/nir.rs b/dhall/src/semantics/nze/nir.rs index 8cf06c5..124ac05 100644 --- a/dhall/src/semantics/nze/nir.rs +++ b/dhall/src/semantics/nze/nir.rs @@ -344,17 +344,17 @@ impl<'cx> Closure<'cx> { self.apply_var(NzVar::new(venv.size())) .to_hir(venv.insert()) } - /// If the closure variable is free in the closure, return Err. Otherwise, return the value + /// If the closure variable is free in the closure, return `None`. Otherwise, return the value /// with that free variable remove. - pub fn remove_binder(&self) -> Result, ()> { + pub fn remove_binder(&self) -> Option> { match self { Closure::Closure { .. } => { let v = NzVar::fresh(); // TODO: handle case where variable is used in closure // TODO: return information about where the variable is used - Ok(self.apply_var(v)) + Some(self.apply_var(v)) } - Closure::ConstantClosure { body, .. } => Ok(body.clone()), + Closure::ConstantClosure { body, .. } => Some(body.clone()), } } } -- cgit v1.2.3 From e89ef8aa14f0779f241e9394a0b172982b4a145f Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Fri, 22 Jan 2021 19:13:13 +0000 Subject: ci: disable code coverage, can't make it work --- .github/workflows/coverage.yml | 179 +++++++++++++++++++++-------------------- 1 file changed, 90 insertions(+), 89 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 1957e90..e534640 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,92 +1,93 @@ -name: Coverage +# It broke at some point, don't know how to fix it +# name: Coverage -on: - push: - branches: [ master ] +# on: +# push: +# branches: [ master ] +# # pull_request: +# # branches: [ master ] -jobs: - # cargo test normally - grcov: - name: Gather coverage data with grcov - runs-on: ubuntu-latest - steps: - - name: Checkout branch - uses: actions/checkout@master - with: - submodules: true - - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - # toolchain: nightly - toolchain: nightly-2020-03-12 # latest nightly makes `quote` crash with -Zno-landing-pads - override: true - - name: Ensure workspace is clean - uses: actions-rs/cargo@v1 - with: - command: clean - - name: Run tests with -Zprofile - uses: actions-rs/cargo@v1 - with: - command: test - env: - CI_GRCOV: '1' # Tell the test harness to increase stack size - CARGO_INCREMENTAL: '0' - RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads' - - name: Run grcov - id: grcov - uses: actions-rs/grcov@v0.1 - - name: Upload coverage data to codecov.io - uses: codecov/codecov-action@v1 - with: - token: ${{secrets.CODECOV_TOKEN}} - file: ${{steps.grcov.outputs.report}} +# jobs: +# # cargo test normally +# grcov: +# name: Gather coverage data with grcov +# runs-on: ubuntu-latest +# steps: +# - name: Checkout branch +# uses: actions/checkout@master +# with: +# submodules: true +# - name: Setup Rust toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: nightly +# override: true +# - name: Ensure workspace is clean +# uses: actions-rs/cargo@v1 +# with: +# command: clean +# - name: Run tests with -Zprofile +# uses: actions-rs/cargo@v1 +# with: +# command: test +# env: +# CI_GRCOV: '1' # Tell the test harness to increase stack size +# CARGO_INCREMENTAL: '0' +# RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' +# RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' +# - name: Run grcov +# id: grcov +# uses: actions-rs/grcov@v0.1 +# - name: Upload coverage data to codecov.io +# uses: codecov/codecov-action@v1 +# with: +# token: ${{secrets.CODECOV_TOKEN}} +# file: ${{steps.grcov.outputs.report}} - # Collect each feature independently to help identify missing tests - grcov-split: - name: Gather coverage data with grcov - runs-on: ubuntu-latest - strategy: - matrix: - feature: - - parser - - printer - - binary - - import - - beta_normalize - - alpha_normalize - - type_inference - steps: - - name: Checkout branch - uses: actions/checkout@master - with: - submodules: true - - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - # toolchain: nightly - toolchain: nightly-2020-03-12 # latest nightly makes `quote` crash with -Zno-landing-pads - override: true - - name: Ensure workspace is clean - uses: actions-rs/cargo@v1 - with: - command: clean - - name: Run tests with -Zprofile - uses: actions-rs/cargo@v1 - with: - command: test - args: tests::spec::${{matrix.feature}} - env: - CI_GRCOV: '1' # Tell the test harness to increase stack size - CARGO_INCREMENTAL: '0' - RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads' - - name: Run grcov - id: grcov - uses: actions-rs/grcov@v0.1 - - name: Upload coverage data to codecov.io - uses: codecov/codecov-action@v1 - with: - token: ${{secrets.CODECOV_TOKEN}} - file: ${{steps.grcov.outputs.report}} - flags: ${{matrix.feature}} +# # Collect each feature independently to help identify missing tests +# grcov-split: +# name: Gather coverage data with grcov +# runs-on: ubuntu-latest +# strategy: +# matrix: +# feature: +# - parser +# - printer +# - binary +# - import +# - beta_normalize +# - alpha_normalize +# - type_inference +# steps: +# - name: Checkout branch +# uses: actions/checkout@master +# with: +# submodules: true +# - name: Setup Rust toolchain +# uses: actions-rs/toolchain@v1 +# with: +# toolchain: nightly +# override: true +# - name: Ensure workspace is clean +# uses: actions-rs/cargo@v1 +# with: +# command: clean +# - name: Run tests with -Zprofile +# uses: actions-rs/cargo@v1 +# with: +# command: test +# args: tests::spec::${{matrix.feature}} +# env: +# CI_GRCOV: '1' # Tell the test harness to increase stack size +# CARGO_INCREMENTAL: '0' +# RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' +# RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' +# - name: Run grcov +# id: grcov +# uses: actions-rs/grcov@v0.1 +# - name: Upload coverage data to codecov.io +# uses: codecov/codecov-action@v1 +# with: +# token: ${{secrets.CODECOV_TOKEN}} +# file: ${{steps.grcov.outputs.report}} +# flags: ${{matrix.feature}} -- cgit v1.2.3 From b70f16f865967375e5d80ff5b8979179072c73b4 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Fri, 22 Jan 2021 19:27:21 +0000 Subject: update: bump minimum supported version because of tokio --- .github/workflows/tests.yml | 2 +- CHANGELOG.md | 2 ++ README.md | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e5b800e..2373233 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,7 +39,7 @@ jobs: rust: - beta - nightly - - 1.42.0 # Minimum supported version + - 1.44.0 # Minimum supported version steps: - name: Checkout branch uses: actions/checkout@master diff --git a/CHANGELOG.md b/CHANGELOG.md index d1d3064..1b78bd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ #### [Unreleased] +- BREAKING CHANGE: Change minimum supported version to 1.44.0. + #### [0.9.0] - 2020-11-20 - BREAKING CHANGE: Support Dhall v19.0.0 diff --git a/README.md b/README.md index b1a452f..5776391 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ expected_map.insert("y".to_string(), 2); assert_eq!(deserialized_map, expected_map); ``` -`dhall` requires Rust >= 1.42.0 +`dhall` requires Rust >= 1.44.0 ## Standard-compliance -- cgit v1.2.3