Fix 'dangling_pointers_from_temporaries' warning in test#3491
Merged
stevenengler merged 1 commit intoshadow:mainfrom Jan 13, 2025
Merged
Fix 'dangling_pointers_from_temporaries' warning in test#3491stevenengler merged 1 commit intoshadow:mainfrom
stevenengler merged 1 commit intoshadow:mainfrom
Conversation
07bda1e to
925d4e4
Compare
925d4e4 to
852faf0
Compare
This is a new warning in rust 1.84.
There are two warnings of the form:
```text
warning: a dangling pointer will be produced because the temporary `Vec<*const i8>` will be dropped
--> test/clone/test_fork.rs:1825:55
|
1825 | in("rsi") execv_argvec(&args).as_ptr(),
| ------------------- ^^^^^^ this pointer will immediately be invalid
| |
| this `Vec<*const i8>` is deallocated at the end of the statement, bind it to a variable to extend its lifetime
|
= note: pointers do not have a lifetime; when calling `as_ptr` the `Vec<*const i8>` will be deallocated at the end of the statement because nothing is referencing it as far as the type system is concerned
= help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
= note: `#[warn(dangling_pointers_from_temporaries)]` on by default
```
852faf0 to
c6eea61
Compare
sporksmith
approved these changes
Jan 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a new warning in rust 1.84.
There are two warnings of the form: