-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IntoIterator for Tokens is unsound #105
Closed
Comments
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Nov 1, 2023
…notriddle Update minifier-rs version to 0.3.0 It fixes GuillaumeGomez/minifier-rs#105. r? `@notriddle`
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 1, 2023
…notriddle Update minifier-rs version to 0.3.0 It fixes GuillaumeGomez/minifier-rs#105. r? ``@notriddle``
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 1, 2023
…notriddle Update minifier-rs version to 0.3.0 It fixes GuillaumeGomez/minifier-rs#105. r? ```@notriddle```
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Nov 2, 2023
Rollup merge of rust-lang#117488 - GuillaumeGomez:update-minifier, r=notriddle Update minifier-rs version to 0.3.0 It fixes GuillaumeGomez/minifier-rs#105. r? ```@notriddle```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
minifier-rs/src/js/token.rs
Lines 1076 to 1089 in c8e8bee
This produces a lifetime much longer than correct: it produces a reference to vec data that has a local lifetime but extends that to
'a
.Furthermore, since this is in an IntoIterator impl, most of the time this gets used it will be unsound: the vector is dropped immediately after IntoIterator, but these references could potentially be held on to for much longer.
If the Iterator API cannot express what is necessary here, we should not use the iterator API.
Is there a reason that second tuple field is needed anyway? It feels like we can do better exposing a
.last()
method or something.fails on miri:
The text was updated successfully, but these errors were encountered: