mirror of
https://github.com/danbulant/oxc
synced 2026-05-22 13:48:55 +00:00
fix(lexer): Source is not Clone (#8294)
It's an invariant of `Source` that only a single instance of `Source` can exist at any time. `Source` was erroneously implementing `Clone`, which makes it trivial to break this invariant. `Clone` is unnecessary, so remove it.
This commit is contained in:
parent
64bfdfe223
commit
e1f8ea41ad
1 changed files with 0 additions and 1 deletions
|
|
@ -60,7 +60,6 @@ use super::search::SEARCH_BATCH_SIZE;
|
||||||
/// are satisfied, to restore this invariant before passing control back to other code.
|
/// are satisfied, to restore this invariant before passing control back to other code.
|
||||||
/// It will often be preferable to instead use `Source::peek_byte`, followed by `Source::next_char`,
|
/// It will often be preferable to instead use `Source::peek_byte`, followed by `Source::next_char`,
|
||||||
/// which are safe methods, and compiler will often reduce to equally efficient code.
|
/// which are safe methods, and compiler will often reduce to equally efficient code.
|
||||||
#[derive(Clone)]
|
|
||||||
pub(super) struct Source<'a> {
|
pub(super) struct Source<'a> {
|
||||||
/// Pointer to start of source string. Never altered after initialization.
|
/// Pointer to start of source string. Never altered after initialization.
|
||||||
start: *const u8,
|
start: *const u8,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue