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:
overlookmotel 2025-01-07 06:58:25 +00:00
parent 64bfdfe223
commit e1f8ea41ad

View file

@ -60,7 +60,6 @@ use super::search::SEARCH_BATCH_SIZE;
/// 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`,
/// which are safe methods, and compiler will often reduce to equally efficient code.
#[derive(Clone)]
pub(super) struct Source<'a> {
/// Pointer to start of source string. Never altered after initialization.
start: *const u8,