Repository navigation
Conversation
|
Nice fixes. Thanks. |
I think the waitpid function might actually make more sense if it was a method on On unix a process can only wait on its children, and allowing calls to waitpid without going through Program could lead to race conditions because after calling waitpid the pid can be re-used which means that the Program finish method (or the Program destructor...) might actually wait on a different process. On windows a process can wait (i.e. WaitForSingleObject) on the children of other processes, but I guess it would be OK to not present an API for doing this via It is probably also worth mentioning that the ProgRepr destructor does a waitpid to wait for the process to exit, unless the process has already been waited on. I think this might be a bit unexpected, so maybe the documentation for
I agree that sounds sensible and I shall consider attempting follow-ups. |
- The return value meant different things on different platforms (on windows, it was the exit code, on unix it was the status information returned from waitpid). - It was undocumented. - There also exists run::waitpid, which does much the same thing but has a more consistent return value and also some documentation.
|
I rebased because BORS told me to ;) r? |
This fixes #5976. It also removes `os::waitpid` in favour of (the existing) `run::waitpid`. I included this change because I figured it is kind of related. r?
Add a case to `lint_search_is_some` to handle searching strings Fixes: rust-lang#6010 This adds a lint which recommends using `contains()` instead of `find()` followed by `is_some()` on strings as suggested in rust-lang#6010. This was added as an additional case to https://github.com/rust-lang/rust-clippy/blob/5af88e3c2d8cc4fb74a0e455381669930ee3a31a/clippy_lints/src/methods/mod.rs#L3037 I would really appreciate any comments/suggestions for my code! changelog: Added case to `lint_search_is_some` to handle searching strings
6010: Avoid checking all ancestors and fix mis-completion r=jonas-schievink a=oxalica Refactor the logic of `completion_match` to check deterministic number of ancestors instead of `token.ancestors().find_map()`. This should fix wrong completions (rust-lang/rust-analyzer#5976 (comment)) and hopefully make completion to be faster (rust-lang#6004). More play and test? @jonas-schievink @hammypants If this patch works, we can avoid the revert rust-lang#6005 . 😞 Co-authored-by: oxalica <oxalicc@pm.me>
This fixes #5976.
It also removes
os::waitpidin favour of (the existing)run::waitpid. I included this change because I figured it is kind of related.r?