Skip to content

Conversation

@datokrat
Copy link
Contributor

@datokrat datokrat commented Dec 4, 2025

This PR implements a linter that warns when a deprecated coercion is applied. It also warns when the Option coercion or the Subarray-to-Array coercion is used in Init or Std. The linter is currently limited to Coe instances; CoeFun instances etc. are not considered.

The linter works by collecting the Coe instance declaration names that are being expanded in expandCoe? and storing them in the info tree. The linter itself then analyzes the info tree and checks for banned or deprecated coercions.

@datokrat datokrat added the changelog-language Language features and metaprograms label Dec 4, 2025
@datokrat datokrat force-pushed the paul/slices/subarraycopy branch from fd79930 to 1e5d986 Compare December 4, 2025 14:08
@datokrat
Copy link
Contributor Author

datokrat commented Dec 4, 2025

!radar

@leanprover-radar
Copy link

leanprover-radar commented Dec 4, 2025

Benchmark results for 9cb732c against 0173444 are in! @datokrat

Minor changes (5)
  • 🟥 Init.Prelude async//instructions: +74.3M (+0.6%)
  • 🟥 Std.Data.Internal.List.Associative//instructions: +472.5M (+0.5%)
  • 🟥 build//instructions: +29.6G (+0.2%)
  • lake config import//instructions: -10.8M (-0.7%)
  • 🟥 simp_congr//instructions: +135.6M (+0.7%)

@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Dec 4, 2025
@leanprover-bot
Copy link
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2025-12-03 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-manual, reference manual CI should run now. You can force reference manual CI using the force-manual-ci label. (2025-12-04 16:24:18)

leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Dec 4, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Dec 4, 2025
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Dec 4, 2025

Mathlib CI status (docs):

@leanprover-community-bot leanprover-community-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Dec 4, 2025
@datokrat datokrat marked this pull request as ready for review December 5, 2025 06:47
@datokrat datokrat requested a review from mhuisi December 5, 2025 06:47
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Dec 5, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Dec 5, 2025
@datokrat datokrat force-pushed the paul/slices/subarraycopy branch from d24a4d4 to b65f92d Compare December 11, 2025 13:33
@datokrat datokrat closed this Dec 11, 2025
@datokrat datokrat reopened this Dec 11, 2025
@datokrat datokrat marked this pull request as draft December 11, 2025 13:34
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Dec 11, 2025
@datokrat datokrat marked this pull request as ready for review December 11, 2025 15:18
@datokrat datokrat changed the base branch from paul/base/slices/subarraycopy to master December 11, 2025 15:27
@datokrat datokrat added this pull request to the merge queue Dec 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Dec 11, 2025
fix test and simp 'copy' to 'toArray'

write linter

add backticks

make the linter more defensive to avoid panics

make sure stage0 is updated after merging

revert the changes in src/Lean

why doesn't this work?

Revert "revert the changes in src/Lean"

This reverts commit 75c7082.

revert the changes in src/Lean
@datokrat datokrat force-pushed the paul/slices/subarraycopy branch from b65f92d to d0e49fe Compare December 12, 2025 14:45
@datokrat datokrat enabled auto-merge December 12, 2025 14:46
@datokrat datokrat added this pull request to the merge queue Dec 12, 2025
Merged via the queue into master with commit 9d7d15b Dec 12, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-mathlib CI has verified that Mathlib builds against this PR changelog-language Language features and metaprograms toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants