mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 04:42:10 +00:00
parent
233654af54
commit
d44301c871
1 changed files with 2 additions and 2 deletions
|
|
@ -572,7 +572,7 @@ impl<'a> SourcePosition<'a> {
|
||||||
// SAFETY:
|
// SAFETY:
|
||||||
// Caller guarantees `self` is not at end of source text.
|
// Caller guarantees `self` is not at end of source text.
|
||||||
// `Source` is created from a valid `&str`, so points to allocated, initialized memory.
|
// `Source` is created from a valid `&str`, so points to allocated, initialized memory.
|
||||||
// `Source` conceptually holds the source text `&str`, which guarantees to mutable references
|
// `Source` conceptually holds the source text `&str`, which guarantees no mutable references
|
||||||
// to the same memory can exist, as that would violate Rust's aliasing rules.
|
// to the same memory can exist, as that would violate Rust's aliasing rules.
|
||||||
// Pointer is "dereferenceable" by definition as a `u8` is 1 byte and cannot span multiple objects.
|
// Pointer is "dereferenceable" by definition as a `u8` is 1 byte and cannot span multiple objects.
|
||||||
// Alignment is not relevant as `u8` is aligned on 1 (i.e. no alignment requirements).
|
// Alignment is not relevant as `u8` is aligned on 1 (i.e. no alignment requirements).
|
||||||
|
|
@ -590,7 +590,7 @@ impl<'a> SourcePosition<'a> {
|
||||||
// SAFETY:
|
// SAFETY:
|
||||||
// Caller guarantees `self` is not at no later than 2 bytes before end of source text.
|
// Caller guarantees `self` is not at no later than 2 bytes before end of source text.
|
||||||
// `Source` is created from a valid `&str`, so points to allocated, initialized memory.
|
// `Source` is created from a valid `&str`, so points to allocated, initialized memory.
|
||||||
// `Source` conceptually holds the source text `&str`, which guarantees to mutable references
|
// `Source` conceptually holds the source text `&str`, which guarantees no mutable references
|
||||||
// to the same memory can exist, as that would violate Rust's aliasing rules.
|
// to the same memory can exist, as that would violate Rust's aliasing rules.
|
||||||
// Pointer is "dereferenceable" by definition as a `u8` is 1 byte and cannot span multiple objects.
|
// Pointer is "dereferenceable" by definition as a `u8` is 1 byte and cannot span multiple objects.
|
||||||
// Alignment is not relevant as `u8` is aligned on 1 (i.e. no alignment requirements).
|
// Alignment is not relevant as `u8` is aligned on 1 (i.e. no alignment requirements).
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue