Skip to content

Commit 45501d6

Browse files
Update lean-toolchain for leanprover/lean4#10763
2 parents 254acaa + 95fd856 commit 45501d6

File tree

13 files changed

+147
-138
lines changed

13 files changed

+147
-138
lines changed

Batteries/CodeAction/Misc.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def casesExpand : TacticCodeAction := fun _ snap ctx _ node => do
299299
let targets := discrInfos.map (·.expr)
300300
match using_ with
301301
| none =>
302-
if Tactic.tactic.customEliminators.get (← getOptions) then
302+
if tactic.customEliminators.get (← getOptions) then
303303
if let some elimName ← getCustomEliminator? targets induction then
304304
return some (← getElimExprNames (← getConstInfo elimName).type)
305305
matchConstInduct (← whnf (← inferType discr₀.expr)).getAppFn
@@ -341,7 +341,7 @@ def casesExpand : TacticCodeAction := fun _ snap ctx _ node => do
341341
(doc.meta.text.utf8PosToLspPos stx'.getTailPos?.get!, "")
342342
else (endPos, " with")
343343
let fallback := if let some ⟨startPos, endPos⟩ := fallback then
344-
doc.meta.text.source.extract startPos endPos
344+
String.Pos.Raw.extract doc.meta.text.source startPos endPos
345345
else
346346
"sorry"
347347
let newText := Id.run do

Batteries/Data/Array/Match.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ private def modifyStep [BEq α] (m : Matcher α) [Iterator σ n α]
126126
instance [Monad n] [BEq α] (m : Matcher α) [Iterator σ n α] :
127127
Iterator (m.Iterator σ n α) n σ where
128128
IsPlausibleStep it step := ∃ step', m.modifyStep it step' = step
129-
step it := it.internalState.inner.step >>= fun step => pure ⟨m.modifyStep _ _, step, rfl⟩
129+
step it := it.internalState.inner.step >>=
130+
fun step => pure (.deflate ⟨m.modifyStep _ _, step.inflate, rfl⟩)
130131

131132
private def finitenessRelation [Monad n] [BEq α] (m : Matcher α) [Iterator σ n α] [Finite σ n] :
132133
FinitenessRelation (m.Iterator σ n α) n where

Batteries/Data/ByteArray.lean

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ theorem get_push_lt (a : ByteArray) (x : UInt8) (i : Nat) (h : i < a.size) :
3636

3737
/-! ### set -/
3838

39-
@[simp] theorem data_set (a : ByteArray) (i : Fin a.size) (v : UInt8) :
40-
(a.set i v).data = a.data.set i v i.isLt := rfl
41-
4239
@[simp] theorem size_set (a : ByteArray) (i : Fin a.size) (v : UInt8) :
4340
(a.set i v).size = a.size :=
4441
Array.size_set ..

Batteries/Data/String/Basic.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ def toAsciiByteArray (s : String) : ByteArray :=
2626
`loop p out = out ++ toAsciiByteArray ({ s with startPos := p } : Substring)`
2727
-/
2828
loop (p : Pos.Raw) (out : ByteArray) : ByteArray :=
29-
if h : s.atEnd p then out else
30-
let c := s.get p
31-
have : utf8ByteSize s - (next s p).byteIdx < utf8ByteSize s - p.byteIdx :=
29+
if h : p.atEnd s then out else
30+
let c := p.get s
31+
have : utf8ByteSize s - (Pos.Raw.next s p).byteIdx < utf8ByteSize s - p.byteIdx :=
3232
Nat.sub_lt_sub_left (Nat.lt_of_not_le <| mt decide_eq_true h)
3333
(Nat.lt_add_of_pos_right (Char.utf8Size_pos _))
34-
loop (s.next p) (out.push c.toUInt8)
34+
loop (p.next s) (out.push c.toUInt8)
3535
termination_by utf8ByteSize s - p.byteIdx
3636
loop 0 ByteArray.empty

Batteries/Data/String/Lemmas.lean

Lines changed: 85 additions & 74 deletions
Large diffs are not rendered by default.

Batteries/Lean/Float.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def toStringFull (f : Float) : String :=
6868
else
6969
let rem := Nat.repr ((2^e + v' % 2^e) * 5^e)
7070
let rem := rem.dropRightWhile (· == '0')
71-
s!"{intPart}.{rem.extract ⟨1⟩ rem.endPos}"
71+
s!"{intPart}.{String.Pos.Raw.extract rem ⟨1⟩ rem.endPos}"
7272
if v < 0 then s!"-{s}" else s
7373
else f.toString -- inf, -inf, nan
7474

BatteriesTest/lemma_cmd.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Batteries.Tactic.Lemma
33
-- lemma disabled by default
44
/--
55
info: Try this:
6-
theorem
6+
[apply] theorem
77
---
88
error: `lemma` is not supported by default, please use `theorem` instead.
99
Use `set_option lang.lemmaCmd true` to enable the use of the `lemma` command in a file.
@@ -19,7 +19,7 @@ lemma test2 : 3 < 7 := by decide
1919
-- lemma disabled again
2020
/--
2121
info: Try this:
22-
theorem
22+
[apply] theorem
2323
---
2424
error: `lemma` is not supported by default, please use `theorem` instead.
2525
Use `set_option lang.lemmaCmd true` to enable the use of the `lemma` command in a file.

BatteriesTest/show_term.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Authors: Kim Morrison
66

77
/--
88
info: Try this:
9-
exact (n, 37)
9+
[apply] exact (n, 37)
1010
-/
1111
#guard_msgs in example (n : Nat) : Nat × Nat := by
1212
show_term
@@ -16,15 +16,15 @@ info: Try this:
1616

1717
/--
1818
info: Try this:
19-
refine (?_, ?_)
19+
[apply] refine (?_, ?_)
2020
-/
2121
#guard_msgs in example : Nat × Nat := by
2222
show_term constructor
2323
repeat exact 42
2424

2525
/--
2626
info: Try this:
27-
fun {X} => X
27+
[apply] fun {X} => X
2828
-/
2929
#guard_msgs in example : {_a : Nat} → Nat :=
3030
show_term by

BatteriesTest/simp_trace.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ set_option linter.missingDocs false
77

88
/--
99
info: Try this:
10-
simp only [Nat.add_comm]
10+
[apply] simp only [Nat.add_comm]
1111
-/
1212
#guard_msgs in
1313
example : x + 1 = 1 + x := by simp? [Nat.add_comm, Nat.mul_comm]
1414
/--
1515
info: Try this:
16-
dsimp only [Nat.reduceAdd]
16+
[apply] dsimp only [Nat.reduceAdd]
1717
-/
1818
#guard_msgs in
1919
example : 1 + 1 = 2 := by dsimp?
@@ -27,10 +27,10 @@ example : 1 + 1 = 2 := by dsimp?
2727

2828
/--
2929
info: Try this:
30-
simp only [foo, bar]
30+
[apply] simp only [foo, bar]
3131
---
3232
info: Try this:
33-
simp only [foo, baz]
33+
[apply] simp only [foo, baz]
3434
-/
3535
#guard_msgs in
3636
example : foo x y = 1 + y := by
@@ -40,7 +40,7 @@ example : foo x y = 1 + y := by
4040

4141
/--
4242
info: Try this:
43-
simp only [foo, bar, baz]
43+
[apply] simp only [foo, bar, baz]
4444
-/
4545
#guard_msgs in
4646
example : foo x y = 1 + y := by

BatteriesTest/simpa.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ example (P : Bool) (h : ¬ ¬ P) : P := by
9696

9797
/--
9898
info: Try this:
99-
simpa only using h
99+
[apply] simpa only using h
100100
-/
101101
#guard_msgs in
102102
example (p : Prop) (h : p) : p := by simpa? using h
103103

104104
/--
105105
info: Try this:
106-
simpa only [and_true] using h
106+
[apply] simpa only [and_true] using h
107107
-/
108108
#guard_msgs in
109109
example (p : Prop) (h : p ∧ True) : p := by simpa? using h

0 commit comments

Comments
 (0)