diff --git a/.github/workflows/nix-action-rocq-9.1.yml b/.github/workflows/nix-action-rocq-9.1.yml index 642abf7c31..334af01b0c 100644 --- a/.github/workflows/nix-action-rocq-9.1.yml +++ b/.github/workflows/nix-action-rocq-9.1.yml @@ -5008,60 +5008,6 @@ jobs: name: Building/fetching current CI target run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "rocq-9.1" --argstr job "stdlib-refman-html" - stdlib-warnings: - needs: [] - runs-on: ubuntu-latest - steps: - - name: Determine which commit to initially checkout - run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{ - github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha - }}\" >> $GITHUB_ENV\nfi\n" - - name: Git checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 - ref: ${{ env.target_commit }} - - name: Determine which commit to test - run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{ - github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{ github.event.repository.html_url - }} refs/pull/${{ github.event.number }}/merge | cut -f1)\n mergeable=$(git - merge --no-commit --no-ff ${{ github.event.pull_request.base.sha }} > /dev/null - 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n if [ -z \"$merge_commit\"\ - \ -o \"x$mergeable\" != \"x0\" ]; then\n echo \"tested_commit=${{ github.event.pull_request.head.sha - }}\" >> $GITHUB_ENV\n else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n\ - \ fi\nfi\n" - - name: Git checkout - uses: actions/checkout@v6 - with: - fetch-depth: 0 - ref: ${{ env.tested_commit }} - - name: Cachix install - uses: cachix/install-nix-action@v31 - with: - nix_path: nixpkgs=channel:nixpkgs-unstable - - name: Cachix setup coq - uses: cachix/cachix-action@v16 - with: - authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - extraPullNames: coq-community, math-comp - name: coq - - id: stepGetDerivation - name: Getting derivation for current job (stdlib-warnings) - run: "NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr bundle - \"rocq-9.1\" --argstr job \"stdlib-warnings\" \\\n --dry-run 2> err > out - || (touch fail; true)\ncat out err\nif [ -e fail ]; then echo \"Error: getting - derivation failed\"; exit 1; fi\n" - - id: stepCheck - name: Checking presence of CI target for current job - run: "if $(cat out err | grep -q \"built:\") ; then\n echo \"CI target needs - actual building\"\n if $(cat out err | grep -q \"derivations will be built:\"\ - ) ; then\n echo \"waiting a bit for derivations that should be in cache\"\ - \n sleep 30\n fi\nelse\n echo \"CI target already built\"\n echo \"\ - status=fetched\" >> $GITHUB_OUTPUT\nfi\n" - - if: steps.stepCheck.outputs.status != 'fetched' - name: Building/fetching current CI target - run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle - "rocq-9.1" --argstr job "stdlib-warnings" stdpp: needs: - coq diff --git a/.github/workflows/nix-action-rocq-9.2.yml b/.github/workflows/nix-action-rocq-9.2.yml index 6221ea9157..24e8e43739 100644 --- a/.github/workflows/nix-action-rocq-9.2.yml +++ b/.github/workflows/nix-action-rocq-9.2.yml @@ -4827,6 +4827,60 @@ jobs: name: Building/fetching current CI target run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "rocq-9.2" --argstr job "stdlib-refman-html" + stdlib-warnings: + needs: [] + runs-on: ubuntu-latest + steps: + - name: Determine which commit to initially checkout + run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{ + github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha + }}\" >> $GITHUB_ENV\nfi\n" + - name: Git checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + ref: ${{ env.target_commit }} + - name: Determine which commit to test + run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{ + github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{ github.event.repository.html_url + }} refs/pull/${{ github.event.number }}/merge | cut -f1)\n mergeable=$(git + merge --no-commit --no-ff ${{ github.event.pull_request.base.sha }} > /dev/null + 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n if [ -z \"$merge_commit\"\ + \ -o \"x$mergeable\" != \"x0\" ]; then\n echo \"tested_commit=${{ github.event.pull_request.head.sha + }}\" >> $GITHUB_ENV\n else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n\ + \ fi\nfi\n" + - name: Git checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + ref: ${{ env.tested_commit }} + - name: Cachix install + uses: cachix/install-nix-action@v31 + with: + nix_path: nixpkgs=channel:nixpkgs-unstable + - name: Cachix setup coq + uses: cachix/cachix-action@v16 + with: + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + extraPullNames: coq-community, math-comp + name: coq + - id: stepGetDerivation + name: Getting derivation for current job (stdlib-warnings) + run: "NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr bundle + \"rocq-9.2\" --argstr job \"stdlib-warnings\" \\\n --dry-run 2> err > out + || (touch fail; true)\ncat out err\nif [ -e fail ]; then echo \"Error: getting + derivation failed\"; exit 1; fi\n" + - id: stepCheck + name: Checking presence of CI target for current job + run: "if $(cat out err | grep -q \"built:\") ; then\n echo \"CI target needs + actual building\"\n if $(cat out err | grep -q \"derivations will be built:\"\ + ) ; then\n echo \"waiting a bit for derivations that should be in cache\"\ + \n sleep 30\n fi\nelse\n echo \"CI target already built\"\n echo \"\ + status=fetched\" >> $GITHUB_OUTPUT\nfi\n" + - if: steps.stepCheck.outputs.status != 'fetched' + name: Building/fetching current CI target + run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle + "rocq-9.2" --argstr job "stdlib-warnings" stdpp: needs: - coq diff --git a/.nix/config.nix b/.nix/config.nix index fcbc94cebc..43f58d0ad8 100644 --- a/.nix/config.nix +++ b/.nix/config.nix @@ -284,6 +284,8 @@ with builtins; with (import {}).lib; }; }; "rocq-9.2" = { rocqPackages = common-bundles // { rocq-core.override.version = "9.2"; + # check that we compile without warnings on last release of Rocq + stdlib-warnings.job = true; # plugin pins, from v9.2 branch of Rocq bignums.override.version = "30a45625546da0a88db8689a8009d580aa3f557f"; stdlib-test.job = false; @@ -319,8 +321,6 @@ with builtins; with (import {}).lib; { name = p; value.job = false; })); }; "rocq-9.1" = { rocqPackages = common-bundles // { rocq-core.override.version = "9.1"; - # check that we compile without warnings on last release of Rocq - stdlib-warnings.job = true; # plugin pins, from v9.1 branch of Rocq bignums.override.version = "9f9855536bd4167af6986f826819e32354b7da22"; stdlib-test.job = false; diff --git a/doc/changelog/01-changed/235-warning-92.rst b/doc/changelog/01-changed/235-warning-92.rst new file mode 100644 index 0000000000..ceb2cb6509 --- /dev/null +++ b/doc/changelog/01-changed/235-warning-92.rst @@ -0,0 +1,43 @@ +- in `RelationPairs.v` + + + changed notations `_ @@1` and `_ @@2` from level 30 to level 1 + (`#235 `_, + by Pierre Roux). + +- in `FMapAVL.v` + + + changed notations `_ #1`, `_ #2`, `_ #l`, `_ #o` and `_ #r` from level 9 to level 1 + (`#235 `_, + by Pierre Roux). + + + changed notation `<< _ , _ , _ >>` from level 9 to level 0 + (`#235 `_, + by Pierre Roux). + +- in `MSetAVL.v` + + + changed notations `_ #1`, `_ #2`, `_ #l`, `_ #b` and `_ #r` from level 9 to level 1 + (`#235 `_, + by Pierre Roux). + + + changed notation `<< _ , _ , _ >>` from level 9 to level 0 + (`#235 `_, + by Pierre Roux). + +- in `ZNatPairs.v` + + + changed notations `_ #1` and `_ #2` from level 9 to level 1 + (`#235 `_, + by Pierre Roux). + +- in `NZBits.v` + + + changed notation `_ .[ _ ]` from level 5 to level 1 + (`#235 `_, + by Pierre Roux). + +- in `NZDomain.v` + + + changed notation `[ _ ]` from level 7 to level 0 + (`#235 `_, + by Pierre Roux). diff --git a/theories/Classes/RelationPairs.v b/theories/Classes/RelationPairs.v index 9a1138df51..dcb7f7266c 100644 --- a/theories/Classes/RelationPairs.v +++ b/theories/Classes/RelationPairs.v @@ -49,8 +49,8 @@ Definition RelCompFun {A} {B : Type}(R:relation B)(f:A->B) : relation A := Infix "@@" := RelCompFun (at level 30, right associativity) : signature_scope. -Notation "R @@1" := (R @@ Fst)%signature (at level 30) : signature_scope. -Notation "R @@2" := (R @@ Snd)%signature (at level 30) : signature_scope. +Notation "R @@1" := (R @@ Fst)%signature (at level 1) : signature_scope. +Notation "R @@2" := (R @@ Snd)%signature (at level 1) : signature_scope. (** We declare measures to the system using the [Measure] class. Otherwise the instances would easily introduce loops, diff --git a/theories/FSets/FMapAVL.v b/theories/FSets/FMapAVL.v index fce1a57dce..6d05650477 100644 --- a/theories/FSets/FMapAVL.v +++ b/theories/FSets/FMapAVL.v @@ -26,8 +26,8 @@ Unset Strict Implicit. (** Notations and helper lemma about pairs *) Declare Scope pair_scope. -Notation "s #1" := (fst s) (at level 9, format "s '#1'") : pair_scope. -Notation "s #2" := (snd s) (at level 9, format "s '#2'") : pair_scope. +Notation "s #1" := (fst s) (at level 1, format "s '#1'") : pair_scope. +Notation "s #2" := (snd s) (at level 1, format "s '#2'") : pair_scope. (** * The Raw functor @@ -241,7 +241,7 @@ Fixpoint join l : key -> elt -> t -> t := *) Record triple := mktriple { t_left:t; t_opt:option elt; t_right:t }. -Notation "<< l , b , r >>" := (mktriple l b r) (at level 9). +Notation "<< l , b , r >>" := (mktriple l b r) (at level 0). Fixpoint split x m : triple := match m with | Leaf => << Leaf, None, Leaf >> @@ -343,10 +343,10 @@ Notation t := tree. Arguments Leaf : clear implicits. Arguments Node [elt]. -Notation "<< l , b , r >>" := (mktriple l b r) (at level 9). -Notation "t #l" := (t_left t) (at level 9, format "t '#l'"). -Notation "t #o" := (t_opt t) (at level 9, format "t '#o'"). -Notation "t #r" := (t_right t) (at level 9, format "t '#r'"). +Notation "<< l , b , r >>" := (mktriple l b r) (at level 0). +Notation "t #l" := (t_left t) (at level 1, format "t '#l'"). +Notation "t #o" := (t_opt t) (at level 1, format "t '#o'"). +Notation "t #r" := (t_right t) (at level 1, format "t '#r'"). (** * Map *) diff --git a/theories/MSets/MSetAVL.v b/theories/MSets/MSetAVL.v index 5fe3f186d5..6542ff8287 100644 --- a/theories/MSets/MSetAVL.v +++ b/theories/MSets/MSetAVL.v @@ -209,7 +209,7 @@ Definition concat s1 s2 := *) Record triple := mktriple { t_left:t; t_in:bool; t_right:t }. -Notation "<< l , b , r >>" := (mktriple l b r) (at level 9). +Notation "<< l , b , r >>" := (mktriple l b r) (at level 0). Fixpoint split x s : triple := match s with | Leaf => << Leaf, false, Leaf >> @@ -530,11 +530,11 @@ Qed. Declare Scope pair_scope. -Notation "s #1" := (fst s) (at level 9, format "s '#1'") : pair_scope. -Notation "s #2" := (snd s) (at level 9, format "s '#2'") : pair_scope. -Notation "t #l" := (t_left t) (at level 9, format "t '#l'") : pair_scope. -Notation "t #b" := (t_in t) (at level 9, format "t '#b'") : pair_scope. -Notation "t #r" := (t_right t) (at level 9, format "t '#r'") : pair_scope. +Notation "s #1" := (fst s) (at level 1, format "s '#1'") : pair_scope. +Notation "s #2" := (snd s) (at level 1, format "s '#2'") : pair_scope. +Notation "t #l" := (t_left t) (at level 1, format "t '#l'") : pair_scope. +Notation "t #b" := (t_in t) (at level 1, format "t '#b'") : pair_scope. +Notation "t #r" := (t_right t) (at level 1, format "t '#r'") : pair_scope. #[local] Open Scope pair_scope. diff --git a/theories/Numbers/Integer/NatPairs/ZNatPairs.v b/theories/Numbers/Integer/NatPairs/ZNatPairs.v index 5efb78bc1d..c85aa96c37 100644 --- a/theories/Numbers/Integer/NatPairs/ZNatPairs.v +++ b/theories/Numbers/Integer/NatPairs/ZNatPairs.v @@ -17,8 +17,8 @@ From Stdlib Require Export Ring. Declare Scope pair_scope. #[local] Open Scope pair_scope. -Notation "s #1" := (fst s) (at level 9, format "s '#1'") : pair_scope. -Notation "s #2" := (snd s) (at level 9, format "s '#2'") : pair_scope. +Notation "s #1" := (fst s) (at level 1, format "s '#1'") : pair_scope. +Notation "s #2" := (snd s) (at level 1, format "s '#2'") : pair_scope. Module ZPairsAxiomsMod (Import N : NAxiomsMiniSig) <: ZAxiomsMiniSig. Module Import NProp. diff --git a/theories/Numbers/NatInt/NZBits.v b/theories/Numbers/NatInt/NZBits.v index 56658268a3..1a9cd76ef6 100644 --- a/theories/Numbers/NatInt/NZBits.v +++ b/theories/Numbers/NatInt/NZBits.v @@ -19,7 +19,7 @@ Module Type Bits (Import A : Typ). End Bits. Module Type BitsNotation (Import A : Typ)(Import B : Bits A). - Notation "a .[ n ]" := (testbit a n) (at level 5, format "a .[ n ]"). + Notation "a .[ n ]" := (testbit a n) (at level 1, format "a .[ n ]"). Infix ">>" := shiftr (at level 30, no associativity). Infix "<<" := shiftl (at level 30, no associativity). End BitsNotation. diff --git a/theories/Numbers/NatInt/NZDomain.v b/theories/Numbers/NatInt/NZDomain.v index a38675e334..b7bb9061b6 100644 --- a/theories/Numbers/NatInt/NZDomain.v +++ b/theories/Numbers/NatInt/NZDomain.v @@ -233,7 +233,7 @@ Definition ofnat (n : nat) : t := (S^n) 0. Declare Scope ofnat. #[local] Open Scope ofnat. -Notation "[ n ]" := (ofnat n) (at level 7) : ofnat. +Notation "[ n ]" := (ofnat n) (at level 0) : ofnat. Lemma ofnat_zero : [O] == 0. Proof. diff --git a/theories/_CoqProject b/theories/_CoqProject index dc56d50852..b34d8dd88a 100644 --- a/theories/_CoqProject +++ b/theories/_CoqProject @@ -1,4 +1,9 @@ -R . Stdlib +# When editing below lines, keep the theories/dune file in sync # to handle when requiring Rocq >= 9.2 -arg -w -arg -notation-for-abbreviation -arg -w -arg -ltac2-notation-for-abbreviation +-arg -w -arg -implicit-create-hint-db +-arg -w -arg -implicit-create-rewrite-hint-db +-arg -w -arg -register-all +-arg -w -arg -scheme-rewriting diff --git a/theories/dune b/theories/dune index d8ea5580ff..c15615087c 100644 --- a/theories/dune +++ b/theories/dune @@ -7,7 +7,7 @@ (dev (coq ;; see theories/_CoqProject for details - (flags :standard -w -notation-for-abbreviation -w -ltac2-notation-for-abbreviation)))) + (flags :standard -w -notation-for-abbreviation -w -ltac2-notation-for-abbreviation -w -implicit-create-hint-db -w -implicit-create-rewrite-hint-db -w -register-all -w -scheme-rewriting)))) (rule (targets All.v)