File tree Expand file tree Collapse file tree 6 files changed +14
-15
lines changed Expand file tree Collapse file tree 6 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -475,14 +475,12 @@ stdlib__Lazy.cmi : lazy.mli \
475
475
camlinternalLazy.cmi
476
476
stdlib__Lexing.cmo : lexing.ml \
477
477
stdlib__Sys.cmi \
478
- stdlib__String.cmi \
479
478
stdlib__Int.cmi \
480
479
stdlib__Bytes.cmi \
481
480
stdlib__Array.cmi \
482
481
stdlib__Lexing.cmi
483
482
stdlib__Lexing.cmx : lexing.ml \
484
483
stdlib__Sys.cmx \
485
- stdlib__String.cmx \
486
484
stdlib__Int.cmx \
487
485
stdlib__Bytes.cmx \
488
486
stdlib__Array.cmx \
Original file line number Diff line number Diff line change @@ -332,9 +332,9 @@ val ends_with :
332
332
This section describes unsafe, low-level conversion functions
333
333
between [bytes] and [string]. They do not copy the internal data;
334
334
used improperly, they can break the immutability invariant on
335
- strings provided by the [-safe-string] option. They are available for
336
- expert library authors, but for most purposes you should use the
337
- always-correct {!to_string} and {!of_string} instead.
335
+ strings. They are available for expert library authors, but for
336
+ most purposes you should use the always-correct {!to_string} and
337
+ {!of_string} instead.
338
338
*)
339
339
340
340
val unsafe_to_string : bytes -> string
Original file line number Diff line number Diff line change @@ -332,9 +332,9 @@ val ends_with :
332
332
This section describes unsafe, low-level conversion functions
333
333
between [bytes] and [string]. They do not copy the internal data;
334
334
used improperly, they can break the immutability invariant on
335
- strings provided by the [-safe-string] option. They are available for
336
- expert library authors, but for most purposes you should use the
337
- always-correct {!to_string} and {!of_string} instead.
335
+ strings. They are available for expert library authors, but for
336
+ most purposes you should use the always-correct {!to_string} and
337
+ {!of_string} instead.
338
338
*)
339
339
340
340
val unsafe_to_string : bytes -> string
Original file line number Diff line number Diff line change @@ -163,10 +163,13 @@ let from_channel ?with_positions ic =
163
163
from_function ?with_positions (fun buf n -> input ic buf 0 n)
164
164
165
165
let from_string ?(with_positions = true ) s =
166
+ (* We can't use [Bytes.unsafe_of_string] here,
167
+ [lex_buffer] is exported in the mli, one can mutate
168
+ it outside this module. *)
169
+ let lex_buffer = Bytes. of_string s in
166
170
{ refill_buff = (fun lexbuf -> lexbuf.lex_eof_reached < - true );
167
- lex_buffer = Bytes. of_string s; (* have to make a copy for compatibility
168
- with unsafe-string mode *)
169
- lex_buffer_len = String. length s;
171
+ lex_buffer;
172
+ lex_buffer_len = Bytes. length lex_buffer;
170
173
lex_abs_pos = 0 ;
171
174
lex_start_pos = 0 ;
172
175
lex_curr_pos = 0 ;
Original file line number Diff line number Diff line change @@ -347,8 +347,7 @@ val rindex_opt : string -> char -> int option
347
347
348
348
val to_seq : t -> char Seq .t
349
349
(* * [to_seq s] is a sequence made of the string's characters in
350
- increasing order. In ["unsafe-string"] mode, modifications of the string
351
- during iteration will be reflected in the sequence.
350
+ increasing order.
352
351
353
352
@since 4.07 *)
354
353
Original file line number Diff line number Diff line change @@ -347,8 +347,7 @@ val rindex_opt : string -> char -> int option
347
347
348
348
val to_seq : t -> char Seq .t
349
349
(* * [to_seq s] is a sequence made of the string's characters in
350
- increasing order. In ["unsafe-string"] mode, modifications of the string
351
- during iteration will be reflected in the sequence.
350
+ increasing order.
352
351
353
352
@since 4.07 *)
354
353
You can’t perform that action at this time.
0 commit comments